2017-05-24 12:47:03 |
Saren Taşçıyan |
description |
Hi,
I am using Inkscape (on Ubuntu 14.04) for manufacturing devices for my research project. In 0.91, I was able to create my devices in Inkscape and save it as DXF files (which I had to convert later on to Gerber for the manufacturer).
After 0.92 update I am no longer able to save my file as DXF. The error log points out that the "mm" unit inside the string is the problem. There are several lines in dxf_outlines.py, which parses these strings as floats. As a workaround and to dissect the problem, I have modified first identified line as following:
float(node.get('cx', 0) -> float(node.get('cx', 0).replace('mm',''))
Then I have got the same error on other lines. Therefore, I have replaced those as well...
elif node.tag == inkex.addNS('circle','svg'):
cx = float(node.get('cx', 0).replace('mm',''))
cy = float(node.get('cy', 0).replace('mm','').replace('mm',''))
r = float(node.get('r').replace('mm',''))
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', 0).replace('mm',''))
cy = float(node.get('cy', 0).replace('mm','').replace('mm',''))
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)
Basically, this issue involves circles and ellipses. Of course removing unit from the string didn't solve the problem. But I have identified the lines involved. I hope this helps to improve Inkscape! |
Hi,
I am using Inkscape (on Ubuntu 16.04) for manufacturing devices for my research project. In 0.91, I was able to create my devices in Inkscape and save it as DXF files (which I had to convert later on to Gerber for the manufacturer).
After 0.92 update I am no longer able to save my file as DXF. The error log points out that the "mm" unit inside the string is the problem. There are several lines in dxf_outlines.py, which parses these strings as floats. As a workaround and to dissect the problem, I have modified first identified line as following:
float(node.get('cx', 0) -> float(node.get('cx', 0).replace('mm',''))
Then I have got the same error on other lines. Therefore, I have replaced those as well...
elif node.tag == inkex.addNS('circle','svg'):
cx = float(node.get('cx', 0).replace('mm',''))
cy = float(node.get('cy', 0).replace('mm','').replace('mm',''))
r = float(node.get('r').replace('mm',''))
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', 0).replace('mm',''))
cy = float(node.get('cy', 0).replace('mm','').replace('mm',''))
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)
Basically, this issue involves circles and ellipses. Of course removing unit from the string didn't solve the problem. But I have identified the lines involved. I hope this helps to improve Inkscape! |
|