From ec076315bb8b5f901670fee1c06db028242b21fd Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 27 Feb 2023 16:05:52 +0100 Subject: Various lock stitch options (#2006) Co-authored-by: Lex Neva --- lib/elements/stroke.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'lib/elements/stroke.py') diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py index 6aca3847..c633a2c6 100644 --- a/lib/elements/stroke.py +++ b/lib/elements/stroke.py @@ -6,19 +6,18 @@ import sys import shapely.geometry - from inkex import Transform from ..i18n import _ from ..marker import get_marker_elements from ..stitch_plan import StitchGroup -from ..stitches.running_stitch import bean_stitch, running_stitch from ..stitches.ripple_stitch import ripple_stitch +from ..stitches.running_stitch import bean_stitch, running_stitch from ..svg import get_node_transform, parse_length_with_units +from ..threads import ThreadColor from ..utils import Point, cache from .element import EmbroideryElement, param from .validation import ValidationWarning -from ..threads import ThreadColor warned_about_legacy_running_stitch = False @@ -445,13 +444,15 @@ class Stroke(EmbroideryElement): repeated_stitches.extend(this_path) - return StitchGroup(self.color, repeated_stitches) + return StitchGroup(self.color, repeated_stitches, lock_stitches=self.lock_stitches, force_lock_stitches=self.force_lock_stitches) def ripple_stitch(self): return StitchGroup( color=self.color, tags=["ripple_stitch"], - stitches=ripple_stitch(self)) + stitches=ripple_stitch(self), + lock_stitches=self.lock_stitches, + force_lock_stitches=self.force_lock_stitches) def do_bean_repeats(self, stitches): return bean_stitch(stitches, self.bean_stitch_repeats) @@ -471,7 +472,7 @@ class Stroke(EmbroideryElement): path = [Point(x, y) for x, y in path] # manual stitch if self.manual_stitch_mode: - patch = StitchGroup(color=self.color, stitches=path, stitch_as_is=True) + patch = StitchGroup(color=self.color, stitches=path, lock_stitches=(None, None)) # running stitch elif self.is_running_stitch(): patch = self.running_stitch(path, self.running_stitch_length, self.running_stitch_tolerance) -- cgit v1.2.3