discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Fwd: Does openscad take a .dxf as input?

CA
Carsten Arnholm
Fri, Dec 17, 2021 7:56 AM

On 17.12.2021 07:03, MichaelAtOz wrote:

For example, an .scad file might try to do:
linear_extrude(height=100) import("with_splines.dxf");

This will fail in OpenSCAD, but running the exact same .scad file with
AngelCAD instead will often work.

Is that due to the libraries you use or you're coding better DXF handling?

Obviously, the problem as described by Raymond West is that OpenSCAD
only implements a subset of the DXF specification and thus fails when a
DXF file using some feature outside of that subset is encountered.
Raymond has provided a couple of concrete examples of such features.

I have written a DXF interpreter from scratch, it is on github. It does
not claim to be perfect or feature complete, but at least it makes an
attempt to implement common entities of the DXF specification relevant
to scenarios such as the above. This is the reason why sometimes
AngelCAD will accept an .scad file that fails in OpenSCAD.

I am sure you will be able to find counter-examples, but the main point
here is that OpenSCAD only implements a subset of the DXF specification.

Carsten Arnholm

On 17.12.2021 07:03, MichaelAtOz wrote: >> For example, an .scad file might try to do: >> linear_extrude(height=100) import("with_splines.dxf"); >> >> This will fail in OpenSCAD, but running the exact same .scad file with >> AngelCAD instead will often work. > > Is that due to the libraries you use or you're coding better DXF handling? Obviously, the problem as described by Raymond West is that OpenSCAD only implements a subset of the DXF specification and thus fails when a DXF file using some feature outside of that subset is encountered. Raymond has provided a couple of concrete examples of such features. I have written a DXF interpreter from scratch, it is on github. It does not claim to be perfect or feature complete, but at least it makes an attempt to implement common entities of the DXF specification relevant to scenarios such as the above. This is the reason why sometimes AngelCAD will accept an .scad file that fails in OpenSCAD. I am sure you will be able to find counter-examples, but the main point here is that OpenSCAD only implements a subset of the DXF specification. Carsten Arnholm