From 7dcb253d9b444ffadda389eca0b18280c7f428c4 Mon Sep 17 00:00:00 2001 From: George Steel Date: Sun, 4 Jun 2023 20:26:39 -0400 Subject: Add panelization options to zip export --- lib/stitch_plan/stitch.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/stitch_plan/stitch.py') 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']) -- cgit v1.2.3