Skip to content

Commit fff2380

Browse files
authored
satin: fix synthesize rungs (#4042)
1 parent a44bb2b commit fff2380

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

lib/elements/satin_column.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,20 @@ def rungs(self):
687687

688688
@cache
689689
def _synthesize_rungs(self):
690+
# self.rails may contain additoinal nodes through flattening
691+
# at this point we know that we only have two paths, both paths are rails
692+
# so we can access the original nodes by parsing and filtering the original path
693+
paths = Path(self.parse_path()).break_apart()
694+
rails = [list(path.end_points) for path in paths if len(list(path.end_points)) > 1]
695+
if len(rails) != 2:
696+
return []
697+
690698
rung_endpoints = []
691699
# check for unequal length of rails
692-
equal_length = len(self.rails[0]) == len(self.rails[1])
700+
equal_length = len(rails[0]) == len(rails[1])
693701

694702
rails_to_reverse = self._get_rails_to_reverse()
695-
for i, points in enumerate(self.rails):
703+
for i, points in enumerate(rails):
696704

697705
if rails_to_reverse[i]:
698706
points = points[::-1]

0 commit comments

Comments
 (0)