Eliminate infinite loop AssemblePolygon
This commit is contained in:
parent
7366a6c53d
commit
88a0e55f35
@ -269,7 +269,6 @@ bool SEdgeList::AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir) co
|
|||||||
dest->Clear();
|
dest->Clear();
|
||||||
|
|
||||||
bool allClosed = true;
|
bool allClosed = true;
|
||||||
for(;;) {
|
|
||||||
Vector first = Vector::From(0, 0, 0);
|
Vector first = Vector::From(0, 0, 0);
|
||||||
Vector last = Vector::From(0, 0, 0);
|
Vector last = Vector::From(0, 0, 0);
|
||||||
int i;
|
int i;
|
||||||
@ -279,13 +278,6 @@ bool SEdgeList::AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir) co
|
|||||||
last = l[i].b;
|
last = l[i].b;
|
||||||
/// @todo fix const!
|
/// @todo fix const!
|
||||||
const_cast<SEdge*>(&(l[i]))->tag = 1;
|
const_cast<SEdge*>(&(l[i]))->tag = 1;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(i >= l.n) {
|
|
||||||
return allClosed;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a new empty contour in our polygon, and finish assembling
|
// Create a new empty contour in our polygon, and finish assembling
|
||||||
// into that contour.
|
// into that contour.
|
||||||
dest->AddEmptyContour();
|
dest->AddEmptyContour();
|
||||||
@ -294,6 +286,8 @@ bool SEdgeList::AssemblePolygon(SPolygon *dest, SEdge *errorAt, bool keepDir) co
|
|||||||
}
|
}
|
||||||
// But continue assembling, even if some of the contours are open
|
// But continue assembling, even if some of the contours are open
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
return allClosed;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user