Skip to content

Conversation

@barendgehrels
Copy link
Collaborator

@barendgehrels barendgehrels commented Nov 20, 2024

Fixes #1345
Edit also fixes #1288 which is added because it was similar.

About #1345
Difference was wrong for both cases, caused by nearly opposite segments. The condition causing this had to be fine-tuned with an extra check.

Fixed behaviour:
a (p=big polygon containing all, q=small rectangle at top which subtly overlaps p)

Difference a-b (in image, this should be a rectangle, correct)
image

Difference b-a -> 0 (correct)

b (p = u-shape, q = the lower bar of it, subtly overlapping p)

Difference a-b (in image, this should be the two vertical bars of the u, correct)
Difference b-a -> 0 (correct)

image

About #1288
It handled a situation as a "touch" but both the middle points were not collinear. In those cases it should not be handled as a touch and use the "original" code path.

The "mystery" why it happened only for polygon and not for multi-polygon, and this affects also the validity check, is not yet solved - but the case itself is solved.
The multi/poly combination is not yet unit tested, I have another test for that in preparation but it's better to not have large chuncks in the beta-time for the release.

@barendgehrels barendgehrels added this to the 1.87 milestone Nov 20, 2024
@barendgehrels barendgehrels self-assigned this Nov 20, 2024
Copy link
Member

@vissarion vissarion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@vissarion vissarion merged commit a9c3a24 into boostorg:develop Nov 25, 2024
24 checks passed
@barendgehrels barendgehrels deleted the fix/issue-1345 branch December 14, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error in difference (extracted from #1241) Difference or intersection fail depending on BOOST_GEOMETRY_ROBUSTNESS_ALTERNATIVE

2 participants