diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2025-08-24 09:14:09 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-24 09:14:09 -0400 |
| commit | dbef888e4d07fbd8dd840d160266768e41c894a2 (patch) | |
| tree | 5a71672ecb8e55457c088da0dcd88a9d51d8607e /lib/elements | |
| parent | c6c10ad642b92c5dd2687d4b6b48b1b4b36c8de7 (diff) | |
fix crash with tiny satin (#3934)
* avoid crash on tiny satin
* cleanup small satins too
* fix #3933
---------
Co-authored-by: Kaalleen <reni@allenka.de>
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/satin_column.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 62252ddb..4951f8bf 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -611,6 +611,10 @@ class SatinColumn(EmbroideryElement): self.pull_compensation_percent/100, True, ) + if len(pairs) == 1: + # we need at least two points for line string creation + # if there is only one, we simply duplicate it to prevent an error + pairs.append(pairs[0]) rail1 = [point[0] for point in pairs] rail2 = [point[1] for point in pairs] return shgeo.MultiLineString((rail1, rail2)) @@ -1110,6 +1114,10 @@ class SatinColumn(EmbroideryElement): points = [points[0] for points in pairs] stitches = running_stitch.even_running_stitch(points, self.running_stitch_length, self.running_stitch_tolerance) + + if len(stitches) == 1: + stitches.append(stitches[0]) + return stitches def _stitch_distance(self, pos0, pos1, previous_pos0, previous_pos1): |
