Frequently our beloved polygon clipper will generate polygons with a wierd
branch. Kind of an out and back. node[n] == node[n+2] where there is some unique point in between. Our triangulator is usually robust to this, but not in 100% of all cases. So I had some code to catch and eliminate this weirdness. However, a key piece of code was commented out (?!?) rendering it a no-op. I fixed this and tile building is more robust now.
This commit is contained in:
parent
341079f103
commit
cd7ee31c7e
1 changed files with 5 additions and 5 deletions
|
@ -1231,13 +1231,13 @@ static point_list remove_contour_cycles( const point_list& contour ) {
|
|||
while ( i < contour.size() ) {
|
||||
result.push_back( contour[i] );
|
||||
for ( unsigned int j = i + 1; j < contour.size(); ++j ) {
|
||||
if ( contour[i] == contour[j] && i + 2 > j ) {
|
||||
//cout << "detected a small cycle: i = "
|
||||
// << i << " j = " << j << endl;
|
||||
if ( contour[i] == contour[j] && i + 4 > j ) {
|
||||
cout << "detected a small cycle: i = "
|
||||
<< i << " j = " << j << endl;
|
||||
for ( unsigned int k = i; k <= j; ++k ) {
|
||||
//cout << " " << contour[k] << endl;
|
||||
cout << " " << contour[k] << endl;
|
||||
}
|
||||
// i = j;
|
||||
i = j;
|
||||
}
|
||||
}
|
||||
++i;
|
||||
|
|
Loading…
Reference in a new issue