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 the fatal bug of the convolution calculation part of the Minkowski sum #8573

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

Garbage123King
Copy link
Contributor

@Garbage123King Garbage123King commented Oct 25, 2024

Summary of Changes

Modify the convolution calculation part of the Minkowski sum. In the 'elimination of antennas' phase, before I fix it, only the antennas of the first segment were eliminated, skipping the possible subsequent antennas. For more details, please refer to the explanation in the issue. I modified it so that if a new antenna is merged, the newly merged antenna is used as curr for the next iteration; otherwise, after_next is used as curr.

Release Management

@sloriot sloriot assigned sloriot and unassigned sloriot Nov 6, 2024
@sloriot sloriot requested a review from efifogel November 6, 2024 12:43
Copy link
Member

Choose a reason for hiding this comment

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

First, good job on spotting and fixing.
A more simple (and I guess efficient) fix is simply replacing Line 614:
- cycle.insert(curr,
+ after_next = cycle.insert(curr,

Copy link
Member

Choose a reason for hiding this comment

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

I updated the code. We agree on the fix now?

Copy link
Member

Choose a reason for hiding this comment

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

@efifogel
Copy link
Member

efifogel commented Nov 6, 2024

BW, consider the Minkowski sum of two 2 segments, that is, two degenerate polygons.
I've noticed that now, while the full-convolution method works, the reduced convolution (which is the default) fails.
The decomposition method also works on this case.
I guess more rigorous tests are needed, but the manual does not say that such degenerate cases are expected to work though. As Garbase123King said, mathematically, they should all work...

@afabri afabri changed the title fix the fetal bug of the convolution calculation part of the Minkowski sum fix the fatal bug of the convolution calculation part of the Minkowski sum Nov 6, 2024
@sloriot
Copy link
Member

sloriot commented Nov 8, 2024

Successfully tested in CGAL 6.1-Ic-15

Copy link

github-actions bot commented Nov 8, 2024

This pull-request was previously marked with the label Tested, but has been modified with new commits. That label has been removed.

@sloriot sloriot changed the base branch from master to 5.6.x-branch November 8, 2024 15:02
@sloriot sloriot added Tested and removed TODO labels Nov 8, 2024
@sloriot sloriot merged commit 5aec09a into CGAL:5.6.x-branch Nov 14, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

minkowski_sum has fatal bug for some special linestring and polygon
3 participants