diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-03-26 07:10:40 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-26 07:10:40 +0100 |
| commit | 8e70f3d2feaab8a14f775a5ef84002bdab9688f0 (patch) | |
| tree | f34d46ead8eb8d15317dc98de4113ccaf8acd0e9 /lib/elements/fill_stitch.py | |
| parent | ea394f6d3b7de3bc0818b6a9921f64e8bcbc4fbf (diff) | |
Add object based min stitch length (#2792)
* add object based min stitch length (overwrites global)
* add object based minimum jump stitch (overwrites global)
* rename patches to stitch_groups
Diffstat (limited to 'lib/elements/fill_stitch.py')
| -rw-r--r-- | lib/elements/fill_stitch.py | 54 |
1 files changed, 31 insertions, 23 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py index 203c9fe8..9ba649d7 100644 --- a/lib/elements/fill_stitch.py +++ b/lib/elements/fill_stitch.py @@ -714,7 +714,7 @@ class FillStitch(EmbroideryElement): def get_starting_point(self, previous_stitch_group): # If there is a "fill_start" Command, then use that; otherwise pick - # the point closest to the end of the last patch. + # the point closest to the end of the last stitch_group. if self.get_command('fill_start'): return self.get_command('fill_start').target_point @@ -792,18 +792,23 @@ class FillStitch(EmbroideryElement): return stitch_groups def do_legacy_fill(self): - stitch_lists = legacy_fill(self.shape, - self.angle, - self.row_spacing, - self.end_row_spacing, - self.max_stitch_length, - self.flip, - self.staggers, - self.skip_last) - return [StitchGroup(stitches=stitch_list, - color=self.color, - force_lock_stitches=self.force_lock_stitches, - lock_stitches=self.lock_stitches) for stitch_list in stitch_lists] + stitch_lists = legacy_fill( + self.shape, + self.angle, + self.row_spacing, + self.end_row_spacing, + self.max_stitch_length, + self.flip, + self.staggers, + self.skip_last + ) + + return [StitchGroup( + stitches=stitch_list, + color=self.color, + force_lock_stitches=self.force_lock_stitches, + lock_stitches=self.lock_stitches + ) for stitch_list in stitch_lists] def do_underlay(self, shape, starting_point): color = self.color @@ -833,7 +838,7 @@ class FillStitch(EmbroideryElement): starting_point = underlay.stitches[-1] return [stitch_groups, starting_point] - def do_auto_fill(self, shape, last_patch, starting_point, ending_point): + def do_auto_fill(self, shape, last_stitch_group, starting_point, ending_point): stitch_group = StitchGroup( color=self.color, tags=("auto_fill", "auto_fill_top"), @@ -851,10 +856,12 @@ class FillStitch(EmbroideryElement): self.skip_last, starting_point, ending_point, - self.underpath)) + self.underpath + ) + ) return [stitch_group] - def do_contour_fill(self, polygon, last_patch, starting_point): + def do_contour_fill(self, polygon, last_stitch_group, starting_point): if not starting_point: starting_point = (0, 0) starting_point = shgeo.Point(starting_point) @@ -894,17 +901,17 @@ class FillStitch(EmbroideryElement): tags=("auto_fill", "auto_fill_top"), stitches=stitches, force_lock_stitches=self.force_lock_stitches, - lock_stitches=self.lock_stitches,) + lock_stitches=self.lock_stitches) stitch_groups.append(stitch_group) return stitch_groups - def do_guided_fill(self, shape, last_patch, starting_point, ending_point): + def do_guided_fill(self, shape, last_stitch_group, starting_point, ending_point): guide_line = self._get_guide_lines() # No guide line: fallback to normal autofill if not guide_line: - return self.do_auto_fill(shape, last_patch, starting_point, ending_point) + return self.do_auto_fill(shape, last_stitch_group, starting_point, ending_point) stitch_group = StitchGroup( color=self.color, @@ -947,11 +954,11 @@ class FillStitch(EmbroideryElement): tags=("meander_fill", "meander_fill_top"), stitches=meander_fill(self, shape, original_shape, i, starting_point, ending_point), force_lock_stitches=self.force_lock_stitches, - lock_stitches=self.lock_stitches, + lock_stitches=self.lock_stitches ) return [stitch_group] - def do_circular_fill(self, shape, last_patch, starting_point, ending_point): + def do_circular_fill(self, shape, last_stitch_group, starting_point, ending_point): # get target position command = self.get_command('ripple_target') if command: @@ -983,8 +990,9 @@ class FillStitch(EmbroideryElement): tags=("circular_fill", "auto_fill_top"), stitches=stitches, force_lock_stitches=self.force_lock_stitches, - lock_stitches=self.lock_stitches,) + lock_stitches=self.lock_stitches + ) return [stitch_group] - def do_linear_gradient_fill(self, shape, last_patch, start, end): + def do_linear_gradient_fill(self, shape, last_stitch_group, start, end): return linear_gradient_fill(self, shape, start, end) |
