kopia lustrzana https://github.com/inkstitch/inkstitch
Fill: fallback to edge run when underpath fails (#3089)
rodzic
d9ed17d888
commit
eadeadb9a6
|
@ -428,21 +428,24 @@ def build_travel_graph(fill_stitch_graph, shape, fill_stitch_angle, underpath):
|
||||||
# They'll all already have their `outline` and `projection` tags set.
|
# They'll all already have their `outline` and `projection` tags set.
|
||||||
graph.add_nodes_from(fill_stitch_graph.nodes(data=True))
|
graph.add_nodes_from(fill_stitch_graph.nodes(data=True))
|
||||||
|
|
||||||
|
grating = True
|
||||||
if underpath:
|
if underpath:
|
||||||
try:
|
try:
|
||||||
boundary_points, travel_edges = build_travel_edges(shape, fill_stitch_angle)
|
boundary_points, travel_edges = build_travel_edges(shape, fill_stitch_angle)
|
||||||
except NoGratingsError:
|
except NoGratingsError:
|
||||||
return
|
grating = False
|
||||||
|
|
||||||
# This will ensure that a path traveling inside the shape can reach its
|
if grating:
|
||||||
# target on the outline, which will be one of the points added above.
|
# This will ensure that a path traveling inside the shape can reach its
|
||||||
tag_nodes_with_outline_and_projection(graph, shape, boundary_points)
|
# target on the outline, which will be one of the points added above.
|
||||||
else:
|
tag_nodes_with_outline_and_projection(graph, shape, boundary_points)
|
||||||
|
|
||||||
|
if not underpath or not grating:
|
||||||
add_boundary_travel_nodes(graph, shape)
|
add_boundary_travel_nodes(graph, shape)
|
||||||
|
|
||||||
add_edges_between_outline_nodes(graph)
|
add_edges_between_outline_nodes(graph)
|
||||||
|
|
||||||
if underpath:
|
if underpath and grating:
|
||||||
process_travel_edges(graph, fill_stitch_graph, shape, travel_edges)
|
process_travel_edges(graph, fill_stitch_graph, shape, travel_edges)
|
||||||
|
|
||||||
debug.log_graph(graph, "travel graph")
|
debug.log_graph(graph, "travel graph")
|
||||||
|
|
Ładowanie…
Reference in New Issue