mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-02 16:35:40 +02:00
Stabilize choice of which three points to keep with different windings
This commit is contained in:
+4
-1
@@ -763,7 +763,9 @@ drawvec fix_polygon(drawvec &geom) {
|
||||
}
|
||||
}
|
||||
|
||||
// then figure out which point is furthest from *that*
|
||||
// then figure out which point is furthest from *that*,
|
||||
// which will hopefully be a good origin point since it should be
|
||||
// at a far edge of the shape.
|
||||
long long dist2b = 0;
|
||||
long long furthestb = 0;
|
||||
for (size_t a = 0; a + 1 < ring.size(); a++) {
|
||||
@@ -785,6 +787,7 @@ drawvec fix_polygon(drawvec &geom) {
|
||||
// Copy ring into output, fixing the moveto/lineto ops if necessary because of
|
||||
// reversal or closing
|
||||
|
||||
printf("chose %lld,%lld for ring of size %zu\n", ring[furthestb].x, ring[furthestb].y, ring.size());
|
||||
for (size_t a = 0; a < ring.size(); a++) {
|
||||
size_t a2 = (a + furthestb) % (ring.size() - 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user