summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/stitches/ripple_stitch.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/stitches/ripple_stitch.py b/lib/stitches/ripple_stitch.py
index b1179bf7..7a2783f7 100644
--- a/lib/stitches/ripple_stitch.py
+++ b/lib/stitches/ripple_stitch.py
@@ -49,15 +49,19 @@ def ripple_stitch(stroke):
def _get_stitches(stroke, is_linear, lines, skip_start):
if stroke.manual_pattern_placement:
- if stroke.flip_copies:
- stitches = []
- for i, line in enumerate(lines):
- if i % 2 == 0:
- stitches.extend(line[::-1])
- else:
- stitches.extend(line)
- return stitches
- return [point for line in lines for point in line]
+ stitches = []
+ for i, line in enumerate(lines):
+ if i % 2 == 0 and stroke.flip_copies:
+ line = line[::-1]
+ if stitches:
+ # even though this is manual stitch placement, we do not want the
+ # connector lines to exceed the running stitch length value
+ # so let's add some points
+ points = LineString([stitches[-1], line[0]]).segmentize(stroke.running_stitch_length).coords
+ if len(points) > 2:
+ stitches.extend([InkstitchPoint(coord[0], coord[1]) for coord in points[1:-1]])
+ stitches.extend(line)
+ return stitches
if is_linear and stroke.flip_copies:
return _get_staggered_stitches(stroke, lines, skip_start)
else: