Hi!
I made the attached DXF file with FreeCAD, using the Draft-WB method suggested in the Wiki (Face -> Shape2DView -> DXF). Everything seems to be actually fine with the export, but the FreeCAD default import reads the file incorrectly, with the circular arcs interpreted as full circles. I tried the file with Python FreeCAD legacy DXF importer, LibreCAD, and IrfanView, which all read the file correctly, which leads me to conclude that the problem lies with the FreeCAD default DXF import.
FreeCAD C++ DXF import (the default one):
FreeCAD Python DXF legacy import:
LibreCAD:
IrfanView:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)
[BUG?] Problem with the default C++ DXF import function
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
[BUG?] Problem with the default C++ DXF import function
- Attachments
-
- Lifting_hook_plate_05.dxf
- (10.42 KiB) Downloaded 16 times
Re: [BUG?] Problem with the default C++ DXF import function
Works correctly for me in both the Conda version and the Libpack version.
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
[Edit] I never import DXF files, so I used whatever happens when I select "Import" from the file menu.
Gene
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.8.5
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United States (en_US)
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.22284 (Git)
Build type: Release
Branch: master
Hash: bf1e8e48389f5e9e25bd77b67fe98da4213e797c
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United States (en_US)
[Edit] I never import DXF files, so I used whatever happens when I select "Import" from the file menu.
Gene
Re: [BUG?] Problem with the default C++ DXF import function
I can confirm that with the C++ importer, it doesn't work well.
I also get this message.
Code: Select all
<Part> ViewProviderExt.cpp(1332): Cannot compute Inventor representation for the shape of Lifting_hook_plate_05#Ellipse
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Re: [BUG?] Problem with the default C++ DXF import function
Thanks for testing! Interesting, we seem to have exactly the same FreeCAD version, even the version hash code is the same; but still different end result. The other weird thing is that I made a few very similar DFX parts, and I only have the import problem with this particular number 05 part. Every other part imports fine, oddly enough. Maybe it's something in my DXF preferences? Here's a screenshot of my preferences window.
Re: [BUG?] Problem with the default C++ DXF import function
Thank for testing this, too! Interesting, I don't get anything in the report view window. I wonder where the "Ellipse" in your error message comes from, there should only be circular arcs in the file. If I've understood correctly, one should always avoid ellipses with FreeCAD DXF, because they are not fully supported.vocx wrote: ↑Mon Aug 24, 2020 3:25 pm I can confirm that with the C++ importer, it doesn't work well.
I also get this message.Code: Select all
<Part> ViewProviderExt.cpp(1332): Cannot compute Inventor representation for the shape of Lifting_hook_plate_05#Ellipse
Aaannd... Looking inside the offending 05 DXF file with a text editor there sure are "ELLIPSE" commands there for some reason. The other files that have only circles and circular arcs import completely fine. It seems that the 05 file contains elliptic arcs that are shaped like circle segments, circles are special cases of ellipses I guess. I wonder why the FreeCAD DXF export on this particular file triggered ellipses, when the other files were fine. We may never find out, but this explains why the file imports fine with programs fully supporting DXF ellipses!
Re: [BUG?] Problem with the default C++ DXF import function
Moved to help forum.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Re: [BUG?] Problem with the default C++ DXF import function
I went back and looked at the Preferences. My configuration has the "Use Python" checked. (Must be default, because I am sure I never changed it.) When I unchecked that box the import looked just like your original image.
It looks like the C++ / Python difference is the cause.
Gene
Re: [BUG?] Problem with the default C++ DXF import function
No, it's not only the configuration option. I naturally already tested with and without this configuration option, and there's no difference between the output files; provided that the view direction is perfectly perpendicular to the face (I used the default views by number "1", "2", "3", etc. shortcuts, as always.
However, I did find out how to trigger the export bug: If you make the Draft->Shape2DView projection step the body face upside-down (I originally made the part 05 Shape2DView so that the navigation cube had the word "BOTTOM" upside down), then the resulting Shape2DView object always produces ellipses when exported. It seems that the accuracy of the navigation on Shape2DView step was not good enough, and the arcs were not perfect circles. I don't understand how this happens, though, because I imagined that the navicube perpendicular directions would be perfectly perpendicular, but apparently not.
I attached my test file, where there is an example of a failed Shape2Dview.
- Attachments
-
- 20200824_FreeCAD_DXF_export_import_bug.FCStd
- (19.7 KiB) Downloaded 11 times