From 9ae97154d689b188c796e5d11820e026ed1f9326 Mon Sep 17 00:00:00 2001 From: Lex Neva Date: Wed, 12 Dec 2018 20:26:22 -0500 Subject: add option to skip last stitch in fill rows --- lib/elements/fill.py | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'lib/elements/fill.py') 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): @@ -40,6 +41,17 @@ class Fill(EmbroideryElement): # SVG spec says the default fill is black return self.get_style("fill", "#000000") + @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', @@ -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] -- cgit v1.2.3