summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2018-06-07 20:16:45 -0400
committerGitHub <noreply@github.com>2018-06-07 20:16:45 -0400
commit1d73c040d8327a2f9424ae6f22a5431c30fac608 (patch)
tree7418c57ecaf21f3a70e3b9fe5418ba0afdad739d
parentdbaf923efdd3c57b996254b619d88078798f0de9 (diff)
parent2a4f3e8cdf23d34f6fcfe7dd6454824a928512fd (diff)
Merge pull request #180 from lexelby/lexelby-outset
add Expand param for fills
-rw-r--r--lib/elements/auto_fill.py33
-rw-r--r--messages.po5
2 files changed, 32 insertions, 6 deletions
diff --git a/lib/elements/auto_fill.py b/lib/elements/auto_fill.py
index 08ae67f7..504bae2a 100644
--- a/lib/elements/auto_fill.py
+++ b/lib/elements/auto_fill.py
@@ -63,20 +63,43 @@ class AutoFill(Fill):
return self.get_float_param("fill_underlay_max_stitch_length_mm") or self.max_stitch_length
@property
- @param('fill_underlay_inset_mm', _('Inset'), unit='mm', group=_('AutoFill Underlay'), type='float', default=0)
+ @param('fill_underlay_inset_mm',
+ _('Inset'),
+ tooltip='Shrink the shape before doing underlay, to prevent underlay from showing around the outside of the fill.',
+ unit='mm',
+ group=_('AutoFill Underlay'),
+ type='float',
+ default=0)
def fill_underlay_inset(self):
return self.get_float_param('fill_underlay_inset_mm', 0)
@property
- def underlay_shape(self):
- if self.fill_underlay_inset:
- shape = self.shape.buffer(-self.fill_underlay_inset)
+ @param('expand_mm',
+ _('Expand'),
+ tooltip='Expand the shape before fill stitching, to compensate for gaps between shapes.',
+ unit='mm',
+ type='float',
+ default=0)
+ def expand(self):
+ return self.get_float_param('expand_mm', 0)
+
+ def shrink_or_grow_shape(self, amount):
+ if amount:
+ shape = self.shape.buffer(amount)
if not isinstance(shape, shgeo.MultiPolygon):
shape = shgeo.MultiPolygon([shape])
return shape
else:
return self.shape
+ @property
+ def underlay_shape(self):
+ return self.shrink_or_grow_shape(-self.fill_underlay_inset)
+
+ @property
+ def fill_shape(self):
+ return self.shrink_or_grow_shape(self.expand)
+
def to_patches(self, last_patch):
stitches = []
@@ -96,7 +119,7 @@ class AutoFill(Fill):
starting_point))
starting_point = stitches[-1]
- stitches.extend(auto_fill(self.shape,
+ stitches.extend(auto_fill(self.fill_shape,
self.angle,
self.row_spacing,
self.end_row_spacing,
diff --git a/messages.po b/messages.po
index 7b2ca815..376437e0 100644
--- a/messages.po
+++ b/messages.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PROJECT VERSION\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
-"POT-Creation-Date: 2018-05-01 21:21-0400\n"
+"POT-Creation-Date: 2018-06-01 20:34-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -44,6 +44,9 @@ msgstr ""
msgid "Inset"
msgstr ""
+msgid "Expand"
+msgstr ""
+
msgid "TRIM after"
msgstr ""