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

Regression 1.78.0 - 1.79.0 (still in 1.82.0): difference of two polygons gives unexpected empty result #1138

Closed
gastald88 opened this issue Apr 21, 2023 · 4 comments
Milestone

Comments

@gastald88
Copy link

I have two polygons p1 and p2, where the difference p1 - p2 is clearly non-empty (see image, p1 blue, p2 orange), but the difference operation returns an empty polygon.

image

Here below a godbolt link to replicate this problem:
https://godbolt.org/z/YTjM3GG1G

The result is correct in boost version 1.78.0 (you can set at the godbolt platform in the compiler arguments -I/opt/compiler-explorer/libs/boost_1_78_0)

From version 1.79.0 on (until the 1.82.0 that I recentely tested on my local environment) the result is incorrect.

I also tried to define the macro BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE, but the bug is still there.

@gastald88 gastald88 changed the title Regression 1.78.0 - 1.79.0: difference of two polygons gives unexpected empty result Regression 1.78.0 - 1.79.0 (still in 1.82.0): difference of two polygons gives unexpected empty result Apr 26, 2023
@vissarion
Copy link
Member

Thanks for filing this issue.

I can reproduce your issue locally.

However, defining BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE (before all includes) is working for me.
This seems to be one regression of rescaling removal in 1.79.

@vissarion vissarion added this to the 1.83 milestone Jun 16, 2023
@gastald88
Copy link
Author

Thanks for your answer,
I have wrongly put the macro definitions after all includes rather than before. Once fixed this, it worked as you said.
Thanks again!

@barendgehrels
Copy link
Collaborator

barendgehrels commented Sep 14, 2023

Fixed by commit eb879fe in PR #1193
It now also works without rescaling.
I will create a unit test and close the issue.

@barendgehrels
Copy link
Collaborator

Unit test in #1202

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

No branches or pull requests

3 participants