summaryrefslogtreecommitdiffstats
path: root/share/extensions
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2015-09-01 17:13:06 +0000
committerJabiertxof <jtx@jtx.marker.es>2015-09-01 17:13:06 +0000
commit6f342e449becb621a2f93f492b38791ec5aba35d (patch)
tree131870f18f5a3853b98c9742e0e165b110978289 /share/extensions
parentastyle code (diff)
parentextensions. dxf_outlines. add support for line, circle, ellipse. (Bug 1489320... (diff)
downloadinkscape-6f342e449becb621a2f93f492b38791ec5aba35d.tar.gz
inkscape-6f342e449becb621a2f93f492b38791ec5aba35d.zip
update to trunk
(bzr r13645.1.117)
Diffstat (limited to 'share/extensions')
-rwxr-xr-xshare/extensions/dxf_outlines.py28
1 files changed, 22 insertions, 6 deletions
diff --git a/share/extensions/dxf_outlines.py b/share/extensions/dxf_outlines.py
index 091606ba3..a45100cf5 100755
--- a/share/extensions/dxf_outlines.py
+++ b/share/extensions/dxf_outlines.py
@@ -211,12 +211,28 @@ class MyEffect(inkex.Effect):
y = float(node.get('y'))
width = float(node.get('width'))
height = float(node.get('height'))
- p = [[[x, y],[x, y],[x, y]]]
- p.append([[x + width, y],[x + width, y],[x + width, y]])
- p.append([[x + width, y + height],[x + width, y + height],[x + width, y + height]])
- p.append([[x, y + height],[x, y + height],[x, y + height]])
- p.append([[x, y],[x, y],[x, y]])
- p = [p]
+ d = "m %s,%s %s,%s %s,%s %s,%s z" % (x, y, width, 0, 0, height, -width, 0)
+ p = cubicsuperpath.parsePath(d)
+ elif node.tag == inkex.addNS('line','svg'):
+ x1 = float(node.get('x1'))
+ x2 = float(node.get('x2'))
+ y1 = float(node.get('y1'))
+ y2 = float(node.get('y2'))
+ d = "M %s,%s L %s,%s" % (x1, y1, x2, y2)
+ p = cubicsuperpath.parsePath(d)
+ elif node.tag == inkex.addNS('circle','svg'):
+ cx = float(node.get('cx'))
+ cy = float(node.get('cy'))
+ r = float(node.get('r'))
+ d = "m %s,%s a %s,%s 0 0 1 %s,%s %s,%s 0 0 1 %s,%s z" % (cx + r, cy, r, r, -2*r, 0, r, r, 2*r, 0)
+ p = cubicsuperpath.parsePath(d)
+ elif node.tag == inkex.addNS('ellipse','svg'):
+ cx = float(node.get('cx'))
+ cy = float(node.get('cy'))
+ rx = float(node.get('rx'))
+ ry = float(node.get('ry'))
+ d = "m %s,%s a %s,%s 0 0 1 %s,%s %s,%s 0 0 1 %s,%s z" % (cx + rx, cy, rx, ry, -2*rx, 0, rx, ry, 2*rx, 0)
+ p = cubicsuperpath.parsePath(d)
else:
return
trans = node.get('transform')