diff options
| author | George Steel <george.steel@gmail.com> | 2023-06-04 20:26:39 -0400 |
|---|---|---|
| committer | George Steel <george.steel@gmail.com> | 2023-06-15 12:25:15 -0400 |
| commit | 7dcb253d9b444ffadda389eca0b18280c7f428c4 (patch) | |
| tree | f654ff1594305092ab46b920e2a72a12a283d50c /lib/stitch_plan/stitch.py | |
| parent | 92623d460d82f01c01353a5a5c992ec53baf7f41 (diff) | |
Add panelization options to zip export
Diffstat (limited to 'lib/stitch_plan/stitch.py')
| -rw-r--r-- | lib/stitch_plan/stitch.py | 10 |
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']) |
