summaryrefslogtreecommitdiff
path: root/lib/stitch_plan/stitch_plan.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2022-06-22 15:22:34 +0200
committerGitHub <noreply@github.com>2022-06-22 15:22:34 +0200
commitb6bde000fe675ed725d7d5dbd7db3f44fb33af0e (patch)
tree2c856ac51c563b6c918ab3041ac29c5106e7a06d /lib/stitch_plan/stitch_plan.py
parent75fc4ce8695f6fb6c7cc108fcf458ad36bbd00c1 (diff)
Option to drop short stitches (#1693)
Diffstat (limited to 'lib/stitch_plan/stitch_plan.py')
-rw-r--r--lib/stitch_plan/stitch_plan.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/stitch_plan/stitch_plan.py b/lib/stitch_plan/stitch_plan.py
index 4593781a..04d587c2 100644
--- a/lib/stitch_plan/stitch_plan.py
+++ b/lib/stitch_plan/stitch_plan.py
@@ -13,7 +13,7 @@ from .color_block import ColorBlock
from .ties import add_ties
-def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, disable_ties=False): # noqa: C901
+def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, min_stitch_len=0.1, disable_ties=False): # noqa: C901
"""Convert a collection of StitchGroups to a StitchPlan.
@@ -71,7 +71,7 @@ def stitch_groups_to_stitch_plan(stitch_groups, collapse_len=None, disable_ties=
# last block ended in a stop, so now we have an empty block
del stitch_plan.color_blocks[-1]
- stitch_plan.filter_duplicate_stitches()
+ stitch_plan.filter_duplicate_stitches(min_stitch_len)
if not disable_ties:
stitch_plan.add_ties()
@@ -101,9 +101,9 @@ class StitchPlan(object):
def add_color_block(self, color_block):
self.color_blocks.append(color_block)
- def filter_duplicate_stitches(self):
+ def filter_duplicate_stitches(self, min_stitch_len):
for color_block in self:
- color_block.filter_duplicate_stitches()
+ color_block.filter_duplicate_stitches(min_stitch_len)
def add_ties(self):
# see ties.py