Problems exporting DXF

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Bac
Posts: 4
Joined: Fri Oct 23, 2020 12:15 am

Problems exporting DXF

Post by Bac »

Hi,

I am new to FC, trying to use it to export a DXF file for a 2D mask. (Looks very powerful, though a bit unstable and little doc).
I managed to import either a 2D .CSG file created with OpenSCAD, or a 3D .STL file (after extruding the mask in OpenSCAD.

But it appear impossible to export a DXF file from FreeCAD.
The "Allow FreeCAD to automatically download and update the DXF libraries" seems to be ineffective.
Manual upload from the AddOn manager is sketchy and does not find either "DXF libraries" or a "Draft-DXF-importer" module.
Finally I managed to download, unzip and copy these files into my /user/.Library/Preferences/FreeCAD folder, which seems to be found but now I obtain Invalid syntax (dxfReader.py, line 88)

Any good advice how I might succeed?

Thanks, BAc
Screen Shot 2020-10-22 at 5.00.44 PM.png
Screen Shot 2020-10-22 at 5.00.44 PM.png (146.72 KiB) Viewed 847 times
WG mask SiO2 2D 20-10-22.FCStd
(452.91 KiB) Downloaded 19 times
OS: macOS 10.15
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.16146 (Git)
Build type: Release
Branch: (HEAD detached at 0.18.4)
Hash: 980bf9060e28555fecd9e3462f68ca74007b70f8
Python version: 3.6.7
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedStates (en_US)
chrisb
Veteran
Posts: 54192
Joined: Tue Mar 17, 2015 9:14 am

Re: Problems exporting DXF

Post by chrisb »

Hi and welcome to the forum!

Please try 0.19.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Bac
Posts: 4
Joined: Fri Oct 23, 2020 12:15 am

Re: Problems exporting DXF

Post by Bac »

Thanks Chrisb,

The version I installed is the latest version I could find, called V 0.19pre, which is the 0.18.16146.
Can you recommend a site with a version 0.19 for Mac OS?

Will I need the legacy DXF library or will it find it, and does that fix the error 88?

Thanks, BAc
chrisb
Veteran
Posts: 54192
Joined: Tue Mar 17, 2015 9:14 am

Re: Problems exporting DXF

Post by chrisb »

You find the latest 0.19 here: https://github.com/FreeCAD/FreeCAD/rele ... g/0.19_pre. It has the number 0.19.22756. I highly recommend it, especially on MacOS, where it is more stable and has less errors.
I don't know if it will fix your error, but if it persists it will not be fixed in 0.18 anyway.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Bac
Posts: 4
Joined: Fri Oct 23, 2020 12:15 am

Re: Problems exporting DXF

Post by Bac »

Hi ChrisB,

thanks, looks like big progress and a much more stable version!

I was able to import my DXF file (though it took minutes to import 12000 lines), but unfortunately, they are represented as 12000 individual, disconnected line segments, so not much use for generating a 2D mask. (This may be an OpenSCAD export to DXF problem, though on reimport OpenSCAD shows polygons correctly),

I was able to export something as well, though given all the options on legacy DXF library of new C++ library and all import/export options I am not sure if there may be a way to join coinciding segments and plot polygons instead.

I am giving up on this path, but good luck for the improved FreeCAD release.

Best, BAc
chrisb
Veteran
Posts: 54192
Joined: Tue Mar 17, 2015 9:14 am

Re: Problems exporting DXF

Post by chrisb »

Bac wrote: Sun Oct 25, 2020 1:45 am I was able to import my DXF file (though it took minutes to import 12000 lines), but unfortunately, they are represented as 12000 individual, disconnected line segments, so not much use for generating a 2D mask.
Try checking Preferences->Import-Export->DXF->Join geometry.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Bac
Posts: 4
Joined: Fri Oct 23, 2020 12:15 am

Re: Problems exporting DXF

Post by Bac »

Thanks ChrisB,
this seems to work, provided I import with Yorik's legacy DXF library, which also provides a nice log:

13:54:41 opening /Users/brula/../WG SiO2 pos mask 20-10-24.dxf...
13:54:41 drawing 11876 lines...
13:54:41 Joining geometry...
13:54:41 11876 edges to join
13:55:11 skipping texts...
13:55:11 skipping dimensions...
13:55:11 skipping points...
13:55:11 skipping leaders...
13:55:11 skipping hatches...
13:55:11 skipping *blocks...
13:55:11 done processing
13:55:11 recompute done
13:55:11 successfully imported /Users/brula/../WG SiO2 pos mask 20-10-24.dxf
13:59:51 successfully exported /Users/brula/../FC > WG SiO2 pos mask 20-10-24.dxf

Not sure about the 3 output options though. Export as objects polyface meshes, draw view as blocks and project along view direction? Exporting meshes with the legacy library gives a 139kb dxf file that does not open in AutoCAD e-drawings, but the new C++ library exports a 1.6Mb file that does open, but I cannot see if polygons are filled.
Post Reply