Skip to content
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

Subtracting rectangle path from circle produces unexpected results #736

Closed
markmanx opened this issue Jul 22, 2015 · 3 comments
Closed

Subtracting rectangle path from circle produces unexpected results #736

markmanx opened this issue Jul 22, 2015 · 3 comments

Comments

@markmanx
Copy link

The circle in this example should be split cleanly into two halves by subtracting a rectangle.
Sometimes this happens, sometimes not (depending on the y-positioning of the rectangle)
Setting a y-position of 10 seems to work, but a y-position of 0 does not. Any ideas?

http://sketch.paperjs.org/#S/dZDBqsIwEEV/JWRjhb4QBRcqrvwB0WXtIo3jMxiTMp1WRfx3J0WKIO7m3jtzZpKHDOYCciF3ZyB7krm08ZB0Z1BYh1asRICr2Bg6qTVrD1mhc6HLXMz0eLkPqUkdW+/vO/BgCQ48QtgCZ/uQMMjuG1ObGlD1sC27Jvx/8IrJnKupLhM2Df3C9lkdG0cuBnXj4G+qv/w7+3o4omkr1v2xXBIaS1nqH56AcIkdZMPuD80DA5YhnYOrshAI8B0enffr6CNyOqp8C6Ml/2SFYM51dIEauSjK5ws=

@lehni
Copy link
Member

lehni commented Jul 26, 2015

@hkrish this seems to be different from the other issues we're facing in boolean ops. Any thoughts on why this may occur?

@iconexperience
Copy link
Contributor

@lehni

I agree, this seems to be different. My guess is that the negative corrdinates play a role here, because it seems that if you shift the objects to the middle of the view before the subtraction, everthing works as expected.

Sorry, I made a mistake when testing. Results are the same if you shift the objects to positive coordinate space before subtracting. Here is the sketch:

http://sketch.paperjs.org/#S/dZBNCsIwEIWvErKxQglREPzBlRcQXbZdpHHU0JiUaVot4t2dVBFB3ISZN3nfvOTOnboAX/J9BUGfecq1P8S+U8i0Qc3WzMGVbVU4iw31FpJsImXK6ChSNpPjVe7iRXFsre33YEEHOJAtYAs0y11EIalvVK1qQDEAd6Qqd4pMIkZeNllQNZVFxEbTP+wwq31jgvFO3Ggwlz9yTzLlHFK8cjRtSdqQl8qASockej6vQLj4DpLP+q8+d2QRR2PtxluPxBmVtoXRin6tRFBV7Y0LDV9mxeMJ

So this has nothing to do with negative coordinates.

@lehni
Copy link
Member

lehni commented Aug 18, 2015

I have managed to identify the source of this, an error in the way how we prevent rays from being counted twice at the beginnings / ends of curves in the getWinding() code. Rather tricky stuff, I hope the fix is solid for all cases...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants