diff options
| author | Andreas <v.andreas.1@web.de> | 2022-01-28 22:31:55 +0100 |
|---|---|---|
| committer | Kaalleen <reni@allenka.de> | 2022-05-04 19:02:04 +0200 |
| commit | 95a933161616e5860862435d4b999db49b8e50a5 (patch) | |
| tree | 96fb27cc39e2792f14fa119608a3742f479323e2 | |
| parent | 8d19cdc59d00836fdf3ef037f31e7130771f84d2 (diff) | |
added legacy fill again
| -rw-r--r-- | lib/elements/auto_fill.py | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/lib/elements/auto_fill.py b/lib/elements/auto_fill.py index 55c9e2d0..3f75180b 100644 --- a/lib/elements/auto_fill.py +++ b/lib/elements/auto_fill.py @@ -14,7 +14,7 @@ from shapely import geometry as shgeo from shapely.validation import explain_validity from ..i18n import _ from ..stitch_plan import StitchGroup -from ..stitches import auto_fill +from ..stitches import auto_fill, fill from ..stitches import StitchPattern from ..utils import cache, version from .element import param @@ -55,7 +55,7 @@ class AutoFill(EmbroideryElement): @property @param('fill_method', _('Fill method'), type='dropdown', default=0, - options=[_("Auto Fill"), _("Tangential"), _("Guided Auto Fill")], sort_index=2) + options=[_("Auto Fill"), _("Tangential"), _("Guided Auto Fill"), _("Legacy Fill")], sort_index=2) def fill_method(self): return self.get_int_param('fill_method', 0) @@ -84,7 +84,7 @@ class AutoFill(EmbroideryElement): unit='deg', type='float', sort_index=4, - select_items=[('fill_method', 0)], + select_items=[('fill_method', 0), ('fill_method', 3)], default=0) @cache def angle(self): @@ -103,7 +103,8 @@ class AutoFill(EmbroideryElement): 'Skipping it decreases stitch count and density.'), type='boolean', sort_index=4, - select_items=[('fill_method', 0), ('fill_method', 2)], + select_items=[('fill_method', 0), ('fill_method', 2), + ('fill_method', 3)], default=False) def skip_last(self): return self.get_boolean_param("skip_last", False) @@ -116,7 +117,8 @@ class AutoFill(EmbroideryElement): 'When you enable flip, stitching goes from right-to-left instead of left-to-right.'), type='boolean', sort_index=4, - select_items=[('fill_method', 0), ('fill_method', 2)], + select_items=[('fill_method', 0), ('fill_method', 2), + ('fill_method', 3)], default=False) def flip(self): return self.get_boolean_param("flip", False) @@ -155,7 +157,7 @@ class AutoFill(EmbroideryElement): 'Setting this dictates how many rows apart the stitches will be before they fall in the same column position.'), type='int', sort_index=4, - select_items=[('fill_method', 0)], + select_items=[('fill_method', 0), ('fill_method', 3)], default=4) def staggers(self): return max(self.get_int_param("staggers", 4), 1) @@ -481,6 +483,21 @@ class AutoFill(EmbroideryElement): self.underpath, self.interlaced)) stitch_groups.append(stitch_group) + elif self.fill_method == 3: # Legacy Fill + stitch_lists = fill.legacy_fill(self.shape, + self.angle, + self.row_spacing, + self.end_row_spacing, + self.max_stitch_length, + self.flip, + self.staggers, + self.skip_last) + for stitch_list in stitch_lists: + stitch_group = StitchGroup( + color=self.color, + tags=("auto_fill", "auto_fill_top"), + stitches=stitch_list) + stitch_groups.append(stitch_group) except Exception: if hasattr(sys, 'gettrace') and sys.gettrace(): |
