diff options
| author | Lex Neva <github@lexneva.name> | 2016-01-30 23:01:45 -0500 |
|---|---|---|
| committer | Lex Neva <github@lexneva.name> | 2016-01-30 23:01:45 -0500 |
| commit | 13dcbf8846fe08a229537772ac82f504ebc3e2ee (patch) | |
| tree | eede27874649245c1c3669d0f418170bd8e3620c | |
| parent | b1e40861add9e238801379f46528cd1d74f81d38 (diff) | |
clean up satin column code and clarify error messages
| -rw-r--r-- | embroider.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/embroider.py b/embroider.py index 4602ba4d..00eb2a39 100644 --- a/embroider.py +++ b/embroider.py @@ -993,13 +993,13 @@ class Embroider(inkex.Effect): node_id = node.get("id") if len(csp) != 2: - self.fatal("satin column: object %s invalid: expected exactly two sub-paths" % node_id) + self.fatal("satin column: object %s invalid: expected exactly two sub-paths, but there are %s" % (node_id, len(csp))) if self.get_style(node, "fill")!=None: self.fatal("satin column: object %s has a fill (but should not)" % node_id) if len(csp[0]) != len(csp[1]): - self.fatal("satin column: object %s has two paths with an unequal number of points (should be equal)" % node_id) + self.fatal("satin column: object %s has two paths with an unequal number of points (%s and %s)" % (node_id, len(csp[0]), len(csp[1]))) def satin_column(self, node): # Stitch a variable-width satin column, zig-zagging between two paths. @@ -1111,8 +1111,8 @@ class Embroider(inkex.Effect): while True: segment_end = path[index + 1] - segment_remaining = (next_pos - pos) - distance_remaining = remaining.length() + segment_remaining = (segment_end - pos) + distance_remaining = segment_remaining.length() if distance_remaining > distance: return pos + segment_remaining.unit().mul(distance), index |
