filter satins for auto route satin (#2389)

pull/2392/head
Kaalleen 2023-06-27 07:44:34 +02:00 zatwierdzone przez GitHub
rodzic 4c562a7127
commit 52ba1afb75
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -830,6 +830,8 @@ class SatinColumn(EmbroideryElement):
def center_line(self):
# similar technique to do_center_walk()
center_walk = [p[0] for p in self.plot_points_on_rails(self.zigzag_spacing, (0, 0), (-0.5, -0.5))]
if len(center_walk) < 2:
center_walk = [center_walk[0], center_walk[0]]
return shgeo.LineString(center_walk)
def offset_points(self, pos1, pos2, offset_px, offset_proportional):

Wyświetl plik

@ -63,7 +63,12 @@ class AutoSatin(CommandsExtension):
starting_point = self.get_starting_point()
ending_point = self.get_ending_point()
# Ignore fills
elements = [element for element in self.elements if isinstance(element, SatinColumn) or isinstance(element, Stroke)]
# Ignore fills and zero length satins
elements = [element for element in self.elements if (isinstance(element, SatinColumn) and element.center_line.length != 0) or
isinstance(element, Stroke)]
# at this point we possibly removed all the elements, in this case stop here
if not elements:
return
auto_satin(elements, self.options.preserve_order, starting_point, ending_point, self.options.trim)