fix snipping of unnecessary outline section

pull/5/head
Lex Neva 2017-10-17 18:24:45 +01:00
rodzic 8744ae054b
commit eff59de06d
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -865,6 +865,7 @@ class AutoFill(Fill):
the order of most-recently-visited first.
"""
original_graph = graph
graph = graph.copy()
num_segments = len(segments)
segments_visited = 0
@ -900,6 +901,11 @@ class AutoFill(Fill):
#if segments_visited >= 12:
# break
# Now we have a loop that covers every grating segment. It returns to
# where it started, which is unnecessary, so we'll snip the last bit off.
while original_graph.has_edge(*path[-1], key="outline"):
path.pop()
return path
def collapse_sequential_outline_edges(self, graph, path):
@ -992,9 +998,6 @@ class AutoFill(Fill):
graph = self.build_graph(segments, angle, row_spacing)
path = self.find_stitch_path(graph, segments)
# snip off the last one because it just unnecessarily returns to the start
path.pop()
if starting_point:
patch = Patch(self.color)
self.connect_points(patch, starting_point, path[0][0])