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

Substract operation of two paths results in open path error message #839

Closed
iconexperience opened this issue Dec 1, 2015 · 3 comments
Closed

Comments

@iconexperience
Copy link
Contributor

This simple subtract operation of two paths results in an "Boolean operation resulted in open path" message and an incorrect result.

var p1 =  new Path({segments:[
                [522, 352, 0, 0, 0, 0],
                [500, 400, 0, 0, 0, 0],
                [480, 400, 0, 0, 0, 0],
                [448, 448, 0, 0, 0, 0],
                [100, 448, 0, 0, 0, 0],
                [100, 352, 0, 0, 0, 0]],
                closed:true});
var p2 = new Path.Rectangle(250, 300, 100, 200);
var result = p1.subtract(p2);

Here is the sketch.

On the screenshot below I have highlighted an important area with a circle:

image

The horizontal line in the highlighted area seems to be part of the cause for this bug. If the line is changed to a non-horizontal line, the error message disappears and a correct result is computed. Here is a sketch to test.

Note that this bug is different from #835, as this occurs on a subtraction between two paths.

@iconexperience
Copy link
Contributor Author

Everything seems to work well until tracePaths(), so that's where we need to look into.
When entering tracePaths() the _winding attribute of three segments is already different if we change the horizontal line to non-horizontal. So we must investigate what happens previously.

@iconexperience
Copy link
Contributor Author

I am almost 100% sure that this bug is a duplicate of #819, because the difference in winding gets reported for points that have the same y value as the horizontal line, just in the example in #819. So let's finally fix the getWinding() function.

@iconexperience
Copy link
Contributor Author

Closing this as duplicate of #819.

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

2 participants