diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-05-10 09:02:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-10 09:02:47 +0200 |
| commit | c799b798bc01ac9fc307a1dbc3c1ae68f1224669 (patch) | |
| tree | 791955fd75f8f93f8a1cb66c82cc29d0600aaf86 /lib/elements/fill_stitch.py | |
| parent | 9d5cc6013ef769718b47d64a558df7e4210505d1 (diff) | |
apply clip to stroke (#2283)
Diffstat (limited to 'lib/elements/fill_stitch.py')
| -rw-r--r-- | lib/elements/fill_stitch.py | 8 |
1 files changed, 3 insertions, 5 deletions
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 |
