From 160ef32d43f5fc0d7229dbec6e7daf638a811d15 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sun, 26 Jan 2025 07:37:21 +0100 Subject: Improve satin guided ripple stitch and add stitch grid first option (#3436) * ripple stitch: add stitch grid first option * introduce an anchor line to fine tune satin guided ripples --- lib/extensions/selection_to_anchor_line.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 lib/extensions/selection_to_anchor_line.py (limited to 'lib/extensions/selection_to_anchor_line.py') diff --git a/lib/extensions/selection_to_anchor_line.py b/lib/extensions/selection_to_anchor_line.py new file mode 100644 index 00000000..fe9442f1 --- /dev/null +++ b/lib/extensions/selection_to_anchor_line.py @@ -0,0 +1,26 @@ +# Authors: see git history +# +# Copyright (c) 2021 Authors +# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details. + +import inkex + +from ..i18n import _ +from ..marker import set_marker +from ..svg.tags import EMBROIDERABLE_TAGS +from .base import InkstitchExtension + + +class SelectionToAnchorLine(InkstitchExtension): + + def effect(self): + if not self.get_elements(): + return + + if not self.svg.selected: + inkex.errormsg(_("Please select at least one object to be marked as a anchor line.")) + return + + for pattern in self.get_nodes(): + if pattern.tag in EMBROIDERABLE_TAGS: + set_marker(pattern, 'start', 'anchor-line') -- cgit v1.2.3