diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-11-18 11:54:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-18 11:54:14 +0100 |
| commit | dde0444ac29f663579e70c1214ca4faa9862f0a6 (patch) | |
| tree | 4dd9f03c41e2bb3d7e07742d6aeab0255f4eb322 /lib/elements/stroke.py | |
| parent | d15b1f40c758fc6c2fe324a9926e9722d504b2a4 (diff) | |
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
Diffstat (limited to 'lib/elements/stroke.py')
| -rw-r--r-- | lib/elements/stroke.py | 44 |
1 files changed, 39 insertions, 5 deletions
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 @@ -104,6 +104,18 @@ class Stroke(EmbroideryElement): 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'), tooltip=_('Length of stitches. Stitches can be shorter according to the stitch tolerance setting.'), @@ -223,6 +235,17 @@ class Stroke(EmbroideryElement): 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'), tooltip=_('Length of the cycle by which successive stitch lines are staggered. ' @@ -261,13 +284,24 @@ class Stroke(EmbroideryElement): 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'), tooltip=_('Increase density towards one side.'), 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) |
