summaryrefslogtreecommitdiff
path: root/lib/elements/stroke.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2023-11-10 16:41:36 +0100
committerGitHub <noreply@github.com>2023-11-10 16:41:36 +0100
commit7edebd60f93f1c8fda01e90c4ff9a7a75a59b76e (patch)
tree336184d92377048e5b0c31c5052523d044276139 /lib/elements/stroke.py
parente1a1e887ff94ae39a5254338c6ae57496186e14b (diff)
fix invalid clip path (#2577)
use fallback if shape has grating issues (too small)
Diffstat (limited to 'lib/elements/stroke.py')
-rw-r--r--lib/elements/stroke.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py
index d845ed01..e6bcba5c 100644
--- a/lib/elements/stroke.py
+++ b/lib/elements/stroke.py
@@ -7,6 +7,7 @@ from math import ceil
import shapely.geometry as shgeo
from inkex import Transform
+from shapely.errors import GEOSException
from ..i18n import _
from ..marker import get_marker_elements
@@ -14,13 +15,12 @@ from ..stitch_plan import StitchGroup
from ..stitches.ripple_stitch import ripple_stitch
from ..stitches.running_stitch import bean_stitch, running_stitch
from ..svg import get_node_transform, parse_length_with_units
+from ..svg.clip import get_clip_path
from ..threads import ThreadColor
from ..utils import Point, cache
from ..utils.param import ParamOption
from .element import EmbroideryElement, param
-from ..svg.clip import get_clip_path
from .validation import ValidationWarning
-from shapely.errors import TopologicalError
class MultipleGuideLineWarning(ValidationWarning):
@@ -411,7 +411,7 @@ class Stroke(EmbroideryElement):
line_strings = [shgeo.LineString(path) for path in paths]
try:
intersection = clip_path.intersection(shgeo.MultiLineString(line_strings))
- except TopologicalError:
+ except GEOSException:
return paths
coords = []