kopia lustrzana https://github.com/inkstitch/inkstitch
preserve order of rails in satin with rungs
rodzic
5986ea4f22
commit
806123b6ac
|
@ -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:
|
||||
|
|
Ładowanie…
Reference in New Issue