summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/stitch.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stitch_plan/stitch.py')
-rw-r--r--lib/stitch_plan/stitch.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/stitch_plan/stitch.py b/lib/stitch_plan/stitch.py
index 90af58c0..8ad699c7 100644
--- a/lib/stitch_plan/stitch.py
+++ b/lib/stitch_plan/stitch.py
@@ -68,6 +68,10 @@ class Stitch(Point):
if value or base_stitch is None:
setattr(self, attribute, value)
+ @property
+ def is_terminator(self) -> bool:
+ return self.trim or self.stop or self.color_change
+
def add_tags(self, tags):
for tag in tags:
self.add_tag(tag)
@@ -93,6 +97,12 @@ class Stitch(Point):
def copy(self):
return Stitch(self.x, self.y, self.color, self.jump, self.stop, self.trim, self.color_change, self.tags)
+ def offset(self, offset: Point):
+ out = self.copy()
+ out.x += offset.x
+ out.y += offset.y
+ return out
+
def __json__(self):
attributes = dict(vars(self))
attributes['tags'] = list(attributes['tags'])