summaryrefslogtreecommitdiff
path: root/lib/stitch_plan
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2021-08-15 17:24:59 -0400
committerLex Neva <github.com@lexneva.name>2021-08-15 17:26:14 -0400
commitdd865008356d1e04b29a5eb59a8480900f255628 (patch)
treeeb4fa685d0d54b09219bef67f8c11f5834fdebe1 /lib/stitch_plan
parentd807b12870515e23bd9ac4f8ce024a3070de2805 (diff)
keep underlay, underpath, and border travel
Diffstat (limited to 'lib/stitch_plan')
-rw-r--r--lib/stitch_plan/stitch_group.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/stitch_plan/stitch_group.py b/lib/stitch_plan/stitch_group.py
index ee077f26..98d9799e 100644
--- a/lib/stitch_plan/stitch_group.py
+++ b/lib/stitch_plan/stitch_group.py
@@ -17,7 +17,7 @@ class StitchGroup:
between them by the stitch plan generation code.
"""
- def __init__(self, color=None, stitches=None, trim_after=False, stop_after=False, tie_modus=0, stitch_as_is=False):
+ def __init__(self, color=None, stitches=None, trim_after=False, stop_after=False, tie_modus=0, stitch_as_is=False, tags=None):
self.color = color
self.trim_after = trim_after
self.stop_after = stop_after
@@ -28,6 +28,9 @@ class StitchGroup:
if stitches:
self.add_stitches(stitches)
+ if tags:
+ self.add_tags(tags)
+
def __add__(self, other):
if isinstance(other, StitchGroup):
return StitchGroup(self.color, self.stitches + other.stitches)
@@ -51,3 +54,11 @@ class StitchGroup:
def reverse(self):
return StitchGroup(self.color, self.stitches[::-1])
+
+ def add_tags(self, tags):
+ for stitch in self.stitches:
+ stitch.add_tags(tags)
+
+ def add_tag(self, tag):
+ for stitch in self.stitches:
+ stitch.add_tag(tag)