how to export 2D dxf from a 3D design?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
Guest

how to export 2D dxf from a 3D design?

Post by Guest »

Hi all,
a big thank you to all contributers for this professional piece of work!

I designed a 3D object built entirely out of interlocked sheets of thin plywood and would like to export 2D dxf to production for each sheet seperately.
I found three ways to do this but can not get them to work as I need:

1. create a drawing and export as svg. Convert to dxf in inkscape. Works fine but tesselation of round objects is to rough. Can it be adjusted somewhere?

2. select a 3D object. downgrade. select the relevant face. export to dxf directly via file menu. Something is exported, but geometry is usually broken.

3. downgrade face from (2) until it gets a wire. holes (cut outs) in surfaces are lost.

Did I miss something important?
Should I just export 3D data of thin plywood to production? Which format would be best?

Thanks
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: how to export 2D dxf from a 3D design?

Post by yorik »

Hi,
Indeed formatting 3D data to 2D is a big topic.
The "official" way being developed with FreeCAD would be to use the drawing module, to generate an svg drawing of your 3D content. It already works quite well, but still lacks functionality. Basically you can create a default page, and insert "views" of your 3D objects in it, and configure scale, position, orientation, etc. At the moment you still don't have much control over things like linewidth, etc, you cannot do more complex stuff like sections, etc... But the idea is to get there some day. Your post makes me think it would be useful to be able to export that svg sheet directly to dxf... I'll add a feature request.

Currently you have to use some "tricks" like you tried, I think the best way would indeed be to separate/downgrade your object into flat components and export it to dxf. To reply your questions:

1. the tesselation occuring in svg documents I hadn't seen before... Did you use the drawing module or just did export->svg directly from the standard 3D view? You can change the tesselation value in the preferences (Preferences->Part Design->Shape View->Max deviation). This will affect how your curves appear on screen but I'm not sure if it will affect svg output.

2. the dxf export is made mostly for 2D work. It works fine with flat, horizontal objects, not too well with non-flat 3D objects. But if you have flat objects that don't get exported correctly, it's probably a bug. If you can attach an example, I might be able to solve it.

3. downgrading an object with a hole indeed looses the hole, it's a bug, I'll fix it ASAP.

Cheers
Yorik
magerbeton
Posts: 1
Joined: Thu Oct 14, 2010 1:05 pm

Re: how to export 2D dxf from a 3D design?

Post by magerbeton »

Hi Yorik,

thanks for your fast and precise reply.

As for the tesselation problem I use the drawing module. The problem is easily visible when a cylinder with 2mm radius is created and a view from top is made: it has 12 corners. A bigger radius means more corners. Preferences->Part Design->Shape View->Max deviation affects the visualization but unfortunately not the svn export. Since the module is young and big things are planned to come it is already a good start -very usable for creating drawings for the workshop but not perfect yet.

The second method, the downgrade of a 3D object seems a nice alternative. The problem with broken geometry export is easily reproduced:
create a cube, downgrade, take face4 (the face in x-y with offset 0), export to dxf. Open the dxf file - voila - a triangle. The other faces do not export correctly neither.
It seems (after quite a few experiments) that the last or first point of each geometric primitive beeing part of such a face is lost.
Geometry drawn with the drafting module in xy plane and exported to dxf is exported all right. It seems that 2D-geometry created in 2D and 2D-geometry ceated as 3D object and downgraded to 2D differ internally.

Any help would be appreciated but there is still the alternative to send 3D data to production...

I am using Revision 3308 Build 2010/7/12 under windows downloaded as windows installer a few weeks ago.

Cheers,

Georg
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: how to export 2D dxf from a 3D design?

Post by yorik »

Hm I see... Indeed there is a bug in the dxf export function... I'll fix that too when I have a minute.
I'm afraid you'll need to wait for Jürgen to build a new windows version after that, but it shouldn't take long, he does it pretty often.
Thanks for reporting the problems!
Yorik
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: how to export 2D dxf from a 3D design?

Post by wmayer »

1. create a drawing and export as svg. Convert to dxf in inkscape. Works fine but tesselation of round objects is to rough. Can it be adjusted somewhere?
1. the tesselation occuring in svg documents I hadn't seen before... Did you use the drawing module or just did export->svg directly from the standard 3D view? You can change the tesselation value in the preferences (Preferences->Part Design->Shape View->Max deviation). This will affect how your curves appear on screen but I'm not sure if it will affect svg output.
This is a very good point. The deviation parameter in the preferences only affects the visualization of the 3d shapes it has absolutely no effect on the svg output because there internally we use a fix value of 0.1.
Thinking about that I think we should detect the real underlying geometry of an edge e.g. line, circle, ... and its parametrization and then convert it directly to the according svg entity. This way we could create a precise conversion to svg. The tessellation then only needs to be used as fallback solution in case something fails.
wmayer
Founder
Posts: 20319
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: how to export 2D dxf from a 3D design?

Post by wmayer »

Thinking about that I think we should detect the real underlying geometry of an edge e.g. line, circle
I have implemented this for circle and arc of circle and the result is perfectly looking.
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: how to export 2D dxf from a 3D design?

Post by yorik »

I solved the dxf export problems too. Faces now export correctly, as far as I've tested, and faces with holes inside are exported correctly (I decided to export them as blocks)
Post Reply