SVG Path with zero radius arc exports weird arcs to DXF

Bug #1248104 reported by Dehalion
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Low
Alvin Penner

Bug Description

This is not that important but would be nice to have it fixed.

If you open a SVG from some other source with a path containing zero radius arcs they get exported to some very large arcs in DXF.
This problem only occurs if you open foreign SVGs because you won't be able to draw such a strange path. The path itself is displayed correctly in Inkscape, it is only exported to DXF in a strange way.

Example 1:
m 100,800 a 0,0 0 0 0 0,0 l 200,0 0,-100 -200,0 z

This path is a rectangle, but if you export it do DXF the arc becomes a line three times as high as the rectangle.

Example 2:
M0,0V450A0,0,0,0,0,0,450H290A0,0,0,0,0,290,450V0A0,0,0,0,0,290,0H0A0,0,0,0,0,0,0Z

Also a rectangle, but with absolute coordinates. Here the four arcs become really large arcs the same width as the rectangle itself.

I would suggest to omit zero radius arcs on export.

Use case is if you have to open SVGs generated by some tool and convert them to DXF for further processing.

Tags: dxf exporting
Revision history for this message
Alvin Penner (apenner) wrote :

    confirmed on Windows XP, Inkscape rev 12755.
    strictly speaking, this is illegal svg code, not because the radius is zero, but because the start point and endpoint of the arc are the same. In this case the arc is indeterminate, cannot be specified uniquely. The svg spec indicates that nothing should be drawn in this case. fwiw Internet Explorer 8 (Adobe SVG viewer) shows exactly the same deficiency when displaying the original svg file, as does the dxf output.
    in any event, this should be fixable, I'll look into it ...

Changed in inkscape:
status: New → Confirmed
jazzynico (jazzynico)
tags: added: dxf exporting
Revision history for this message
Alvin Penner (apenner) wrote :

attached is a new version of the file cubicsuperpath.py, which should fix the problem.
In order to try this, you'll need to copy the file into the \Inkscape\share\extensions\ directory to replace the current version.
I'll wait for a few days, and if there is no objection or further comment, I'll commit the change.

su_v (suv-lp)
Changed in inkscape:
importance: Undecided → Low
Revision history for this message
Dehalion (mail-launchpad) wrote :

fixes it for me, thx

Revision history for this message
Alvin Penner (apenner) wrote :

good to hear.
committed to rev 12791

Changed in inkscape:
status: Confirmed → Fix Committed
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.91
status: Fix Committed → Fix Released
assignee: nobody → Alvin Penner (apenner)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.