From cd7ee31c7ec42dbdf27bc234973f1360e7a67de8 Mon Sep 17 00:00:00 2001 From: curt Date: Thu, 13 May 2004 21:34:25 +0000 Subject: [PATCH] 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. --- src/Lib/Geometry/poly_support.cxx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Lib/Geometry/poly_support.cxx b/src/Lib/Geometry/poly_support.cxx index 59fecdf6..6778cc0b 100644 --- a/src/Lib/Geometry/poly_support.cxx +++ b/src/Lib/Geometry/poly_support.cxx @@ -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;