summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/stitch_plan.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2018-08-27 15:36:54 -0400
committerLex Neva <github.com@lexneva.name>2018-08-27 15:36:54 -0400
commit165d96e3b182d28388b84cc49680a34be033e837 (patch)
treebf9c5ef01c3cb6fa1b16e55eabdbf9d9aaf9500e /lib/stitch_plan/stitch_plan.py
parent7319937ea6c568aba8d613eed66433ddb24b6cc3 (diff)
show command name in simulator (STITCH, JUMP, etc)
Diffstat (limited to 'lib/stitch_plan/stitch_plan.py')
-rw-r--r--lib/stitch_plan/stitch_plan.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py
index c713b42e..808fa626 100644
--- a/lib/stitch_plan/stitch_plan.py
+++ b/lib/stitch_plan/stitch_plan.py
@@ -36,6 +36,12 @@ def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM):
# make a new block of our color
color_block = stitch_plan.new_color_block(color=patch.color)
+ # always start a color with a JUMP to the first stitch position
+ color_block.add_stitch(patch.stitches[0], jump=True)
+ else:
+ if len(color_block) and (patch.stitches[0] - color_block.stitches[-1]).length() > collapse_len:
+ color_block.add_stitch(patch.stitches[0], jump=True)
+
color_block.add_stitches(patch.stitches, no_ties=patch.stitch_as_is)
if patch.trim_after: