summaryrefslogtreecommitdiff
path: root/lib/svg
diff options
context:
space:
mode:
Diffstat (limited to 'lib/svg')
-rw-r--r--lib/svg/__init__.py4
-rw-r--r--lib/svg/path.py9
2 files changed, 11 insertions, 2 deletions
diff --git a/lib/svg/__init__.py b/lib/svg/__init__.py
index df76c0d2..34cc4b3d 100644
--- a/lib/svg/__init__.py
+++ b/lib/svg/__init__.py
@@ -1,4 +1,4 @@
+from .guides import get_guides
+from .path import apply_transforms, get_node_transform, get_correction_transform, line_strings_to_csp, point_lists_to_csp, line_strings_to_path
from .svg import color_block_to_point_lists, render_stitch_plan
from .units import *
-from .path import apply_transforms, get_node_transform, get_correction_transform, line_strings_to_csp, point_lists_to_csp
-from .guides import get_guides
diff --git a/lib/svg/path.py b/lib/svg/path.py
index d2b4aee1..f0f6708b 100644
--- a/lib/svg/path.py
+++ b/lib/svg/path.py
@@ -1,3 +1,4 @@
+import cubicsuperpath
import inkex
import simpletransform
@@ -80,3 +81,11 @@ def point_lists_to_csp(point_lists):
csp.append(subpath)
return csp
+
+
+def line_strings_to_path(line_strings):
+ csp = line_strings_to_csp(line_strings)
+
+ return inkex.etree.Element("path", {
+ "d": cubicsuperpath.formatPath(csp)
+ })