-
Notifications
You must be signed in to change notification settings - Fork 311
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
loop.Normalize() not working as expected? #369
Comments
I'm not sure who maintains the pip build of S2 (it's not us). You'll likely have to ask there :( |
Even regardless of the diff between the pip build (0.9.0) and github (0.11.1), do you confirm that github results are as expected? |
Our bindings don't even expose S2Loop so I can't test directly. If you can reproduce in C++ I can debug it though. |
I found a more manageable example (with 2k vertices instead of 12k), you can slap this example in the test suite to investigate. |
FYI I |
Sorry for the delay but I dug into this further. The problem is the loop has duplicate vertices at the start and end (you don't have to close them manually). Having those duplicate vertices breaks the containment check which determines whether the loop contains S2::Origin() or not. If I remove them it seems to work fine. If you don't know the provenance of your loops, then either running them through S2Builder to make them valid or checking with IsValid is advisable:
|
Ok thank you for your help, will try to use S2Builder or remove the start & end vertices. |
Hi,
I've got this loop that I'm not sure Normalize() works as expected on (sorry, it's huge).
At the end of the snippet there are instructions to build the loop and with the questions.
The script was run by building a recent s2geometry (0.11.0) and pip installing it.
Note that with the simple
pip install s2geometry
(0.9.0) it works as expected (areas are equal).Thank you for your time,
Best regards,
Paul
The text was updated successfully, but these errors were encountered: