diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2021-08-16 19:40:44 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-16 19:40:44 -0400 |
| commit | 3ebc238561dd2403b19a56a0f3147c70eb4ebe3d (patch) | |
| tree | c7e4c618335fac2196d42e03f26c3c2ad2a4251d /lib/stitches/fill.py | |
| parent | 5a7b7276759b6fb4c85891b13d9ee7a2da8150ab (diff) | |
| parent | b49f7d28314f30727f9f963bddb795b88a95f2bd (diff) | |
Merge pull request #1254 from inkstitch/kaalleen/satin-patterns
Satin pattern and split stitch
Diffstat (limited to 'lib/stitches/fill.py')
| -rw-r--r-- | lib/stitches/fill.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/stitches/fill.py b/lib/stitches/fill.py index 5aead9c7..d134be32 100644 --- a/lib/stitches/fill.py +++ b/lib/stitches/fill.py @@ -7,6 +7,7 @@ import math import shapely +from ..stitch_plan import Stitch from ..svg import PIXELS_PER_MM from ..utils import Point as InkstitchPoint from ..utils import cache @@ -65,16 +66,13 @@ def stitch_row(stitches, beg, end, angle, row_spacing, max_stitch_length, stagge # tile with each other. That's important because we often get # abutting fill regions from pull_runs(). - beg = InkstitchPoint(*beg) - end = InkstitchPoint(*end) + beg = Stitch(*beg, tags=('fill_row_start',)) + end = Stitch(*end, tags=('fill_row_end',)) row_direction = (end - beg).unit() segment_length = (end - beg).length() - # only stitch the first point if it's a reasonable distance away from the - # last stitch - if not stitches or (beg - stitches[-1]).length() > 0.5 * PIXELS_PER_MM: - stitches.append(beg) + stitches.append(beg) first_stitch = adjust_stagger(beg, angle, row_spacing, max_stitch_length, staggers) @@ -85,7 +83,7 @@ def stitch_row(stitches, beg, end, angle, row_spacing, max_stitch_length, stagge offset = (first_stitch - beg).length() while offset < segment_length: - stitches.append(beg + offset * row_direction) + stitches.append(Stitch(beg + offset * row_direction, tags=('fill_row'))) offset += max_stitch_length if (end - stitches[-1]).length() > 0.1 * PIXELS_PER_MM and not skip_last: |
