1
0
Fork 0

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:
curt 2004-05-13 21:34:25 +00:00
parent 341079f103
commit cd7ee31c7e

View file

@ -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;