diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-06-04 20:19:37 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-06-04 20:19:37 -0400 |
| commit | 692e033e71ed4655cef93be44c762bacf39caaee (patch) | |
| tree | e24119a0174a093780f0ce7fc82a4e7c5f36bd54 /lib/elements/stroke.py | |
| parent | d53f2ecaf926828526304248d4508afc416b1296 (diff) | |
don't crash on empty subpaths
Diffstat (limited to 'lib/elements/stroke.py')
| -rw-r--r-- | lib/elements/stroke.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index 48662b6d..097b36bc 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -97,6 +97,11 @@ class Stroke(EmbroideryElement): # TODO: use inkstitch.stitches.running_stitch patch = Patch(color=self.color) + + # can't stitch a single point + if len(emb_point_list) < 2: + return patch + p0 = emb_point_list[0] rho = 0.0 side = 1 @@ -156,6 +161,7 @@ class Stroke(EmbroideryElement): else: patch = self.stroke_points(path, self.zigzag_spacing / 2.0, stroke_width=self.stroke_width) - patches.append(patch) + if patch: + patches.append(patch) return patches |
