summaryrefslogtreecommitdiff
path: root/lib/elements
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-01-22 10:21:06 +0100
committerGitHub <noreply@github.com>2025-01-22 10:21:06 +0100
commit6ed0a35dd27f9c9f9bdb16f19db1dcce9c183128 (patch)
treed0ef41ec59da4b25084650218d3b51c2a0eb13ec /lib/elements
parent2b9f438b3b8b60e71dcdd1cc9498b27d6a313640 (diff)
satin ending_point: fix error when split point at start/end (#3452)
Diffstat (limited to 'lib/elements')
-rw-r--r--lib/elements/satin_column.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py
index cb1a8704..11ee92b5 100644
--- a/lib/elements/satin_column.py
+++ b/lib/elements/satin_column.py
@@ -1469,6 +1469,12 @@ class SatinColumn(EmbroideryElement):
def _split_linestring_at_end_point(self, linestring, end_point):
split_line = set_precision(shgeo.LineString(self.find_cut_points(end_point)), 0.00001)
+ if not split_line:
+ start = shgeo.Point(linestring.coords[0])
+ if start.distance(shgeo.Point(end_point)) < 0.1:
+ return start, linestring
+ else:
+ return linestring, shgeo.Point(linestring.coords[-1])
split_point = nearest_points(linestring, split_line)[0]
project = linestring.project(split_point)
start = substring(linestring, 0, project)