summaryrefslogtreecommitdiff
path: root/lib/elements/stroke.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/elements/stroke.py')
-rw-r--r--lib/elements/stroke.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py
index eca9e0ba..e8eb4783 100644
--- a/lib/elements/stroke.py
+++ b/lib/elements/stroke.py
@@ -1,4 +1,5 @@
import sys
+import shapely.geometry
from .element import param, EmbroideryElement, Patch
from ..i18n import _
@@ -51,6 +52,12 @@ class Stroke(EmbroideryElement):
return self.flatten(path)
@property
+ @cache
+ def shape(self):
+ line_strings = [shapely.geometry.LineString(path) for path in self.paths]
+ return shapely.geometry.MultiLineString(line_strings)
+
+ @property
@param('manual_stitch', _('Manual stitch placement'), tooltip=_("Stitch every node in the path. Stitch length and zig-zag spacing are ignored."), type='boolean', default=False)
def manual_stitch_mode(self):
return self.get_boolean_param('manual_stitch')