summaryrefslogtreecommitdiff
path: root/lib/elements/satin_column.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-03-23 09:00:40 +0100
committerGitHub <noreply@github.com>2024-03-23 09:00:40 +0100
commit1112959da18dad9a1a7790905cd57e4ed5903a8b (patch)
tree4a0c4a01da4718788d3cefecf9fdec892f5f982c /lib/elements/satin_column.py
parent3bf30f6f260d0eac60116ae3f8a2642665e16c6d (diff)
use offset curve for convert satin extension (#2775)
filter invalid rungs when merging satin sections
Diffstat (limited to 'lib/elements/satin_column.py')
-rw-r--r--lib/elements/satin_column.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py
index 75d7e259..10de9f82 100644
--- a/lib/elements/satin_column.py
+++ b/lib/elements/satin_column.py
@@ -941,8 +941,20 @@ class SatinColumn(EmbroideryElement):
# add on the other satin's rungs
rungs.extend(other_rungs)
+ rungs = self._get_filtered_rungs(rails, rungs)
+
return self._csp_to_satin(point_lists_to_csp(rails + rungs))
+ def _get_filtered_rungs(self, rails, rungs):
+ # returns a filtered list of rungs which do intersect the rails exactly twice
+ rails = shgeo.MultiLineString(rails)
+ filtered_rungs = []
+ for rung in shgeo.MultiLineString(rungs).geoms:
+ intersection = rung.intersection(rails)
+ if intersection.geom_type == "MultiPoint" and len(intersection.geoms) == 2:
+ filtered_rungs.append(list(rung.coords))
+ return filtered_rungs
+
@property
@cache
def center_line(self):