diff options
| author | Lex Neva <github@lexneva.name> | 2016-10-27 22:34:37 -0400 |
|---|---|---|
| committer | Lex Neva <github@lexneva.name> | 2016-10-27 22:35:47 -0400 |
| commit | 46482bfd5e8594cdc8c53d62e3cfab941599a9d3 (patch) | |
| tree | adf1c672e18a2eec33a84209c5367e1dec68528f /embroider.py | |
| parent | ae49143c3af586712db8c854877682e155bfa7b6 (diff) | |
tidy
Diffstat (limited to 'embroider.py')
| -rw-r--r-- | embroider.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/embroider.py b/embroider.py index 918f0632..2279d6b6 100644 --- a/embroider.py +++ b/embroider.py @@ -146,6 +146,8 @@ def csp_to_shapely_polygon(path): polygon = shgeo.MultiPolygon([(poly_ary[0], poly_ary[1:])]) #print >> sys.stderr, "polygon valid:", polygon.is_valid return polygon + + class Patch: def __init__(self, color=None, stitches=None): self.color = color @@ -163,6 +165,7 @@ class Patch: def reverse(self): return Patch(self.color, self.stitches[::-1]) + def patches_to_stitches(patch_list, collapse_len_px=0): stitches = [] @@ -195,6 +198,7 @@ def patches_to_stitches(patch_list, collapse_len_px=0): return stitches + def stitches_to_paths(stitches): paths = [] lastColor = None @@ -227,6 +231,7 @@ def emit_inkscape(parent, stitches): 'd':simplepath.formatPath(path), }) + class Embroider(inkex.Effect): def __init__(self, *args, **kwargs): #dbg.write("args: %s\n" % repr(sys.argv)) @@ -1019,7 +1024,6 @@ if __name__ == '__main__': sys.setrecursionlimit(100000); e = Embroider() e.affect() - #dbg.write("aaaand, I'm done. seeeya!\n") dbg.flush() dbg.close() |
