diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-12-12 20:26:22 -0500 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-12-12 20:55:04 -0500 |
| commit | 9ae97154d689b188c796e5d11820e026ed1f9326 (patch) | |
| tree | d372594adc55e88492f3d9b43c363f833ae2bb34 /lib/elements | |
| parent | 7a73b201159bec1c45ad483251264baf872f6952 (diff) | |
add option to skip last stitch in fill rows
Diffstat (limited to 'lib/elements')
| -rw-r--r-- | lib/elements/auto_fill.py | 18 | ||||
| -rw-r--r-- | lib/elements/fill.py | 21 |
2 files changed, 34 insertions, 5 deletions
diff --git a/lib/elements/auto_fill.py b/lib/elements/auto_fill.py index 65b11fb1..486243ea 100644 --- a/lib/elements/auto_fill.py +++ b/lib/elements/auto_fill.py @@ -1,8 +1,10 @@ import math + from shapely import geometry as shgeo + from ..i18n import _ -from ..utils import cache from ..stitches import auto_fill +from ..utils import cache from .element import param, Patch from .fill import Fill @@ -93,6 +95,18 @@ class AutoFill(Fill): return self.get_float_param('fill_underlay_inset_mm', 0) @property + @param( + 'fill_underlay_skip_last', + _('Skip last stitch in each row'), + tooltip=_('The last stitch in each row is quite close to the first stitch in the next row. ' + 'Skipping it decreases stitch count and density.'), + group=_('AutoFill Underlay'), + type='boolean', + default=False) + def fill_underlay_skip_last(self): + return self.get_boolean_param("fill_underlay_skip_last", False) + + @property @param('expand_mm', _('Expand'), tooltip=_('Expand the shape before fill stitching, to compensate for gaps between shapes.'), @@ -150,6 +164,7 @@ class AutoFill(Fill): self.fill_underlay_max_stitch_length, self.running_stitch_length, self.staggers, + self.fill_underlay_skip_last, starting_point)) starting_point = stitches[-1] @@ -160,6 +175,7 @@ class AutoFill(Fill): self.max_stitch_length, self.running_stitch_length, self.staggers, + self.skip_last, starting_point, ending_point)) diff --git a/lib/elements/fill.py b/lib/elements/fill.py index 4156a24b..357adf4b 100644 --- a/lib/elements/fill.py +++ b/lib/elements/fill.py @@ -1,11 +1,12 @@ -from shapely import geometry as shgeo import math -from .element import param, EmbroideryElement, Patch +from shapely import geometry as shgeo + from ..i18n import _ +from ..stitches import legacy_fill from ..svg import PIXELS_PER_MM from ..utils import cache -from ..stitches import legacy_fill +from .element import param, EmbroideryElement, Patch class Fill(EmbroideryElement): @@ -42,6 +43,17 @@ class Fill(EmbroideryElement): @property @param( + 'skip_last', + _('Skip last stitch in each row'), + tooltip=_('The last stitch in each row is quite close to the first stitch in the next row. ' + 'Skipping it decreases stitch count and density.'), + type='boolean', + default=False) + def skip_last(self): + return self.get_boolean_param("skip_last", False) + + @property + @param( 'flip', _('Flip fill (start right-to-left)'), tooltip=_('The flip option can help you with routing your stitch path. ' @@ -133,5 +145,6 @@ class Fill(EmbroideryElement): self.end_row_spacing, self.max_stitch_length, self.flip, - self.staggers) + self.staggers, + self.skip_last) return [Patch(stitches=stitch_list, color=self.color) for stitch_list in stitch_lists] |
