[Bug] DXF Export not giving proper result

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
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

[Bug] DXF Export not giving proper result

Post by PAS_Drafter »

Code: Select all

OS: Windows 10 Version 2009
Word size of FreeCAD: 64-bit
Version: 0.21.0.31917 (Git)
Build type: Release
Branch: master
Hash: 4639283b459f9ff9093e289908cc003db8745b82
Python 3.10.9, Qt 5.15.6, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.12.5
  * CurvedShapes 1.0.4
  * Curves 0.6.5
  * fasteners 0.4.53
  * sheetmetal 0.2.60

I used to export parts from FreeCAD by selecting the File, Export feature after selecting the part I wanted to export and send it out to DXF with little to no problems. I had been using the Legacy importer and exporter as I seemed to have more luck with it. Occasionally a file would have some "weird" add on lines etc. I learned later that those most likely came from the fact that the FreeCAD legacy doesn't support ellipses and a few other line features.

Ever since I've set up my new computer and attempted to get the DXF working, I seem to have more problems. In order to not run into compatibility issues, I have been trying to transfer over to using the non-legacy version, but I am just not having success. Here is a simple part that I'm trying to export out as a 2D DXF.

Adapter_Before.png
Adapter_Before.png (4.75 KiB) Viewed 642 times

In Preferences, in the Sketcher, Display section, I have the "Restore camera position after editing" unchecked so that I can open the sketch and then close it so that face is then perpendicular to the direction I want to export.

In Preferences, Import-Export, DXF, I have the "Export Drawing Views as blocks" and "Project exported objects along current view direction" checked. I believe this is what I want as I want it to export from the orientation, I left the view from the when I closed my sketch. I currently have the legacy importer and exporter unchecked.

I select the ClevisAdtBody from my tree and then go to File, Export, give it a name, and then select ok to the dialog box. It appears to export okay. However, if I open the part in LibreCAD. I get this.

LibreCAD.png
LibreCAD.png (7.68 KiB) Viewed 642 times

The holes are circles. I think the non-legacy version is suppose to support those anyway.

Anyway, I have a very simple part that doesn't seem to be exporting properly from the file menu.

If I use the legacy exporter, it appears to work correctly.'


LibreCADLegacy.png
LibreCADLegacy.png (7.25 KiB) Viewed 642 times

In most cases, the legacy exporter will work for me. The only places it doesn't work are where I use the unsupported shapes. In those cases, I think I can import them into TechDraw and export from there. I few extra steps, but at least I should be able to keep going.

Can anyone figure out why I'm having problems with the non-legacy though?
Attachments
Clevis_Adapter_Exact.FCStd
(25.31 KiB) Downloaded 14 times
Last edited by PAS_Drafter on Wed Mar 22, 2023 8:02 pm, edited 1 time in total.
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: DXF Export not giving proper result

Post by thomas-neemann »

PAS_Drafter wrote: Tue Mar 21, 2023 11:09 pm ...
if I turn the part into the top level, it works for me
Bildschirmfoto_2023-03-22_08-53-30.png
Bildschirmfoto_2023-03-22_08-53-30.png (12.05 KiB) Viewed 576 times
Bildschirmfoto_2023-03-22_08-53-01.png
Bildschirmfoto_2023-03-22_08-53-01.png (17.9 KiB) Viewed 576 times

Code: Select all

OS: Ubuntu 20.04.1 LTS (XFCE/xubuntu)
Word size of FreeCAD: 64-bit
Version: 0.20.2.29603 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.2)
Hash: 930dd9a76203a3260b1e6256c70c1c3cad8c5cb8
Python 3.10.8, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: German/Germany (de_DE)
Installed mods: 
  * Curves 0.6.8
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: DXF Export not giving proper result

Post by Syres »

