diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-05-28 22:31:42 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-05-28 22:39:59 -0400 |
| commit | b32a37178aaa1a31beb608d69504e6b4a822a1b5 (patch) | |
| tree | ed970267c2a09ba56256c0b4c3aafa5bacabb049 /lib | |
| parent | f0c8c6a27b2ea2688bceaea0b86e1c182dee39c9 (diff) | |
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.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/stitch_plan/stitch_plan.py | 10 |
1 files changed, 10 insertions, 0 deletions
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.""" |
