diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2023-04-24 22:52:31 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-24 22:52:31 +0200 |
| commit | e5ccb10eef83b88b722e94dc39f8bcc7692a3ce1 (patch) | |
| tree | ba17b2204c85532549b288d3f8338e7422162d69 /lib/stitches | |
| parent | 9b726f6436c87860cc3aef1bb24c61fb9e4e06cd (diff) | |
Add bean stitch and repeat options to meander fill (#2232)
Diffstat (limited to 'lib/stitches')
| -rw-r--r-- | lib/stitches/meander_fill.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/stitches/meander_fill.py b/lib/stitches/meander_fill.py index 08ff4999..f6106606 100644 --- a/lib/stitches/meander_fill.py +++ b/lib/stitches/meander_fill.py @@ -15,7 +15,7 @@ from ..utils.list import poprandom from ..utils.prng import iter_uniform_floats from ..utils.smoothing import smooth_path from ..utils.threading import check_stop_flag -from .running_stitch import running_stitch +from .running_stitch import bean_stitch, running_stitch def meander_fill(fill, shape, original_shape, shape_index, starting_point, ending_point): @@ -186,6 +186,17 @@ def post_process(points, shape, original_shape, fill): if fill.clip: stitches = clamp_path_to_polygon(stitches, original_shape) + if fill.bean_stitch_repeats: + stitches = bean_stitch(stitches, fill.bean_stitch_repeats) + + if fill.repeats: + for i in range(1, fill.repeats): + if i % 2 == 1: + # reverse every other pass + stitches.extend(stitches[::-1]) + else: + stitches.extend(stitches) + return stitches |
