-
Notifications
You must be signed in to change notification settings - Fork 217
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
Fix/issue1349 second #1356
Fix/issue1349 second #1356
Conversation
I think this PR creates a regression for the symdiff of the following to geometries: geo1: MULTIPOLYGON(((14 10,14 8,12 8,12 6,14 6,14 2,12 2,12 0,6 0,6 2,4 2,4 0,0 0,0 2,2 2,2 4,0 4,0 10,2 10,2 14,6 14,6 12,8 12,8 14,10 14,10 12,12 12,12 10,14 10),(12 10,8 10,8 8,8 6,4 6,4 4,6 4,6 2,8 2,8 4,10 4,10 8,12 8,12 10),(4 6,4 8,2 8,2 6,4 6),(4 8,6 8,6 10,4 10,4 8)),((14 12,12 12,12 14,14 14,14 12))) I will try to look at this in more detail later. I currently lack insight to review the algorithmic changes in detail (will try later). Until then, this example is based on random testing with the following code: https://gist.github.com/tinko92/fad450e1058ce8ceebde66a6b86d45c1 The sizes in line 173 can be changed for larger/smaller examples. I usually have to leave it running for a while before it finds something. It finds cases for difference and union as well. I will try to make it reduce cases to minimal complexity later. |
Interesting test! Thanks for the link. So this is an alternative stress test for https://github.com/boostorg/geometry/blob/develop/test/robustness/overlay/areal_areal/recursive_polygons.cpp which I ran often (but it's now a while ago). All the test cases with names like I'm using your test now as a stochastic check for the various approaches. For example, the case you mentioned was already wrong on the A PR should make the behaviour in general better. But even if some cases in a stress test, which are not part of the existing test suite, might fail, it might still be acceptable. I'll make a table, which will help me. |
By the way, the geo1 input was already invalid. A valid version is:
And then it looks completely OK to me. |
So I used:
For 5 approaches:
|
So, in summary, it depends how you look at it. No approach is perfect yet. Most improve what is in The last one using But in the recursive polygon test, with triangles, it has several errors. I investigated two of them, and it would need a follow-up in other code (so: not in the isolation check). But for the rest it is conceptually the best solution. Questions:
|
@tinko92 will we add your test to the robustness tests? |
Will be replaced |
@barendgehrels Sorry, I forgot to respond to this, I will try to clean it up and prepare a PR. |
Cool, nice! I didn't write yet that I had to change that it should work for C++14... |
This is an updated version of #1350
See also the pictures there.
It should be build on top of #1355 In the past that was easy to configure, now I don't see it anymore.
Summary of fixes:
There might be a follow-up, but that is far from ready so I think we should go first for this one.I'm busy with the follow-up which is now in a promising state. Will close this one.