fix guided and circular fill

pull/2346/head dev-build-lexelby-fill-clamp-and-smooth
Kaalleen 2023-07-01 08:29:07 +02:00
rodzic 799b9a9131
commit 72a0a7384f
2 zmienionych plików z 10 dodań i 6 usunięć

Wyświetl plik

@ -78,7 +78,7 @@ def circular_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, running_stitch_length, running_stitch_tolerance, skip_last)
result = path_to_stitches(shape, path, travel_graph, fill_stitch_graph, running_stitch_length, running_stitch_tolerance, skip_last, underpath)
result = _apply_bean_stitch_and_repeats(result, repeats, bean_stitch_repeats)
return result
@ -117,7 +117,7 @@ def _get_start_end_sequence(outline, start, end):
return substring(outline, start_dist, end_dist)
def path_to_stitches(path, travel_graph, fill_stitch_graph, running_stitch_length, running_stitch_tolerance, skip_last):
def path_to_stitches(shape, path, travel_graph, fill_stitch_graph, running_stitch_length, running_stitch_tolerance, skip_last, underpath):
path = collapse_sequential_outline_edges(path, fill_stitch_graph)
stitches = []
@ -144,6 +144,6 @@ def path_to_stitches(path, travel_graph, fill_stitch_graph, running_stitch_lengt
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

Wyświetl plik

@ -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