From e80d8786b8f397c786bc4eed1e2d9666b13683dd Mon Sep 17 00:00:00 2001 From: Erica Fischer Date: Mon, 13 Nov 2023 10:30:14 -0800 Subject: [PATCH] Drop holes that are not inside an outer ring --- polygon.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/polygon.cpp b/polygon.cpp index 257b8ab1..5f45fff5 100644 --- a/polygon.cpp +++ b/polygon.cpp @@ -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); }