diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2025-11-07 17:10:03 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-07 17:10:03 +0100 |
| commit | 5a9ae03dc14ea5b68a99581c21a5d8085f1a3243 (patch) | |
| tree | 4b729fbdc8656f3ba75b7dfdd2ccfecdd8718fee /lib/elements/satin_column.py | |
| parent | 383f164b6d90c0819d49f4fb16deb9efa3e11df2 (diff) | |
Running stitch length sequence (#4034)
* allow running stitch length sequences
* contour fill: fix error message for long stitch length
* satin: fix center underlay stitch length
Diffstat (limited to 'lib/elements/satin_column.py')
| -rw-r--r-- | lib/elements/satin_column.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/elements/satin_column.py b/lib/elements/satin_column.py index 6babc851..277c4f84 100644 --- a/lib/elements/satin_column.py +++ b/lib/elements/satin_column.py @@ -1117,14 +1117,16 @@ class SatinColumn(EmbroideryElement): linestring = shgeo.LineString(stitches) return linestring - def _get_center_line_stitches(self, position): + def _get_center_line_stitches(self, position, stitch_length=None): inset_prop = -np.array([position, 100-position]) / 100 + if stitch_length is None: + stitch_length = self.running_stitch_length # Do it like contour underlay, but inset all the way to the center. pairs = self.plot_points_on_rails(self.running_stitch_tolerance, (0, 0), inset_prop) points = [points[0] for points in pairs] - stitches = running_stitch.even_running_stitch(points, self.running_stitch_length, self.running_stitch_tolerance) + stitches = running_stitch.even_running_stitch(points, [stitch_length], self.running_stitch_tolerance) if len(stitches) == 1: stitches.append(stitches[0]) @@ -1338,12 +1340,12 @@ class SatinColumn(EmbroideryElement): first_side = running_stitch.even_running_stitch( [points[0] for points in pairs], - self.contour_underlay_stitch_length, + [self.contour_underlay_stitch_length], self.contour_underlay_stitch_tolerance ) second_side = running_stitch.even_running_stitch( [points[1] for points in pairs], - self.contour_underlay_stitch_length, + [self.contour_underlay_stitch_length], self.contour_underlay_stitch_tolerance ) @@ -1381,7 +1383,7 @@ class SatinColumn(EmbroideryElement): repeats = self.center_walk_underlay_repeats stitch_groups = [] - stitches = self._get_center_line_stitches(self.center_walk_underlay_position) + stitches = self._get_center_line_stitches(self.center_walk_underlay_position, self.center_walk_underlay_stitch_length) if end_point: tags = ("satin_column", "satin_column_underlay", "satin_center_walk") stitches = shgeo.LineString(stitches) |
