diff options
| -rw-r--r-- | embroider.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/embroider.py b/embroider.py index 01dd56f8..dbf07c1e 100644 --- a/embroider.py +++ b/embroider.py @@ -1271,7 +1271,9 @@ class SatinColumn(EmbroideryElement): def flatten_beziers_with_rungs(self): input_paths = [self.flatten([path]) for path in self.csp] input_paths = [shgeo.LineString(path[0]) for path in input_paths] - input_paths.sort(key=lambda path: path.length, reverse=True) + + paths = input_paths[:] + paths.sort(key=lambda path: path.length, reverse=True) # Imagine a satin column as a curvy ladder. # The two long paths are the "rails" of the ladder. The remainder are @@ -1279,6 +1281,10 @@ class SatinColumn(EmbroideryElement): rails = input_paths[:2] rungs = shgeo.MultiLineString(input_paths[2:]) + # The rails should stay in the order they were in the original CSP. + # (this lets the user control where the satin starts and ends) + rails.sort(key=lambda rail: input_paths.index(rail)) + result = [] for rail in rails: |
