summaryrefslogtreecommitdiff
path: root/lib/stitches/guided_fill.py
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2023-07-03 19:55:19 -0400
committerGitHub <noreply@github.com>2023-07-03 19:55:19 -0400
commit1301b02c0d8c462810e55c39970d77535fbd1adc (patch)
tree33962fa581ccc47cac98967948552193bbbf1471 /lib/stitches/guided_fill.py
parentf8df02ff9eccb740c193c0af9707d5b9cc41dac0 (diff)
parent72a0a7384fb61daa2cc5ce4082cf1ff222831710 (diff)
Merge pull request #2346 from inkstitch/lexelby/fill-clamp-and-smooth
auto-fill clamp and smooth
Diffstat (limited to 'lib/stitches/guided_fill.py')
-rw-r--r--lib/stitches/guided_fill.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/stitches/guided_fill.py b/lib/stitches/guided_fill.py
index 7b80c021..e4793838 100644
--- a/lib/stitches/guided_fill.py
+++ b/lib/stitches/guided_fill.py
@@ -45,7 +45,9 @@ def guided_fill(shape,
travel_graph = build_travel_graph(fill_stitch_graph, shape, angle, underpath)
path = find_stitch_path(fill_stitch_graph, travel_graph, starting_point, ending_point)
- result = path_to_stitches(path, travel_graph, fill_stitch_graph, max_stitch_length, running_stitch_length, running_stitch_tolerance, skip_last)
+ result = path_to_stitches(shape, path, travel_graph, fill_stitch_graph,
+ max_stitch_length, running_stitch_length, running_stitch_tolerance, skip_last,
+ underpath)
return result
@@ -59,7 +61,9 @@ def fallback(shape, guideline, row_spacing, max_stitch_length, running_stitch_le
num_staggers, skip_last, starting_point, ending_point, underpath)
-def path_to_stitches(path, travel_graph, fill_stitch_graph, stitch_length, running_stitch_length, running_stitch_tolerance, skip_last):
+def path_to_stitches(shape, path, travel_graph, fill_stitch_graph,
+ stitch_length, running_stitch_length, running_stitch_tolerance, skip_last,
+ underpath):
path = collapse_sequential_outline_edges(path, fill_stitch_graph)
stitches = []
@@ -89,7 +93,7 @@ def path_to_stitches(path, travel_graph, fill_stitch_graph, stitch_length, runni
travel_graph.remove_edges_from(fill_stitch_graph[edge[0]][edge[1]]['segment'].get('underpath_edges', []))
else:
- stitches.extend(travel(travel_graph, edge, running_stitch_length, running_stitch_tolerance, skip_last))
+ stitches.extend(travel(shape, travel_graph, edge, running_stitch_length, running_stitch_tolerance, skip_last, underpath))
return stitches