Importing DXF Files

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

Importing DXF Files

Dave Coventry
Hi,

I've just discovered Openscad and I feel that it may be quite usefuil to me.

Currently I have a number of 3D models (in DXF, mostly with 3DFACE
objects) which I sometimes manipulate in Blender, but which may be
easier to manipulate in Openscad.

However, I don't see any mechanism whereby I could import my models.

Using the "Export as DXF" menu function fails on the example001.scad
file with the following error:

"Current top level object is not a 2D object."

Am I being realistic here, or is the software not equipped to handle this?

Kind Regards,

Dave Coventry

Reply | Threaded
Open this post in threaded view
|

Re: Importing DXF Files

Whosawhatsis
OpenSCAD can only handle 2D DXF files. To import/export 3D files, you need to use STL format.

On Saturday, June 2, 2012 at 5:08 AM, Dave Coventry wrote:

Hi,

I've just discovered Openscad and I feel that it may be quite usefuil to me.

Currently I have a number of 3D models (in DXF, mostly with 3DFACE
objects) which I sometimes manipulate in Blender, but which may be
easier to manipulate in Openscad.

However, I don't see any mechanism whereby I could import my models.

Using the "Export as DXF" menu function fails on the example001.scad
file with the following error:

"Current top level object is not a 2D object."

Am I being realistic here, or is the software not equipped to handle this?

Kind Regards,

Dave Coventry
_______________________________________________
OpenSCAD mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Importing DXF Files

Alan Cox
In reply to this post by Dave Coventry
On Sat, 2 Jun 2012 14:08:00 +0200
Dave Coventry <[hidden email]> wrote:

> Hi,
>
> I've just discovered Openscad and I feel that it may be quite usefuil to me.
>
> Currently I have a number of 3D models (in DXF, mostly with 3DFACE
> objects) which I sometimes manipulate in Blender, but which may be
> easier to manipulate in Openscad.
>
> However, I don't see any mechanism whereby I could import my models.
>
> Using the "Export as DXF" menu function fails on the example001.scad
> file with the following error:
>
> "Current top level object is not a 2D object."
>
> Am I being realistic here, or is the software not equipped to handle this?

Load it into Blender, export it as stl and then you may be able to use it
as an object in OpenScad .. may being the operative word as I've found
the STL import incredibly flaky.

I don't know if any of the related apps like ImplicitCad are any better
at this.

Alan

Reply | Threaded
Open this post in threaded view
|

Re: Importing DXF Files

Triffid Hunter
On Sun, Jun 3, 2012 at 1:06 AM, Alan Cox <[hidden email]> wrote:
Load it into Blender, export it as stl and then you may be able to use it
as an object in OpenScad .. may being the operative word as I've found
the STL import incredibly flaky.

fwiw I've found that the STL import works perfectly for me every time.

The problems start when the imported STL is not manifold, in which case openscad finds itself quite unable to /export/ but this is not openscad's fault, it was never designed to handle non-manifold meshes.
Reply | Threaded
Open this post in threaded view
|

Re: Importing DXF Files

Dave Coventry
If I have two pieces of mild steel channel, say 160x65 mm, which are
comprised entirely of 3DFACES, would OpenScad be able to trim them to
a 90 degree joint so that the channels butt together at 45 degrees?

In other words, each of the pieces are trimmed at 45 degrees, so that
they butt together at 90 degrees.

I'm pretty sure that I could write a simple script to convert DXF
3DFACES into the scad format.

Could I:
a) extend/trim the 3DFACES and
b) export the resultant joint into a DXF file?

Reply | Threaded
Open this post in threaded view
|

Re: Importing DXF Files

Whosawhatsis
That sounds like an easy operation if you get the data into OpenSCAD, but OpenSCAD can only export 3d data in STL format. OpenSCAD's DXF support is 2D-only.

On Sunday, June 3, 2012 at 1:59 AM, Dave Coventry wrote:

If I have two pieces of mild steel channel, say 160x65 mm, which are
comprised entirely of 3DFACES, would OpenScad be able to trim them to
a 90 degree joint so that the channels butt together at 45 degrees?

In other words, each of the pieces are trimmed at 45 degrees, so that
they butt together at 90 degrees.

I'm pretty sure that I could write a simple script to convert DXF
3DFACES into the scad format.

Could I:
a) extend/trim the 3DFACES and
b) export the resultant joint into a DXF file?
_______________________________________________
OpenSCAD mailing list

Reply | Threaded
Open this post in threaded view
|

Re: Importing DXF Files

Alan Cox
In reply to this post by Triffid Hunter
> The problems start when the imported STL is not manifold, in which case
> openscad finds itself quite unable to /export/ but this is not openscad's
> fault, it was never designed to handle non-manifold meshes.

These were valid manifold meshes that were *produced* by OpenSCAD. It
seems OpenSCAD can't properly handle sharp edges in an STL file (or CGL
can't)

Alan

Reply | Threaded
Open this post in threaded view
|

Re: Importing DXF Files

Triffid Hunter
On Sun, Jun 3, 2012 at 9:39 PM, Alan Cox <[hidden email]> wrote:
These were valid manifold meshes that were *produced* by OpenSCAD. It
seems OpenSCAD can't properly handle sharp edges in an STL file (or CGL
can't)

It's unfortunately far too easy to get openscad to generate non-manifold meshes :(

even something as simple as union() { cube([50, 10, 10]); translate([0, 5, 0]) cylinder(r=5, h=10); } has the potential to be non-manifold due to the intersecting edges and tangents and things