Bug with OCC 7.4.0

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!
User avatar
Zolko
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Bug with OCC 7.4.0

Postby Zolko » Mon Feb 10, 2020 3:10 pm

Hello,

by using FreeCAD really for work, I stumbled upon a real problem: I have been given a STEP file for an assembly, and that assembly contained, among other things, a CAD model of a standard Newport component (HVM-1T), and for which you can download a STEP file:

https://www.newport.com/p/HVM-1t

The original STEP file as provided by Newport works flawlessly, but the one that came with the assembly doesn't. That CAD model I received is an export from some other CAD system from partners, and I don't know what they use, I only got their export, which I couldn't load into FreeCAD, or rather not into the latest FreeCAD 19-pre.

BUT: I could load it with the FreeCAD stable (0.18.4) and also with realthunder's FreeCAD 19-asm3, and also with an old FreeCAD 17. By swithcing between these version I could nail the problem down to the faulty component, which I renamed "BadCompound". I've attached the version info of the FreeCAD versions I tested.

So, what happens:
BadCompound_0.19-pre.png
BadCompound_0.19-pre.png (363.34 KiB) Viewed 383 times


The faulty FreeCAD model HVM-1T_bad.FCStd is attached below. When you open the model, nothing spectacular happens because the faulty solid is hidden. When you try to show the faulty solid, FreeCAD complains that:

Code: Select all

<Part> ViewProviderExt.cpp(1326): Cannot compute Inventor representation for the shape of HVM_1T_bad#Part__Feature155
And when you hit the "Fits the whole content on the screen" button, FreeCAD begins to eat all the memory, then the swap, and finally it is killed by the OOM killer (I think):

Code: Select all

/tmp/.mount_FreeCAB7qVtS/AppRun: line 27: 26209 Killed                  ${MAIN} "$@"

I've tried several older FreeCAD versions, for which you can find the info below, and basically the problem comes from OCC 7.4: everything with 7.3.0 works, with 7.4.0 it doesn't. The switch was done between git #0.19.19107 and #0.19.19180. Coin 4.0.0 or 4.0.0a doesn't make a difference.


***********************************
DOESN'T WORK:
***********************************

FreeCAD_19-pre:

OS: Ubuntu 18.04.3 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19518 (Git) AppImage
Build type: Release
Branch: master
Hash: 16b2b9a864fbf8fcae6af1e38640995fd0fefeaf
Python version: 3.8.1
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)

v0.19.19180:
OS: Ubuntu 18.04.3 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19180 (Git) AppImage
Build type: Release
Branch: master
Hash: 6f52e8425e73693d1242d02dc99a23b63ae36975
Python version: 3.7.6
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.4.0
Locale: English/United Kingdom (en_GB)

***********************************
WORKS:
***********************************

v0.19.19107:
OS: Ubuntu 18.04.3 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.19107 (Git) AppImage
Build type: Release
Branch: master
Hash: ad952191297fe53593c4d4b0ac80b43fd6664b22
Python version: 3.7.6
Qt version: 5.12.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)

FreeCAD_19-asm3:
OS: Ubuntu 18.04.3 LTS (KDE/plasma)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16830 +1496 (Git) AppImage
Build type: Release
Branch: LinkStage3
Hash: 1b29767b545440b7ab93f1a5f2b742d622f1b547
Python version: 3.7.3
Qt version: 5.9.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

FreeCAD_18.4 (stable) :
OS: Ubuntu 18.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.4.
Build type: Release
Python version: 3.6.8
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)

FreeCAD 17:
OS: Ubuntu 18.04.3 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13541 (Git) AppImage
Build type: None
Branch: releases/FreeCAD-0-17
Hash: 9948ee4f1570df9216862a79705afb367b2c6ffb
Python version: 2.7.6
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Attachments
HVM-1T_bad.FCStd
(851.14 KiB) Downloaded 7 times
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
triplus
Posts: 9428
Joined: Mon Dec 12, 2011 4:45 pm

Re: Bug with OCC 7.4.0

Postby triplus » Mon Feb 10, 2020 5:06 pm

If you will use Part_CheckGeometry command, it does indicate issues.
User avatar
Zolko
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Bug with OCC 7.4.0

Postby Zolko » Mon Feb 10, 2020 9:31 pm

triplus wrote:
Mon Feb 10, 2020 5:06 pm
If you will use Part_CheckGeometry command, it does indicate issues.
yes, I've seen that too, but it doesn't say how to solve them. And OCC 7.3.0 does also see the problem, but doesn't crash: it reports the error, and goes on with life.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
tanderson69
Posts: 1531
Joined: Thu Feb 18, 2010 1:07 am

Re: Bug with OCC 7.4.0

Postby tanderson69 » Wed Feb 12, 2020 1:56 am

Zolko wrote:
Mon Feb 10, 2020 3:10 pm
The original STEP file as provided by Newport works flawlessly, but the one that came with the assembly doesn't.
Can you post or provide a link to the problematic step file?
User avatar
Zolko
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Bug with OCC 7.4.0

Postby Zolko » Wed Feb 12, 2020 8:53 am

tanderson69 wrote:
Wed Feb 12, 2020 1:56 am
Can you post or provide a link to the problematic step file?
Thank-you for looking into this, but unfortunately not, because it's BIG (>60MB) and is the design from a professional partner.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
User avatar
Zolko
Posts: 843
Joined: Mon Dec 17, 2018 10:02 am

Re: Bug with OCC 7.4.0

Postby Zolko » Wed Feb 19, 2020 1:54 pm

So, this definitively is an OCC 7.4.0 issue, because looo was nice to produce an AppImage with the latest Git master branch and OCC 7.3.0, and that version opens the buggy file without problems. The Part > Check Geometry tool does find errors in the file, but it can still open and display it correctly.
try the Assembly4 workbench for FreCAD v0.19
install with Tools > Addon Manager > Assembly4 — tutorials here and here
triplus
Posts: 9428
Joined: Mon Dec 12, 2011 4:45 pm

Re: Bug with OCC 7.4.0

Postby triplus » Wed Feb 19, 2020 3:49 pm

In my opinion you have more options. I would start with the file itself. To determine if the corrupt file gets corrupted because of an interoperability issue, or other CAD kernels have issues too. If the file itself is corrupt, make a report to whoever created it to fix it. If it is an interoperability issue, you could use Part Defeaturing to remove the offending face. Obviously, you would change geometry of the part, by doing that. Resulting to such solution often depends on what you plan to do with such part next.

As for reporting the issue to OCCT people. OCCT should fail more gracefully, that much is true. If they need to fix anything else, that depends on the file itself. In the past they required for people to use their tools, when reporting an issues, providing a FCStd file wasn't enough. Don't know if that is still the case. If you can reasonably confirm the file itself is not corrupt, best to try it out and report back.