diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-05-28 21:34:33 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-05-28 21:34:33 -0400 |
| commit | 9c2350eff7c3ba48f69858f5e3a710a4dd404846 (patch) | |
| tree | c9f1d9a1e85ebb6e2e275c9c4a69d0c6c1ace35b /lib/stitch_plan/stitch_plan.py | |
| parent | 77d6b78f92d507cdb22e744b1c93712fc6d67e5b (diff) | |
don't bother trimming before a color change
Diffstat (limited to 'lib/stitch_plan/stitch_plan.py')
| -rw-r--r-- | lib/stitch_plan/stitch_plan.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py index fef7f61d..f7dfb307 100644 --- a/lib/stitch_plan/stitch_plan.py +++ b/lib/stitch_plan/stitch_plan.py @@ -23,15 +23,15 @@ def patches_to_stitch_plan(patches, collapse_len=3.0 * PIXELS_PER_MM): if not patch.stitches: continue - if need_trim: - process_trim(color_block, patch.stitches[0]) - need_trim = False - if not color_block.has_color(): # set the color for the first color block color_block.color = patch.color if color_block.color == patch.color: + if need_trim: + process_trim(color_block, patch.stitches[0]) + need_trim = False + # add a jump stitch between patches if the distance is more # than the collapse length if color_block.last_stitch: |
