From c799b798bc01ac9fc307a1dbc3c1ae68f1224669 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Wed, 10 May 2023 09:02:47 +0200 Subject: apply clip to stroke (#2283) --- lib/elements/fill_stitch.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/elements/fill_stitch.py') diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py index a2d4855f..912f3ba6 100644 --- a/lib/elements/fill_stitch.py +++ b/lib/elements/fill_stitch.py @@ -23,6 +23,7 @@ from ..stitches import (auto_fill, circular_fill, contour_fill, guided_fill, legacy_fill) from ..stitches.meander_fill import meander_fill from ..svg import PIXELS_PER_MM, get_node_transform +from ..svg.clip import get_clip_path from ..svg.tags import INKSCAPE_LABEL from ..utils import cache, version from ..utils.param import ParamOption @@ -571,12 +572,9 @@ class FillStitch(EmbroideryElement): if self.node.clip is None: return self.original_shape - from .element import EmbroideryElement - clip_element = EmbroideryElement(self.node.clip) - clip_element.paths.sort(key=lambda point_list: shgeo.Polygon(point_list).area, reverse=True) - polygon = shgeo.MultiPolygon([(clip_element.paths[0], clip_element.paths[1:])]) + clip_path = get_clip_path(self.node) try: - intersection = polygon.intersection(self.original_shape) + intersection = clip_path.intersection(self.original_shape) except TopologicalError: return self.original_shape -- cgit v1.2.3