kopia lustrzana https://github.com/inkstitch/inkstitch
make ripple stitch use even stitching when not staggering or randomizing.
rodzic
879f759568
commit
d0b41d2a92
|
@ -227,10 +227,11 @@ class Stroke(EmbroideryElement):
|
||||||
_('Stagger lines this many times before repeating'),
|
_('Stagger lines this many times before repeating'),
|
||||||
tooltip=_('Length of the cycle by which successive stitch lines are staggered. '
|
tooltip=_('Length of the cycle by which successive stitch lines are staggered. '
|
||||||
'Fractional values are allowed and can have less visible diagonals than integer values. '
|
'Fractional values are allowed and can have less visible diagonals than integer values. '
|
||||||
|
'A value of 0 (default) disables staggering and instead stitches evenly.'
|
||||||
'For linear ripples only.'),
|
'For linear ripples only.'),
|
||||||
type='int',
|
type='int',
|
||||||
select_items=[('stroke_method', 'ripple_stitch')],
|
select_items=[('stroke_method', 'ripple_stitch')],
|
||||||
default=1,
|
default=0,
|
||||||
sort_index=9)
|
sort_index=9)
|
||||||
def staggers(self):
|
def staggers(self):
|
||||||
return self.get_float_param("staggers", 1)
|
return self.get_float_param("staggers", 1)
|
||||||
|
|
|
@ -11,7 +11,7 @@ from ..utils import prng
|
||||||
from ..utils.geometry import line_string_to_point_list
|
from ..utils.geometry import line_string_to_point_list
|
||||||
from ..utils.threading import check_stop_flag
|
from ..utils.threading import check_stop_flag
|
||||||
from .guided_fill import apply_stitches
|
from .guided_fill import apply_stitches
|
||||||
from .running_stitch import even_running_stitch, random_running_stitch, running_stitch
|
from .running_stitch import even_running_stitch, running_stitch
|
||||||
|
|
||||||
|
|
||||||
def ripple_stitch(stroke):
|
def ripple_stitch(stroke):
|
||||||
|
@ -77,14 +77,13 @@ def _get_staggered_stitches(stroke, lines, skip_start):
|
||||||
elif stroke.join_style == 1:
|
elif stroke.join_style == 1:
|
||||||
should_reverse = (i + skip_start) % 2 == 1
|
should_reverse = (i + skip_start) % 2 == 1
|
||||||
|
|
||||||
if enable_random:
|
if enable_random or stroke.staggers == 0:
|
||||||
min_length = max(stitch_length - length_delta, 0)
|
|
||||||
max_length = stitch_length + length_delta
|
|
||||||
if should_reverse:
|
if should_reverse:
|
||||||
line.reverse()
|
line.reverse()
|
||||||
points = random_running_stitch(line, min_length, max_length, tolerance, prng.join_args(random_seed, i))
|
points = running_stitch(line, stitch_length, tolerance, enable_random, length_delta, prng.join_args(random_seed, i))
|
||||||
stitched_line = connector + points
|
stitched_line = connector + points
|
||||||
else:
|
else:
|
||||||
|
# uses the guided fill alforithm to stagger rows of stitches
|
||||||
points = list(apply_stitches(LineString(line), stitch_length, stroke.staggers, 0.5, i, tolerance).coords)
|
points = list(apply_stitches(LineString(line), stitch_length, stroke.staggers, 0.5, i, tolerance).coords)
|
||||||
stitched_line = [InkstitchPoint(*point) for point in points]
|
stitched_line = [InkstitchPoint(*point) for point in points]
|
||||||
if should_reverse:
|
if should_reverse:
|
||||||
|
|
Ładowanie…
Reference in New Issue