summaryrefslogtreecommitdiff
path: root/lib/stitches/running_stitch.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2023-05-10 09:02:17 +0200
committerGitHub <noreply@github.com>2023-05-10 09:02:17 +0200
commit9d5cc6013ef769718b47d64a558df7e4210505d1 (patch)
tree2231a4c373042704e0684c39b253c93b147d31ef /lib/stitches/running_stitch.py
parent97645751f67d2f76b1aadeb36152260a45c12e6a (diff)
circular fill bean: ignore travel stitches (#2281)
Diffstat (limited to 'lib/stitches/running_stitch.py')
-rw-r--r--lib/stitches/running_stitch.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/stitches/running_stitch.py b/lib/stitches/running_stitch.py
index 18eeb3c9..50e3be5f 100644
--- a/lib/stitches/running_stitch.py
+++ b/lib/stitches/running_stitch.py
@@ -258,7 +258,7 @@ def running_stitch(points, stitch_length, tolerance):
return stitches
-def bean_stitch(stitches, repeats):
+def bean_stitch(stitches, repeats, tags_to_ignore=None):
"""Generate bean stitch from a set of stitches.
"Bean" stitch is made by backtracking each stitch to make it heavier. A
@@ -284,6 +284,10 @@ def bean_stitch(stitches, repeats):
repeat_list_pos = i % repeat_list_length
new_stitches.append(stitch)
+ # ignore stitches with specified tags
+ if tags_to_ignore and set(tags_to_ignore).intersection(stitch.tags):
+ continue
+
for i in range(repeats[repeat_list_pos]):
new_stitches.extend(copy(new_stitches[-2:]))