thomas-neemann wrote: Wed Mar 22, 2023 7:56 am
PAS_Drafter wrote: Tue Mar 21, 2023 11:09 pm ...
if I turn the part into the top level, it works for me
I'm astounded that the wiki page at no point mentions using X-Y plane if in doubt, that's my first step in any DXF or SVG export.
User avatar
thomas-neemann
Veteran
Posts: 11801
Joined: Wed Jan 22, 2020 6:03 pm
Location: Osnabrück DE 🇩🇪
Contact:

Re: DXF Export not giving proper result

Post by thomas-neemann »

Syres wrote: Wed Mar 22, 2023 11:58 am ...
i find faster and better answers in youtube than in the documentation
Gruß Dipl.-Ing. (FH) Thomas Neemann

https://www.youtube.com/@thomasneemann5 ... ry=freecad
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: DXF Export not giving proper result

Post by PAS_Drafter »

Thanks for providing a work around to get it to work. However, I don't think that is the long-term solution. I find it very limiting if you have to do all of your designing limited to one plane if you want to export the object out as a DXF.

This seems like it is a bug as the export should be able to export from any plane and after searching bugtracker, I did find that it is a known issue.


https://github.com/FreeCAD/FreeCAD/issues/6001


Doesn't look like there has been much activity on it though. At least that explains why the Legacy export still exports from the right perspective.
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: DXF Export not giving proper result

Post by Syres »

PAS_Drafter wrote: Wed Mar 22, 2023 7:58 pm Thanks for providing a work around to get it to work. However, I don't think that is the long-term solution. I find it very limiting if you have to do all of your designing limited to one plane if you want to export the object out as a DXF.
You're quite correct, I suspect my workflow is significantly different to yours.

Imagine all the brackets on an aluminum bicycle frame need to be cut, I would model them all at the global origin in top view, clone however many are needed and 'assemble' the clones. All the originals are put in a Group that can be hidden in one keystroke and made visible one at a time for the export only when the final design has been approved. That's the way I luckily have worked since using FreeCAD but I can fully appreciate that's not how some/most people may think is the best way.
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: [Bug] DXF Export not giving proper result

Post by PAS_Drafter »

You know, another thing I noticed that is odd here is that the plate is exported from the side. However, it seems to try to export the circles and arcs in the right orientation, but they all appear to be centered on one surface or the other. So some components are exporting in the right orientation, just not placed where they are supposed to be.

How do I temporarily change the orientation of a drawing so I can export it?
drmacro
Veteran
Posts: 8865
Joined: Sun Mar 02, 2014 4:35 pm

Re: [Bug] DXF Export not giving proper result

Post by drmacro »

I have not read this thread so maybe this has been discussed already.

There is a setting in Preferences>Import/Export, DXF tab that defines whether to Project exported objects along current view.
Star Trek II: The Wrath of Khan: Spock: "...His pattern indicates two-dimensional thinking."
PAS_Drafter
Posts: 338
Joined: Mon Aug 02, 2021 6:29 am
Location: California, USA

Re: [Bug] DXF Export not giving proper result

Post by PAS_Drafter »

drmacro wrote: Wed Mar 22, 2023 11:49 pm I have not read this thread so maybe this has been discussed already.

There is a setting in Preferences>Import/Export, DXF tab that defines whether to Project exported objects along current view.
Yep, I've played with that. Apparently there is a bug in the non-legacy dxf exporter where that setting no longer works. It usually works in legacy export though.

For some reason, I am having A LOT of problems trying to export parts lately. In the past with v.19, it seemed to always work pretty smoothly. I'd have a hiccup or two occasionally which I believe I've learned is because the legacy export doesn't support ellipses. However in v21 I've been having a lot of projection issues where lines get exported over the top of each other. When it gets imported into our plasma table software the extra lines are causing the plasma to double over paths which doesn't work so it screws up the piece.

The only way I can catch those problems is to import each part I export into another program and select each edge, delete it, and then see if there is another one below it. Madening.
Post Reply