Update Minkowski_sum_conv_2.h

fix issue #8551
This commit is contained in:
Garbage123King 2024-10-24 18:32:43 +08:00 committed by Sébastien Loriot
parent 1709486fba
commit 8e59f3fc9d
1 changed files with 9 additions and 3 deletions

View File

@ -533,7 +533,7 @@ private:
// list for subsequences sharing a common move_on indicator. When we
// encounter such a subsequence that equals the size of the corresponding
// polygon, we can safely remove it from the convolution cycle.
typename std::list<Labeled_segment_2>::iterator first, curr;
typename std::list<Labeled_segment_2>::iterator first, curr, newins;
bool move_on;
unsigned int count = 1;
bool reduced_cycle = false;
@ -611,7 +611,7 @@ private:
res = f_compare_xy(curr_pt, next_pt);
if (res != EQUAL) {
cycle.insert(curr,
newins = cycle.insert(curr,
Labeled_segment_2(Segment_2(curr_pt, next_pt),
X_curve_label((res == SMALLER),
cycle_id,
@ -621,7 +621,13 @@ private:
cycle.erase(curr);
cycle.erase(next);
curr = after_next;
if (res != EQUAL) {
//continue comparing the new combined line with the next line
curr = newins;
}
else {
curr = after_next;
}
if (after_next != cycle.end()) {
next = curr;