New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pieslice
draws very thin sectors incorrectly
#5432
Comments
https://github.com/xtsm/Pillow/blob/17d83d6a7c619e87fab84c59860989772fdcdb7d/src/libImaging/Draw.c#L1342 |
Thanks for #5460. That is the 'quick and dirty solution' you mention. For the record, does that mean you're aware of a better solution? |
Nope. I just don't like the entire "clip ellipse down to an arc with semiplanes" stuff because I suspect there is a better algorithm for drawing arcs. Not sure which exactly though, maybe some generalized path drawing like in cairo, don't have much time to research rn. If we stick with the current approach, this seems to be a legit solution. |
What did you do?
I drew a circle sector with a very small central angle using
pieslice
.What did you expect to happen?
I expected to get a shape approximating a line from the edge of the (imagined) disk to its center.
What actually happened?
The (approximate) line extends past the disk's center.
The effect is more pronounced for smaller central angles and less pronounced for arcs starting/ending near 0° and 180°.
The following images show 1° arcs drawn using
pieslice
and a small red circle marking the center of the corresponding disk. The script creating them is given at the end.These results are as expected (base angles 0°, 180°):
The following demonstrate the problem (base angles 15°, 45°, 90°, 270°):
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: