From e884fb78db288c91e8183ef8e242840ba5d68db2 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 22 Jun 2022 09:26:37 -0400 Subject: add running stitch tolerance param (#1701) --- lib/stitches/ripple_stitch.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/stitches/ripple_stitch.py') 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) -- cgit v1.2.3