-
Notifications
You must be signed in to change notification settings - Fork 30
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
union does not produce expected result when used with difference #78
Comments
I think something must be a little off in the direction of the paths that come from ex3 = stroke $ B.union Winding $ rose 1 3 <> (reversePath $ B.difference Winding (circle 2) (circle 1.9)) |
Ah, right @fryguybob , that jogged my memory. There was this similar bug that is now fixed: #67 but in general it seems this is a known issue with |
Since there hasn't been any movement on this on the cubicbezier side, I'd like to fix this on the diagrams side, but I'd like some feedback on what the desired behaviour is. I can think of two reasonable interpretations:
|
I think option (2) actually requires the improvements to segmentSegment discussed in diagrams-lib issue #323 in order to be able to map sections of output looks back to input loops. |
Issue diagrams#78 "union does not produce expected result when used with difference" occurs because difference is returning loops that wind the opposite direction from what is expected. The solution is to enforce that the outermost loops wind counterclockwise to be consistent with the direction that the shape functions provided by diagrams-lib wind. A more precise solution would be to match the winding of the outermost loops to that of the input loops they are constructed from, but the intersection functions in diagrams-lib do not currently support finding the intersections between segments that overlap, which prevents us from determining which input loops correspond to the outermost output loops.
In the following code ex3 should be the union of the the star with the ring, but instead union just returns the equivilent of ex2.
The text was updated successfully, but these errors were encountered: