Skip to content

Commit

Permalink
Drop holes that are not inside an outer ring
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Nov 13, 2023
1 parent 546b5fd commit e80d878
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions polygon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,11 @@ drawvec clean_polygon(drawvec const &geom, int z, int detail) {

drawvec ret;
for (size_t i = 0; i < rings.size(); i++) {
if (rings[i].area < 0 && rings[i].geom.size() != 0) {
// drop top-level holes
continue;
}

for (auto const &g : rings[i].geom) {
ret.emplace_back(g.op, g.x / SCALE, g.y / SCALE);
}
Expand Down

0 comments on commit e80d878

Please sign in to comment.