From 13dcbf8846fe08a229537772ac82f504ebc3e2ee Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Sat, 30 Jan 2016 23:01:45 -0500 Subject: [PATCH] clean up satin column code and clarify error messages --- embroider.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embroider.py b/embroider.py index 4602ba4dd..00eb2a397 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