DXF export: simpler polygon handling

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

DXF export: simpler polygon handling

Lars Kruse
Hi,

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() {
      circle(r=5);
      circle(r=2);
  }

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

thanks for your time,
Lars

dxf_export_lwpolyline.patch (1K) Download Attachment
two_circles_lwpolyline.dxf (1K) Download Attachment
two_circles_lines.dxf (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: DXF export: simpler polygon handling

kintel
Administrator
On Dec 10, 2010, at 01:58 AM, Lars Kruse wrote:

> 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.
>
Thanks for the patch!
I had to add a AutoCAD 2000 header to make the LWPOLYLINE elements work in QCAD, but apart from that, it looks good and has been applied.

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: DXF export: simpler polygon handling

Lars Kruse
Hi,

> > 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.
> >
> Thanks for the patch!
> I had to add a AutoCAD 2000 header to make the LWPOLYLINE elements work in
> QCAD, but apart from that, it looks good and has been applied.

ups - I did not check QCAD's support here - sorry.

Thanks for taking the time to fix this!

cheers,
Lars