summaryrefslogtreecommitdiff
path: root/lib/elements/auto_fill.py
diff options
context:
space:
mode:
authorKaalleen <reni@allenka.de>2022-01-29 09:53:50 +0100
committerKaalleen <reni@allenka.de>2022-05-04 19:04:44 +0200
commit82216b184c669d6dea26672e5c0771146e62ca39 (patch)
tree4ce9324418a71557c24c445afe1e0e388d4985c3 /lib/elements/auto_fill.py
parent95a933161616e5860862435d4b999db49b8e50a5 (diff)
remove some pattern and marker mixups and some style issues
Diffstat (limited to 'lib/elements/auto_fill.py')
-rw-r--r--lib/elements/auto_fill.py29
1 files changed, 14 insertions, 15 deletions
diff --git a/lib/elements/auto_fill.py b/lib/elements/auto_fill.py
index 3f75180b..614e6887 100644
--- a/lib/elements/auto_fill.py
+++ b/lib/elements/auto_fill.py
@@ -3,27 +3,26 @@
# Copyright (c) 2010 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
+import logging
import math
+import re
import sys
import traceback
-import re
-import logging
-import inkex
+import inkex
from shapely import geometry as shgeo
from shapely.validation import explain_validity
+
from ..i18n import _
+from ..marker import get_marker_elements
from ..stitch_plan import StitchGroup
-from ..stitches import auto_fill, fill
-from ..stitches import StitchPattern
-from ..utils import cache, version
-from .element import param
-from .element import EmbroideryElement
-from ..patterns import get_patterns
-from .validation import ValidationWarning
-from ..utils import Point as InkstitchPoint
+from ..stitches import StitchPattern, auto_fill, fill
from ..svg import PIXELS_PER_MM
from ..svg.tags import INKSCAPE_LABEL
+from ..utils import Point as InkstitchPoint
+from ..utils import cache, version
+from .element import EmbroideryElement, param
+from .validation import ValidationWarning
class SmallShapeWarning(ValidationWarning):
@@ -393,7 +392,8 @@ class AutoFill(EmbroideryElement):
else:
return None
- def to_stitch_groups(self, last_patch):
+ def to_stitch_groups(self, last_patch): # noqa: C901
+ # TODO: split this up do_legacy_fill() etc.
stitch_groups = []
starting_point = self.get_starting_point(last_patch)
@@ -458,9 +458,8 @@ class AutoFill(EmbroideryElement):
stitches=path)
stitch_groups.append(stitch_group)
elif self.fill_method == 2: # Guided Auto Fill
- lines = get_patterns(
- self.node, "#inkstitch-guide-line-marker", False, True)
- lines = lines['stroke_patterns']
+ lines = get_marker_elements(self.node, "guide-line", False, True)
+ lines = lines['stroke']
if not lines or lines[0].is_empty:
inkex.errormsg(
_("No line marked as guide line found within the same group as patch"))