From c2aeb39a4413dd8bc6c14c832ab506c8c335faba Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sat, 8 Mar 2025 16:58:58 +0100 Subject: [PATCH] use buffer(0) when fill rule is nonzero (#3561) --- lib/elements/fill_stitch.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py index 939d42d05..f8db39d56 100644 --- a/lib/elements/fill_stitch.py +++ b/lib/elements/fill_stitch.py @@ -772,7 +772,10 @@ class FillStitch(EmbroideryElement): # biggest path. paths = self.paths paths.sort(key=lambda point_list: shgeo.Polygon(point_list).area, reverse=True) - return shgeo.MultiPolygon([(paths[0], paths[1:])]) + shape = shgeo.MultiPolygon([(paths[0], paths[1:])]) + if self.node.style('fill-rule') == 'nonzero': + shape = shape.buffer(0) + return shape @property @cache