summaryrefslogtreecommitdiff
path: root/lib/elements/fill_stitch.py
diff options
context:
space:
mode:
authorLex Neva <github.com@lexneva.name>2022-08-25 23:10:16 -0400
committerLex Neva <github.com@lexneva.name>2023-02-20 15:27:35 -0500
commit8cead6e3d9f9223bd4d74b30ec6964802f52d9b2 (patch)
tree48b567090614aaee995c1a8ffdfa92321182d9cb /lib/elements/fill_stitch.py
parent0ace1ce72c72aa3293d97e5d55e9e614b66d5ee2 (diff)
add smoothness option for contour fill
Diffstat (limited to 'lib/elements/fill_stitch.py')
-rw-r--r--lib/elements/fill_stitch.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py
index 77b4ac7c..fb8838cc 100644
--- a/lib/elements/fill_stitch.py
+++ b/lib/elements/fill_stitch.py
@@ -138,6 +138,20 @@ class FillStitch(EmbroideryElement):
return self.get_boolean_param('avoid_self_crossing', False)
@property
+ @param('smoothness_mm', _('Smoothness'),
+ tooltip=_(
+ 'Smooth the stitch path. Smoothness limits how far the smoothed stitch path ' +
+ 'is allowed to deviate from the original path. Hint: a lower stitchc tolerance may be needed too.'
+ ),
+ type='integer',
+ unit='mm',
+ default=0,
+ select_items=[('fill_method', 1)],
+ sort_index=5)
+ def smoothness(self):
+ return self.get_float_param('smoothness_mm', 0)
+
+ @property
@param('clockwise', _('Clockwise'), type='boolean', default=True, select_items=[('fill_method', 1)], sort_index=5)
def clockwise(self):
return self.get_boolean_param('clockwise', True)
@@ -651,9 +665,11 @@ class FillStitch(EmbroideryElement):
if self.contour_strategy == 0:
stitches = contour_fill.inner_to_outer(
tree,
+ polygon,
self.row_spacing,
self.max_stitch_length,
self.running_stitch_tolerance,
+ self.smoothness,
starting_point,
self.avoid_self_crossing
)