diff options
| author | Andreas <v.andreas.1@web.de> | 2021-10-21 16:24:40 +0200 |
|---|---|---|
| committer | Kaalleen <reni@allenka.de> | 2022-05-04 18:55:40 +0200 |
| commit | 0fcf8bb97ced8df552cd0283b4ea009b6ca42623 (patch) | |
| tree | 9fbb5053db31a15ec140ed95f7b2634e987fe12d /lib/patterns.py | |
| parent | ea66eb8685524881ad34d412a8bbaeb482e5a9cf (diff) | |
added tangential and guided fill
Diffstat (limited to 'lib/patterns.py')
| -rw-r--r-- | lib/patterns.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/patterns.py b/lib/patterns.py index da22f21b..b4b60522 100644 --- a/lib/patterns.py +++ b/lib/patterns.py @@ -19,7 +19,7 @@ def is_pattern(node): def apply_patterns(patches, node): - patterns = _get_patterns(node) + patterns = get_patterns(node,"#inkstitch-pattern-marker") _apply_fill_patterns(patterns['fill_patterns'], patches) _apply_stroke_patterns(patterns['stroke_patterns'], patches) @@ -64,13 +64,14 @@ def _apply_fill_patterns(patterns, patches): patch.stitches = patch_points -def _get_patterns(node): +def get_patterns(node, marker_id): from .elements import EmbroideryElement + from .elements.auto_fill import auto_fill from .elements.stroke import Stroke fills = [] strokes = [] - xpath = "./parent::svg:g/*[contains(@style, 'marker-start:url(#inkstitch-pattern-marker)')]" + xpath = "./parent::svg:g/*[contains(@style, 'marker-start:url("+marker_id+")')]" patterns = node.xpath(xpath, namespaces=inkex.NSS) for pattern in patterns: if pattern.tag not in EMBROIDERABLE_TAGS: |
