From b32a37178aaa1a31beb608d69504e6b4a822a1b5 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Mon, 28 May 2018 22:31:42 -0400 Subject: add a JUMP at the start of each color block This seems to be the way other digitizing software does it, so it's probably required. --- lib/stitch_plan/stitch_plan.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/stitch_plan/stitch_plan.py') diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py index 2a35f9aa..93bcd195 100644 --- a/lib/stitch_plan/stitch_plan.py +++ b/lib/stitch_plan/stitch_plan.py @@ -59,11 +59,21 @@ def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM): if patch.stop_after: process_stop(color_block) + add_jumps(stitch_plan) add_ties(stitch_plan) return stitch_plan +def add_jumps(stitch_plan): + """Add a JUMP stitch at the start of each color block.""" + + for color_block in stitch_plan: + stitch = color_block.stitches[0].copy() + stitch.jump = True + color_block.stitches.insert(0, stitch) + + class StitchPlan(object): """Holds a set of color blocks, each containing stitches.""" -- cgit v1.2.3