STEP file protocol

Hello everybody,

please does someone have any clue on how to prevent crash of OCC when the input STEP file has not a protocol compatible with the STEP import feature of OCC ?

I am using a "STEPCAFControl_Reader" object, with "Transfer" method that may crash depending on the protocol of the STEP file. I do not succeed in detecting this protocol: I tried to use "STEPConstruct_ExternRefs", I also tried to analyze the shapes transfered, to protect this part of the code in a try-catch. Nothing allows avoiding the crash...

Please I need your help to figure out this unfriendly behaviour !
Thank you very much

Benjamin Bihler's picture

Hi!

I guess, you should submit a bug report together with the STEP file that leads to the crash. See Developer Corner->Open Source community on the OCC site.

Benjamin

thomas's picture

Thank you for your advise, I will !

But in a general way, do you know how to check the STEP protocol before trying to load the STEP file that obviously may crash !

Benjamin Bihler's picture

I have never found a STEP file that caused a crash. All my STEP files have been created with CATIA or FreeCAD.

thomas's picture

This file attached comes from the web, provided as STEP file sample for the protocol 227. When loading the file, no problem with "Readfile", but "Transfer" crashs without exception.

Attachments: 
Forum supervisor's picture

Dear Thomas,

We confirm the crash during reading of this STEP file in OCCT 6.9.1.
This bug is now registered in our public Mantis tracker - see http://tracker.dev.opencascade.org/view.php?id=26461.
You might also register bugs yourself, as explained on our dedicated portal at http://dev.opencascade.org/.

Best regards,
Forum supervisor

thomas's picture

Dear supervisor,

Thank you for taking into account my feedback.
However could you give me the way, or a trick, to detect the STEP protocol before trying to load the file in order to improve the stability of the STEP loader included in our software.

Thanks in advance,
Kind regards
Jc thomas

Forum supervisor's picture

Hello M Thomas,

One possible way to avoid translation of unknown schema entities is to check the STEP file header.
In Draw Test Harness, you can dump this information after reading a STEP file into a model (without translation):

# Load all commands
pload ALL
# Read STEP file
stepread test_ap227.stp a
# Dump header data
data g

In your code, you might use the method StepData_StepModel::Header(), for example, to obtain header entities.

Should you need our continuous help, including such kind of advice or debug of blocking problems, please contact us at http://www.opencascade.com/contact/ for an offer.

Best regards,
Forum supervisor