From 9c2350eff7c3ba48f69858f5e3a710a4dd404846 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Mon, 28 May 2018 21:34:33 -0400 Subject: don't bother trimming before a color change --- lib/stitch_plan/stitch_plan.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/stitch_plan') 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: -- cgit v1.2.3