mirror of
https://github.com/felt/tippecanoe.git
synced 2026-10-05 18:05:42 +02:00
Make indent, and finish writing a comment that I started
This commit is contained in:
+15
-9
@@ -302,9 +302,6 @@ static void decode_clipped(ClipperLib::PolyNode *t, drawvec &out) {
|
|||||||
// guaranteed that at least one point in the polygon is strictly
|
// guaranteed that at least one point in the polygon is strictly
|
||||||
// inside its parent (not on one of its boundary lines).
|
// inside its parent (not on one of its boundary lines).
|
||||||
|
|
||||||
// Once we have that, we can run through the outer rings that have
|
|
||||||
// an even number of parents,
|
|
||||||
|
|
||||||
std::vector<ring> rings;
|
std::vector<ring> rings;
|
||||||
decode_rings(t, rings);
|
decode_rings(t, rings);
|
||||||
std::sort(rings.begin(), rings.end());
|
std::sort(rings.begin(), rings.end());
|
||||||
@@ -319,10 +316,15 @@ static void decode_clipped(ClipperLib::PolyNode *t, drawvec &out) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
nextring:
|
nextring:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Then reverse the winding order of any rings that turned out
|
||||||
|
// to actually be inner when they are outer, or vice versa.
|
||||||
|
// (A ring is outer if it has no parent or if its parent is
|
||||||
|
// an inner ring.)
|
||||||
|
|
||||||
for (size_t ii = rings.size(); ii > 0; ii--) {
|
for (size_t ii = rings.size(); ii > 0; ii--) {
|
||||||
size_t i = ii - 1;
|
size_t i = ii - 1;
|
||||||
|
|
||||||
@@ -339,6 +341,10 @@ nextring:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Then run through the rings again, outputting each outer ring
|
||||||
|
// followed by its direct children, and checking to make sure
|
||||||
|
// there are no child rings whose parents weren't identified.
|
||||||
|
|
||||||
for (size_t ii = rings.size(); ii > 0; ii--) {
|
for (size_t ii = rings.size(); ii > 0; ii--) {
|
||||||
size_t i = ii - 1;
|
size_t i = ii - 1;
|
||||||
|
|
||||||
@@ -535,11 +541,11 @@ void check_polygon(drawvec &geom, drawvec &before) {
|
|||||||
|
|
||||||
if (t > 0 && t < 1 && s > 0 && s < 1) {
|
if (t > 0 && t < 1 && s > 0 && s < 1) {
|
||||||
printf("Internal error: self-intersecting polygon. %lld,%lld to %lld,%lld intersects %lld,%lld to %lld,%lld\n",
|
printf("Internal error: self-intersecting polygon. %lld,%lld to %lld,%lld intersects %lld,%lld to %lld,%lld\n",
|
||||||
geom[i + 0].x, geom[i + 0].y,
|
geom[i + 0].x, geom[i + 0].y,
|
||||||
geom[i + 1].x, geom[i + 1].y,
|
geom[i + 1].x, geom[i + 1].y,
|
||||||
geom[j + 0].x, geom[j + 0].y,
|
geom[j + 0].x, geom[j + 0].y,
|
||||||
geom[j + 1].x, geom[j + 1].y);
|
geom[j + 1].x, geom[j + 1].y);
|
||||||
dump(before);
|
dump(before);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user