summaryrefslogtreecommitdiff
path: root/lib/stitches/ripple_stitch.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2022-06-22 09:26:37 -0400
committerGitHub <noreply@github.com>2022-06-22 15:26:37 +0200
commite884fb78db288c91e8183ef8e242840ba5d68db2 (patch)
treedf835bd6fbd9070c390cd53c22578023d24b3321 /lib/stitches/ripple_stitch.py
parentb6bde000fe675ed725d7d5dbd7db3f44fb33af0e (diff)
add running stitch tolerance param (#1701)
Diffstat (limited to 'lib/stitches/ripple_stitch.py')
-rw-r--r--lib/stitches/ripple_stitch.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/stitches/ripple_stitch.py b/lib/stitches/ripple_stitch.py
index 46fc5e07..489666b0 100644
--- a/lib/stitches/ripple_stitch.py
+++ b/lib/stitches/ripple_stitch.py
@@ -30,7 +30,7 @@ def ripple_stitch(stroke):
if stroke.grid_size != 0:
ripple_points.extend(_do_grid(stroke, helper_lines))
- stitches = running_stitch(ripple_points, stroke.running_stitch_length)
+ stitches = running_stitch(ripple_points, stroke.running_stitch_length, stroke.running_stitch_tolerance)
return _repeat_coords(stitches, stroke.repeats)
@@ -57,7 +57,9 @@ def _get_helper_lines(stroke):
if len(lines) > 1:
return True, _get_satin_ripple_helper_lines(stroke)
else:
- outline = LineString(running_stitch(line_string_to_point_list(lines[0]), stroke.grid_size or stroke.running_stitch_length))
+ outline = LineString(running_stitch(line_string_to_point_list(lines[0]),
+ stroke.grid_size or stroke.running_stitch_length,
+ stroke.running_stitch_tolerance))
if stroke.is_closed:
return False, _get_circular_ripple_helper_lines(stroke, outline)
@@ -146,7 +148,7 @@ def _get_guided_helper_lines(stroke, outline, max_distance):
def _generate_guided_helper_lines(stroke, outline, max_distance, guide_line):
# helper lines are generated by making copies of the outline alog the guide line
line_point_dict = defaultdict(list)
- outline = LineString(running_stitch(line_string_to_point_list(outline), max_distance))
+ outline = LineString(running_stitch(line_string_to_point_list(outline), max_distance, stroke.running_stitch_tolerance))
center = outline.centroid
center = InkstitchPoint(center.x, center.y)