diff --git a/src/BRepFill/BRepFill_Filling.cxx b/src/BRepFill/BRepFill_Filling.cxx index d14fc3d81d..3a8ff73d3a 100644 --- a/src/BRepFill/BRepFill_Filling.cxx +++ b/src/BRepFill/BRepFill_Filling.cxx @@ -479,11 +479,20 @@ void BRepFill_Filling::FindExtremitiesOfHoles(const TopTools_ListOfShape& WireLi theWire = TopoDS::Wire(WireSeq(1)); WireSeq.Remove(1); - if (theWire.Closed()) + if (BRep_Tool::IsClosed(theWire)) return; TopoDS_Vertex Vfirst, Vlast; TopExp::Vertices( theWire, Vfirst, Vlast ); + + if (Vfirst.IsSame(Vlast)) + { + // The Wire is closed indeed despite its + // being not detected earlier. + + return; + } + gp_Vec FinVec = MakeFinVec( theWire, Vlast ); TopoDS_Vertex theVertex = Vlast; VerSeq.Append( Vlast ); diff --git a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx index 80e41859c6..492674a630 100644 --- a/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx +++ b/src/GeomPlate/GeomPlate_BuildPlateSurface.cxx @@ -474,8 +474,14 @@ void GeomPlate_BuildPlateSurface::Perform() NTPntCont = myPntCont->Length(), NbBoucle=0; // La variable NTPoint peut etre enlevee Standard_Boolean Fini=Standard_True; - if ((NTLinCont+NTPntCont)==0) - Standard_RangeError::Raise("GeomPlate : The number of constraints is null."); + if ((NTLinCont + NTPntCont) == 0) + { +#ifdef OCCT_DEBUG + cout << "WARNING : GeomPlate : The number of constraints is null." << endl; +#endif + + return; + } //====================================================================== // Surface Initiale @@ -504,6 +510,11 @@ void GeomPlate_BuildPlateSurface::Perform() } } + if (mySurfInit.IsNull()) + { + return; + } + Standard_Real u1,v1,u2,v2; mySurfInit->Bounds(u1,v1,u2,v2); GeomAdaptor_Surface aSurfInit(mySurfInit); @@ -647,9 +658,16 @@ void GeomPlate_BuildPlateSurface::Perform() //Resolution de la surface //==================================================================== myPlate.SolveTI(myDegree, ComputeAnisotropie()); - if (!myPlate.IsDone()) - Standard_Failure::Raise("GeomPlate : abort calcul of Plate."); - myGeomPlateSurface = new GeomPlate_Surface(mySurfInit,myPlate); + if (!myPlate.IsDone()) + { +#ifdef OCCT_DEBUG + cout << "WARNING : GeomPlate : abort calcul of Plate." << endl; +#endif + + return; + } + + myGeomPlateSurface = new GeomPlate_Surface(mySurfInit,myPlate); Standard_Real Umin,Umax,Vmin,Vmax; myPlate.UVBox(Umin,Umax,Vmin,Vmax); myGeomPlateSurface->SetBounds(Umin,Umax,Vmin,Vmax); @@ -674,9 +692,15 @@ void GeomPlate_BuildPlateSurface::Perform() //Resolution de la surface //==================================================================== myPlate.SolveTI(myDegree, ComputeAnisotropie()); - if (!myPlate.IsDone()) - Standard_Failure::Raise("GeomPlate : abort calcul of Plate."); - myGeomPlateSurface = new GeomPlate_Surface(mySurfInit,myPlate); + if (!myPlate.IsDone()) + { +#ifdef OCCT_DEBUG + cout << "WARNING : GeomPlate : abort calcul of Plate." << endl; +#endif + return; + } + + myGeomPlateSurface = new GeomPlate_Surface(mySurfInit,myPlate); Standard_Real Umin,Umax,Vmin,Vmax; myPlate.UVBox(Umin,Umax,Vmin,Vmax); myGeomPlateSurface->SetBounds(Umin,Umax,Vmin,Vmax); @@ -1550,7 +1574,14 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit() if (!CourbeJoint) myNbBounds = 0; GeomPlate_BuildAveragePlane BAP( Pts, NbPoint*myNbBounds, myTol3d/1000, popt, nopt ); - if (!BAP.IsPlane()) Standard_Failure::Raise("the initial surface is not a plane."); + if (!BAP.IsPlane()) + { +#ifdef OCCT_DEBUG + cout << "WARNING : GeomPlate : the initial surface is not a plane." << endl; +#endif + + return; + } Standard_Real u1,u2,v1,v2; BAP.MinMaxBox(u1,u2,v1,v2); // On agrandit le bazar pour les projections @@ -1688,8 +1719,13 @@ void GeomPlate_BuildPlateSurface::ComputeSurfInit() //Resolution de la surface //==================================================================== myPlate.SolveTI(2, ComputeAnisotropie()); - if (!myPlate.IsDone()) - Standard_Failure::Raise("GeomPlate : abort calcul of Plate."); + if (!myPlate.IsDone()) + { +#ifdef OCCT_DEBUG + cout << "WARNING : GeomPlate : abort calcul of Plate." << endl; +#endif + return; + } myGeomPlateSurface = new GeomPlate_Surface( mySurfInit, myPlate ); diff --git a/src/QABugs/QABugs_11.cxx b/src/QABugs/QABugs_11.cxx index a746d1ea5e..fc6890bb7f 100644 --- a/src/QABugs/QABugs_11.cxx +++ b/src/QABugs/QABugs_11.cxx @@ -1419,16 +1419,18 @@ static Standard_Integer OCC524 (Draw_Interpretor& di, Standard_Integer argc, con //======================================================================= static Standard_Integer OCC525(Draw_Interpretor& di, Standard_Integer /*argc*/, const char ** /*argv*/) { - try - { - OCC_CATCH_SIGNALS - GeomPlate_BuildPlateSurface aBuilder; - aBuilder.Perform(); - } - catch (Standard_RangeError) { di << "OCC525 Exception \n" ;return 0; } - //catch (...) { di << "OCC525 Exception \n" ;return 0; } + GeomPlate_BuildPlateSurface aBuilder; + aBuilder.Perform(); + + if (aBuilder.IsDone()) + { + di << "Error in OCC525. Null result is expected.\n"; + } + else + { + di << "OCC525 OK \n"; + } - di << "OCC525 OK \n"; return 0; } diff --git a/tests/bugs/modalg_6/bug27873 b/tests/bugs/modalg_6/bug27873 new file mode 100644 index 0000000000..941fae669e --- /dev/null +++ b/tests/bugs/modalg_6/bug27873 @@ -0,0 +1,18 @@ +puts "============" +puts "OCC27873" +puts "============" +puts "" +###################################################### +# Exception is raised in BRepFill_Filling::FindExtremitiesOfHoles() +###################################################### + +# Input data are true invalid. +# 1. Non-manifold wire; +# 2. The wire contains internal edge in its boundary (i.e. if we remove this edge we will obtain not-closed wire). + +restore [locate_data_file bug27873_filling.brep] a +explode a + +if { ![regexp {filling failed} [filling result 11 0 0 a_1 0 a_2 0 a_3 0 a_4 0 a_5 0 a_6 0 a_7 0 a_8 0 a_9 0 a_10 0 a_11 0] ] } { + puts "Error: Null result is expected but is not returned." +} diff --git a/tests/bugs/moddata_2/bug525 b/tests/bugs/moddata_2/bug525 index f9ab7e5a94..ccf98679a3 100755 --- a/tests/bugs/moddata_2/bug525 +++ b/tests/bugs/moddata_2/bug525 @@ -1,4 +1,4 @@ -puts "REQUIRED All: OCC525 Exception" +puts "REQUIRED All: Error in OCC525. Null result is expected." pload QAcommands diff --git a/tests/bugs/step/bug11856 b/tests/bugs/step/bug11856 index 4aa23372bf..3c6e6dea2d 100755 --- a/tests/bugs/step/bug11856 +++ b/tests/bugs/step/bug11856 @@ -1,4 +1,3 @@ - puts "============" puts "OCC11856" puts "============" @@ -13,7 +12,7 @@ stepread [locate_data_file OCC11856.stp] a * tpcompound result -checkprops result -s 611185 -eps 0.1 +checkprops result -s 653034 checkshape result checknbshapes result -vertex 684 -edge 1222 -wire 519 -face 512 -shell 1 -solid 1 -compsolid 0 -compound 1 -shape 2940 checkview -display result -2d -path ${imagedir}/${test_image}.png