mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0025699: Crash while importing STeP file
1) Try-catch block was added on a StepToTopoDS_TranslateEdgeLoop::Init() to catch Standard_ConstructionError during the Curve conversion. 2) Checks of BSpline curve degree added to prevent construction error when converting edges to BSpline_Curve. 3) Warning message was added in case of incorrect curve definition. Correct of the test cases according to the new error message added with fix Conflicts: tests/de/step_1/R9 Modified test cases according to new reference data
This commit is contained in:
@@ -89,6 +89,7 @@
|
||||
#include <XSAlgo.hxx>
|
||||
#include <XSAlgo_AlgoContainer.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_ErrorHandler.hxx>
|
||||
|
||||
// ============================================================================
|
||||
// Method : RemoveSinglePCurve
|
||||
@@ -319,10 +320,24 @@ void StepToTopoDS_TranslateEdgeLoop::Init(const Handle(StepShape_FaceBound)& Fac
|
||||
// }
|
||||
Handle(Geom_Curve) C1;
|
||||
if (!C.IsNull()) {
|
||||
C1 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C));
|
||||
if (C1.IsNull()) {
|
||||
if (StepToGeom_MakeCurve::Convert(C,C1))
|
||||
TP->BindTransient (C,C1);
|
||||
try
|
||||
{
|
||||
OCC_CATCH_SIGNALS
|
||||
C1 = Handle(Geom_Curve)::DownCast (TP->FindTransient(C));
|
||||
if (C1.IsNull()) {
|
||||
if (StepToGeom_MakeCurve::Convert(C,C1))
|
||||
TP->BindTransient (C,C1);
|
||||
else
|
||||
TP->AddWarning(C,"Could not convert a curve. Curve definition is incorrect");
|
||||
}
|
||||
}
|
||||
catch (Standard_Failure)
|
||||
{
|
||||
TP->AddFail(C,"Exeption was raised. Curve geometry definition is incorrect");
|
||||
#ifdef OCCT_DEBUG
|
||||
cout << "Warning: StepToTopoDS_TranslateEdgeLoop: Exception: ";
|
||||
Standard_Failure::Caught()->Print(cout); cout << endl;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user