diff options
| author | Lex Neva <github.com@lexneva.name> | 2017-11-11 01:15:53 +0000 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2017-11-11 01:15:53 +0000 |
| commit | 68f246b0b7af2344aeedd900fd23f72b7874b79d (patch) | |
| tree | c0e61c70798aa3501f40030237302f0132d961ae /embroider.py | |
| parent | c7b1b22f6830869d5068483ff1ab052c1f05047e (diff) | |
now compatible with networkx 2.0
Diffstat (limited to 'embroider.py')
| -rw-r--r-- | embroider.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/embroider.py b/embroider.py index dcc5ebe9..5e58b872 100644 --- a/embroider.py +++ b/embroider.py @@ -674,7 +674,7 @@ class AutoFill(Fill): # Tag each node with its index and projection. graph.add_node(node, index=outline_index, projection=outline_projection) - nodes = graph.nodes(data=True) + nodes = list(graph.nodes(data=True)) # returns a list of tuples: [(node, {data}), (node, {data}) ...] nodes.sort(key=lambda node: (node[1]['index'], node[1]['projection'])) for outline_index, nodes in groupby(nodes, key=lambda node: node[1]['index']): @@ -1009,21 +1009,6 @@ class AutoFill(Fill): return patch - def visualize_graph(self, graph): - patches = [] - - graph = graph.copy() - - for start, end, key in graph.edges_iter(keys=True): - if key == "extra": - patch = Patch(color="#FF0000") - patch.add_stitch(PyEmb.Point(*start)) - patch.add_stitch(PyEmb.Point(*end)) - patches.append(patch) - - return patches - - def do_auto_fill(self, angle, row_spacing, max_stitch_length, starting_point=None): patches = [] |
