From dde0444ac29f663579e70c1214ca4faa9862f0a6 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 18 Nov 2024 11:54:14 +0100 Subject: Manual ripple pattern (#3256) * ripple stitch: add manual pattern placement option * add flip copies option * rewrite adjust grid * more control for satin guided ripples: render at rungs --- lib/elements/stroke.py | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) (limited to 'lib/elements/stroke.py') diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index d41d74db..10aa06b7 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -103,6 +103,18 @@ class Stroke(EmbroideryElement): def bean_stitch_repeats(self): return self.get_multiple_int_param("bean_stitch_repeats", "0") + @property + @param('manual_pattern_placement', + _('Manual stitch placement'), + tooltip=_('No extra stitches will be added to the original ripple pattern ' + 'and the running stitch length value will be ignored.'), + type='boolean', + select_items=[('stroke_method', 'ripple_stitch')], + default=False, + sort_index=3) + def manual_pattern_placement(self): + return self.get_boolean_param('manual_pattern_placement', False) + @property @param('running_stitch_length_mm', _('Running stitch length'), @@ -222,6 +234,17 @@ class Stroke(EmbroideryElement): return return max(min_dist, 0.01) + @property + @param('render_at_rungs', + _('Render at rungs'), + tooltip=_('Position satin guided pattern at rungs.'), + type='boolean', + select_items=[('stroke_method', 'ripple_stitch')], + default=False, + sort_index=9) + def render_at_rungs(self): + return self.get_boolean_param('render_at_rungs', False) + @property @param('staggers', _('Stagger lines this many times before repeating'), @@ -260,6 +283,17 @@ class Stroke(EmbroideryElement): def skip_end(self): return abs(self.get_int_param("skip_end", 0)) + @property + @param('flip_copies', + _('Flip every second line'), + tooltip=_('Linear ripple: wether to flip the pattern every second line or not.'), + type='boolean', + select_items=[('stroke_method', 'ripple_stitch')], + default=True, + sort_index=12) + def flip_copies(self): + return self.get_boolean_param('flip_copies', True) + @property @param('exponent', _('Line distance exponent'), @@ -267,7 +301,7 @@ class Stroke(EmbroideryElement): type='float', default=1, select_items=[('stroke_method', 'ripple_stitch')], - sort_index=12) + sort_index=13) @cache def exponent(self): return max(self.get_float_param("exponent", 1), 0.1) @@ -279,7 +313,7 @@ class Stroke(EmbroideryElement): type='boolean', default=False, select_items=[('stroke_method', 'ripple_stitch')], - sort_index=13) + sort_index=14) @cache def flip_exponent(self): return self.get_boolean_param("flip_exponent", False) @@ -291,7 +325,7 @@ class Stroke(EmbroideryElement): type='boolean', default=False, select_items=[('stroke_method', 'ripple_stitch')], - sort_index=14) + sort_index=15) @cache def reverse(self): return self.get_boolean_param("reverse", False) @@ -313,7 +347,7 @@ class Stroke(EmbroideryElement): options=_reverse_rails_options, default='automatic', select_items=[('stroke_method', 'ripple_stitch')], - sort_index=15) + sort_index=16) def reverse_rails(self): return self.get_param('reverse_rails', 'automatic') @@ -339,7 +373,7 @@ class Stroke(EmbroideryElement): # 0: xy, 1: x, 2: y, 3: none options=["X Y", "X", "Y", _("None")], select_items=[('stroke_method', 'ripple_stitch')], - sort_index=17) + sort_index=18) def scale_axis(self): return self.get_int_param('scale_axis', 0) -- cgit v1.2.3