Closed typemytype closed 7 years ago
Yeah, I changed from AddPaths
(which only raises when all input contours are invalid for clipping) to AddPath
in a for loop, so now it raises if any one is invalid.
But maybe you're right, it's a bit too much.
We can revert to using AddPaths
by default if you like, and have an option to raise if any single one is invalid.
My understanding is that subject contours are invalid if they have no area, or if they are open. Clipping paths can be open (unlike subject ones), but we currently do not use the closed=True
keyword argument of AddPath
and AddPaths
, thus we always assume that the input contours are closed (which may not always be).
By the way, do you know the Clipper library also exports a Area
method?
https://github.com/greginvm/pyclipper/blob/master/pyclipper/pyclipper.pyx#L279-L291
It should be faster than the pure-python AreaPen as it's written in C++, and should also be accurate since Clipper also uses that to compute the orientation of paths.
note that the pyclipper.Area
function only works on polygons, not on bezier contours.
using pyClipper.Area
and ignore those would be fine, as those will fail in pyClipper and do nothing the the operation
Using open contours is an option an implementation can handle. The choice not to add them or closing them should be made elsewhere.
That's good, thanks
should we tag 0.6.3?
It's easy to do from the Github website: https://github.com/typemytype/booleanOperations/releases/new
Yep, a tag touch would be nice
Thanks!
On Sat, 17 Dec 2016 at 19:23, Cosimo Lupo notifications@github.com wrote:
done https://github.com/typemytype/booleanOperations/releases/tag/0.6.3
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/typemytype/booleanOperations/issues/41#issuecomment-267778378, or mute the thread https://github.com/notifications/unsubscribe-auth/ABIp1kZIdhSh4V0LTtKZTn9QhgX41YT1ks5rJCiHgaJpZM4LNCxr .
It super nice to have some exceptions raised
but its also a hard: fe a contour with 2 line segments, so no area, would raise an exception for the whole glyph. Visually this contour would always disappear.
https://github.com/typemytype/booleanOperations/blob/master/Lib/booleanOperations/booleanOperationManager.py#L41
In some cases a silent fail is nice. Im unsure what else pyclipper.ClipperException is catching when adding a path.