Comment 7 for bug 959671

Revision history for this message
su_v (suv-lp) wrote : Re: DXF export crashes from SVG

<circle> and <ellipse> basic SVG shapes are now supported in DXF export, as tracked in more recent report based on Inkscape 0.91 (the latest Inkscape release does write <circle> and <ellipse> elements if feasible):
* Bug #1489320 “Circles are not exported when saving in DXF file format”
  https://bugs.launchpad.net/inkscape/+bug/1489320

The test case in this reports however still fails to export to DXF: AFAICT the circles don't have cx, cy explicitly defined (-> 0,0), and are then moved to the actual position with a transform attribute:

  <circle
   id="circle3057"
   r="1.5"
   transform="matrix(2.64845E-014 1 -1 2.64845E-014 295.5 255.967)"
   stroke-width="0.0762"
   stroke="#1F1A17"
   fill="none" />

According to the SVG 1.1 specification, this is valid:
http://www.w3.org/TR/SVG11/shapes.html#CircleElementCXAttribute

The extension in current trunk fails with this error (presumable expecting cx, cy to present even if redundant (because 0)):

Traceback (most recent call last):
  File "dxf_outlines.py", line 360, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 268, in affect
    self.effect()
  File "dxf_outlines.py", line 346, in effect
    self.process_group(doc)
  File "dxf_outlines.py", line 304, in process_group
    self.process_group(node)
  File "dxf_outlines.py", line 304, in process_group
    self.process_group(node)
  File "dxf_outlines.py", line 308, in process_group
    self.process_shape(node, self.groupmat[-1])
  File "dxf_outlines.py", line 224, in process_shape
    cx = float(node.get('cx'))
TypeError: float() argument must be a string or a number