[OpenSCAD] DXF export: simpler polygon handling

Lars Kruse lists at sumpfralle.de
Fri Dec 10 01:58:53 CET 2010


it would be great, if OpenSCAD would use the LWPOLYLINE structure
for storing polygons in DXF format. This would make it much easier to modify
the resulting path in other programs.
Currently all lines are single paths containing only two points - this is quite
hard to manipulate (e.g. in Inkscape).
Alternatively the LWPOLYLINE structure is interpreted as a single path of
multiple lines.

Attached you find a patch for OpenSCAD that replaces the LINE structure with
the LWPOLYLINE structure. I don't see any drawbacks connected to this change.
The resulting DXF files work with Inkscape.

Additionally I attached the DXF output of the following code snippet - with and
without the above patch. You can compare the result in Inkscape, if you like
(press F2 and select the path).

  difference() {

I would be happy, if you would include the patch.

thanks for your time,
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dxf_export_lwpolyline.patch
Type: text/x-patch
Size: 1627 bytes
Desc: not available
Url : http://rocklinux.net/pipermail/openscad/attachments/20101210/ea5d0d68/dxf_export_lwpolyline.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: two_circles_lwpolyline.dxf
Type: image/vnd.dxf
Size: 873 bytes
Desc: not available
Url : http://rocklinux.net/pipermail/openscad/attachments/20101210/ea5d0d68/two_circles_lwpolyline.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: two_circles_lines.dxf
Type: image/vnd.dxf
Size: 1711 bytes
Desc: not available
Url : http://rocklinux.net/pipermail/openscad/attachments/20101210/ea5d0d68/two_circles_lines.bin

More information about the OpenSCAD mailing list