From fff23803fa148304edef2cc1bd947c8079e5c3b8 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Fri, 14 Nov 2025 13:12:04 +0100 Subject: satin: fix synthesize rungs (#4042) --- lib/elements/satin_column.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'lib/elements') diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 277c4f84..68cbbd95 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -687,12 +687,20 @@ class SatinColumn(EmbroideryElement): @cache def _synthesize_rungs(self): + # self.rails may contain additoinal nodes through flattening + # at this point we know that we only have two paths, both paths are rails + # so we can access the original nodes by parsing and filtering the original path + paths = Path(self.parse_path()).break_apart() + rails = [list(path.end_points) for path in paths if len(list(path.end_points)) > 1] + if len(rails) != 2: + return [] + rung_endpoints = [] # check for unequal length of rails - equal_length = len(self.rails[0]) == len(self.rails[1]) + equal_length = len(rails[0]) == len(rails[1]) rails_to_reverse = self._get_rails_to_reverse() - for i, points in enumerate(self.rails): + for i, points in enumerate(rails): if rails_to_reverse[i]: points = points[::-1] -- cgit v1.2.3