not a fix, but avoid to fail on an other networkx no path error (#3106)

claudine/add_perspective_tricolore_KOR_font dev-build-kaalleen-preferences-min-stitch-length
Kaalleen 2024-07-24 16:01:34 +02:00 zatwierdzone przez GitHub
rodzic 1b09fdbddb
commit 3c37c52ab1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
1 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -869,7 +869,14 @@ def travel(shape, travel_graph, edge, running_stitch_length, running_stitch_tole
"""Create stitches to get from one point on an outline of the shape to another."""
start, end = edge
path = networkx.shortest_path(travel_graph, start, end, weight='weight')
try:
path = networkx.shortest_path(travel_graph, start, end, weight='weight')
except networkx.NetworkXNoPath:
# TODO: find a better solution, this may produce unwanted jump stitches
# but at least it renders the requested shape
# test case: underpath disabled, starts and ends on different outlines
return
if underpath and path != (start, end):
path = smooth_path(path, 2)
else: