Closed shapes with mix of curves and straights are messed up by DXF exporter

Bug #1697939 reported by Steve Baker
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Unassigned

Bug Description

If I create a closed shape in Inkscape with a mix of curved and straight lines - then SaveAs DXF, the resulting shape contains additional lines that should not be present in the output.

I've attached an example of a file that fails. When you export as DXF (with default settings), you get an additional horizontal line cutting across the "tabs" along the bottom edge of the left-hand shape and the top edge of the right-hand shape. Since I'm using this for laser-cutting, the result is a disaster!

Unchecking the "use LWPOLYLINE type of line output" option (which is checked by default) seems to work around the bug.

I'm not a DXF expert and I'm not familiar with Inkscape internals - but what I *SUSPECT* is happening is this:

* SVG supports both curved lines and straight lines within
  the same underlying structure...and it knows when a shape
  is "closed" or "open".

* DXF has DIFFERENT underlying structures for splines,
  straight lines and collections-of-straight-lines (POLYLINES).

* So the DXF exporter breaks apart SVG shapes into curves and
  straight lines and puts them into different DXF structures.

* When "use LWPOLYLINE" is selected, the exporter seems to collect
  all of the straight lines into one DXF structure...a polyline.
  Otherwise each line goes into a separate DXF object.

* What it SHOULD do is to realize that in breaking up a
  single SVG shape into multiple DXF shapes, it has to convert
  from a "closed" shape into several "open" shapes.

* It looks like LWPOLYLINE option incorrectly sets the
  resulting polyline shape to "closed" - when in fact it's now
  "open" because we removed the curves from the original SVG shape.

If my guess is right then this should be an easy fix - but if not, then someone should remove the "use LWPOLYLINE" option until the bug can be properly tracked down and fixed.

Thanks guys! Inkscape rocks! You do a great job.

Revision history for this message
Steve Baker (y9a7s7tjd2-s1eac-si9yrl01qs) wrote :
Revision history for this message
Steve Baker (y9a7s7tjd2-s1eac-si9yrl01qs) wrote :

Here is the broken DXF file generated by exporting the SVG file that's attached to the bug report with default export options.

summary: - Closed shapes with mix of curves and straights are messed up
+ Closed shapes with mix of curves and straights are messed up by DXF
+ exporter
Revision history for this message
Alvin Penner (apenner) wrote :

- not reproduced on Windows 10, Inkscape 0.92.1 r15371
- you may need to upgrade to a newer version of Inkscape, or just upgrade the dxf output routine by itself.
- you can get a recent version of the files dxf_outlines.py, and dxf_outlines.inx, and inkex.py from:

http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/files/head:/share/extensions/

if you decide to use a newer version, you will need to be aware of the fact that current Inkscape uses a default resolution of 96 dpi while previous versions used 90 dpi as the default.

Revision history for this message
Steve Baker (y9a7s7tjd2-s1eac-si9yrl01qs) wrote :

Yeah - I agree, it seems to be fixed in 0.92.1 - regardless of whether you check the use LWPOLYLINE flag is set.

Many thanks!

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

good to hear, in that case I'll mark this as fixed

Changed in inkscape:
status: New → Fix Released
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.