summaryrefslogtreecommitdiff
path: root/lib/elements/stroke.py
diff options
context:
space:
mode:
authorGeorge Steel <george.steel@gmail.com>2023-01-22 03:05:51 -0500
committerGeorge Steel <george.steel@gmail.com>2023-01-22 03:06:01 -0500
commit9ca70886513b1d91bcdb7276bc8bc7b24ebc6091 (patch)
tree72adf7cb19ac7583838c268c2174cb65ba106c02 /lib/elements/stroke.py
parenta5c085f390109a97e39573bcd3906e2cf588a6de (diff)
Replace running stitch algorithm to give consistent stitch lengths.
Diffstat (limited to 'lib/elements/stroke.py')
-rw-r--r--lib/elements/stroke.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py
index 73973bf7..6aca3847 100644
--- a/lib/elements/stroke.py
+++ b/lib/elements/stroke.py
@@ -432,21 +432,20 @@ class Stroke(EmbroideryElement):
return patch
def running_stitch(self, path, stitch_length, tolerance):
- repeated_path = []
+ stitches = running_stitch(path, stitch_length, tolerance)
+ repeated_stitches = []
# go back and forth along the path as specified by self.repeats
for i in range(self.repeats):
if i % 2 == 1:
# reverse every other pass
- this_path = path[::-1]
+ this_path = stitches[::-1]
else:
- this_path = path[:]
+ this_path = stitches[:]
- repeated_path.extend(this_path)
+ repeated_stitches.extend(this_path)
- stitches = running_stitch(repeated_path, stitch_length, tolerance)
-
- return StitchGroup(self.color, stitches)
+ return StitchGroup(self.color, repeated_stitches)
def ripple_stitch(self):
return StitchGroup(