summaryrefslogtreecommitdiff
path: root/lib/svg
diff options
context:
space:
mode:
Diffstat (limited to 'lib/svg')
-rw-r--r--lib/svg/path.py6
-rw-r--r--lib/svg/tags.py108
2 files changed, 63 insertions, 51 deletions
diff --git a/lib/svg/path.py b/lib/svg/path.py
index c33a7a8f..6c2cbe35 100644
--- a/lib/svg/path.py
+++ b/lib/svg/path.py
@@ -74,6 +74,12 @@ def get_correction_transform(node, child=False):
def line_strings_to_csp(line_strings):
+ try:
+ # This lets us accept a MultiLineString or a list.
+ line_strings = line_strings.geoms
+ except AttributeError:
+ pass
+
return point_lists_to_csp(ls.coords for ls in line_strings)
diff --git a/lib/svg/tags.py b/lib/svg/tags.py
index 8b6f02a4..d78ba678 100644
--- a/lib/svg/tags.py
+++ b/lib/svg/tags.py
@@ -3,9 +3,10 @@
# Copyright (c) 2010 Authors
# Licensed under the GNU GPL version 3.0 or later. See the file LICENSE for details.
-import inkex
from lxml import etree
+import inkex
+
etree.register_namespace("inkstitch", "http://inkstitch.org/namespace")
inkex.NSS['inkstitch'] = 'http://inkstitch.org/namespace'
@@ -48,55 +49,60 @@ SVG_OBJECT_TAGS = (SVG_ELLIPSE_TAG, SVG_CIRCLE_TAG, SVG_RECT_TAG)
INKSTITCH_ATTRIBS = {}
inkstitch_attribs = [
- 'ties',
- 'force_lock_stitches',
- # clone
- 'clone',
- # polyline
- 'polyline',
- # fill
- 'angle',
- 'auto_fill',
- 'expand_mm',
- 'fill_underlay',
- 'fill_underlay_angle',
- 'fill_underlay_inset_mm',
- 'fill_underlay_max_stitch_length_mm',
- 'fill_underlay_row_spacing_mm',
- 'fill_underlay_skip_last',
- 'max_stitch_length_mm',
- 'row_spacing_mm',
- 'end_row_spacing_mm',
- 'skip_last',
- 'staggers',
- 'underlay_underpath',
- 'underpath',
- 'flip',
- 'expand_mm',
- # stroke
- 'manual_stitch',
- 'bean_stitch_repeats',
- 'repeats',
- 'running_stitch_length_mm',
- # satin column
- 'satin_column',
- 'running_stitch_length_mm',
- 'center_walk_underlay',
- 'center_walk_underlay_stitch_length_mm',
- 'contour_underlay',
- 'contour_underlay_stitch_length_mm',
- 'contour_underlay_inset_mm',
- 'zigzag_underlay',
- 'zigzag_spacing_mm',
- 'zigzag_underlay_inset_mm',
- 'zigzag_underlay_spacing_mm',
- 'zigzag_underlay_max_stitch_length_mm',
- 'e_stitch',
- 'pull_compensation_mm',
- 'stroke_first',
- # Legacy
- 'trim_after',
- 'stop_after'
- ]
+ 'ties',
+ 'force_lock_stitches',
+ # clone
+ 'clone',
+ # polyline
+ 'polyline',
+ # fill
+ 'angle',
+ 'auto_fill',
+ 'fill_method',
+ 'contour_strategy',
+ 'join_style',
+ 'avoid_self_crossing',
+ 'clockwise',
+ 'expand_mm',
+ 'fill_underlay',
+ 'fill_underlay_angle',
+ 'fill_underlay_inset_mm',
+ 'fill_underlay_max_stitch_length_mm',
+ 'fill_underlay_row_spacing_mm',
+ 'fill_underlay_skip_last',
+ 'max_stitch_length_mm',
+ 'row_spacing_mm',
+ 'end_row_spacing_mm',
+ 'skip_last',
+ 'staggers',
+ 'underlay_underpath',
+ 'underpath',
+ 'flip',
+ 'expand_mm',
+ # stroke
+ 'manual_stitch',
+ 'bean_stitch_repeats',
+ 'repeats',
+ 'running_stitch_length_mm',
+ # satin column
+ 'satin_column',
+ 'running_stitch_length_mm',
+ 'center_walk_underlay',
+ 'center_walk_underlay_stitch_length_mm',
+ 'contour_underlay',
+ 'contour_underlay_stitch_length_mm',
+ 'contour_underlay_inset_mm',
+ 'zigzag_underlay',
+ 'zigzag_spacing_mm',
+ 'zigzag_underlay_inset_mm',
+ 'zigzag_underlay_spacing_mm',
+ 'zigzag_underlay_max_stitch_length_mm',
+ 'e_stitch',
+ 'pull_compensation_mm',
+ 'stroke_first',
+ # Legacy
+ 'trim_after',
+ 'stop_after'
+]
for attrib in inkstitch_attribs:
INKSTITCH_ATTRIBS[attrib] = inkex.addNS(attrib, 'inkstitch')