-
Notifications
You must be signed in to change notification settings - Fork 214
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_ returns invalid polygon #1226
Comments
@andershol check this link it is giving the correct points |
I think you misunderstood, but perhaps I was imprecise. Except from making the output a bit more verbose (I tried to keep it short), your code seem identical to mine, and your result also seems to be identical. That is, there are 10 points in the output, but only 4 distinct points, so the quadrilateral is traversed twice.
I was not saying that the points in the output is placed incorrectly. I was saying that the path goes around the rim twice. You don't see that, when you just draw the polygon as you don't see that every line segment is painted twice. |
I can reproduce the issue with 1.84. This is a bug. On my platform (linux, gcc9) the issue is "resolved" when using
A side remark here, the output is indeed invalid but the statement about the number of vertices of the union is incorrect. Please consider the creation of new vertices in the union as the intersection of edges of the input polygons. Note, that the output computed with |
This code simply takes the union of two simple polygons. But with these specific polygons the result is a "double wound" polygon, i.e. the path goes around the rim twice. Fails with 1.83 and 1.84, but works with 1.73, but that might just be due to that version not running with BOOST_GEOMETRY_NO_ROBUSTNESS.
Can be compiled on windows with:
And running the executable result in:
Note that polygon a has 5 points (including closing duplicate), polygon b has 4 points, but output has 10 and I don't think the output should ever have more points than the sum of the input polygons. And going around twice seems to me to be invalid.
The text was updated successfully, but these errors were encountered: