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

fix: add condition to handle_imperfect_touch #1346

Merged
merged 4 commits into from
Nov 25, 2024

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!

test/algorithms/overlay/overlay_cases.hpp Show resolved Hide resolved
@vissarion vissarion merged commit a9c3a24 into boostorg:develop Nov 25, 2024
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants