From 0da4579283423348aaea98f5d7e5330de8189bbd Mon Sep 17 00:00:00 2001 From: pkv Date: Fri, 21 Nov 2014 13:58:02 +0300 Subject: [PATCH] 0025456: BOPAlgo_CheckerSI reports an error on the given shape Changes: 1. class IntTools_FaceFace method: void IntTools_FaceFace::MakeCurve(const Standard_Integer Index, const Handle(Adaptor3d_TopolTool)& dom1, const Handle(Adaptor3d_TopolTool)& dom2) The value of testing parameter has been changed for the cases of infinite curves Test case for issue CR25456 --- src/IntTools/IntTools_FaceFace.cxx | 37 +++++++++++++++--------------- tests/bugs/modalg_5/bug25456 | 17 ++++++++++++++ 2 files changed, 36 insertions(+), 18 deletions(-) create mode 100755 tests/bugs/modalg_5/bug25456 diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index 72ebfebac4..2f658e4e0a 100644 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -1243,10 +1243,9 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1, return; } } + // // Do the Curve - - - typl=L->ArcType(); + // switch (typl) { //######################################## // Line, Parabola, Hyperbola @@ -1276,10 +1275,14 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1, // aNbParts=myLConstruct.NbParts(); for (i=1; i<=aNbParts; i++) { + Standard_Boolean bFNIt, bLPIt; + // myLConstruct.Part(i, fprm, lprm); - - if (!Precision::IsNegativeInfinite(fprm) && - !Precision::IsPositiveInfinite(lprm)) { + // + bFNIt=Precision::IsNegativeInfinite(fprm); + bLPIt=Precision::IsPositiveInfinite(lprm); + // + if (!bFNIt && !bLPIt) { // IntTools_Curve aCurve; // @@ -1309,7 +1312,7 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1, // aCurve.SetFirstCurve2d(H1); } - + // if(myApprox2) { Handle (Geom2d_Curve) C2d; BuildPCurves(fprm,lprm,Tolpc,myHS2->ChangeSurface().Surface(),newc,C2d); @@ -1325,25 +1328,24 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1, aCurve.SetSecondCurve2d(H1); } mySeqOfCurve.Append(aCurve); - } // end of if (!Precision::IsNegativeInfinite(fprm) && !Precision::IsPositiveInfinite(lprm)) + } //if (!bFNIt && !bLPIt) { else { // on regarde si on garde // - Standard_Boolean bFNIt, bLPIt; Standard_Real aTestPrm, dT=100.; - - bFNIt=Precision::IsNegativeInfinite(fprm); - bLPIt=Precision::IsPositiveInfinite(lprm); - + // aTestPrm=0.; - if (bFNIt && !bLPIt) { aTestPrm=lprm-dT; } else if (!bFNIt && bLPIt) { aTestPrm=fprm+dT; } - + else { + // i.e, if (bFNIt && bLPIt) + aTestPrm=IntTools_Tools::IntermediatePoint(-dT, dT); + } + // gp_Pnt ptref(newc->Value(aTestPrm)); // GeomAbs_SurfaceType typS1 = myHS1->GetType(); @@ -1353,8 +1355,7 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1, typS1 == GeomAbs_SurfaceOfRevolution || typS2 == GeomAbs_SurfaceOfExtrusion || typS2 == GeomAbs_OffsetSurface || - typS2 == GeomAbs_SurfaceOfRevolution) - { + typS2 == GeomAbs_SurfaceOfRevolution) { Handle(Geom2d_BSplineCurve) H1; mySeqOfCurve.Append(IntTools_Curve(newc, H1, H1)); continue; @@ -1373,7 +1374,7 @@ static Standard_Boolean isTreatAnalityc(const TopoDS_Face& theF1, mySeqOfCurve.Append(IntTools_Curve(newc, H1, H1)); } } - }// end of for (i=1; i<=myLConstruct.NbParts(); i++) + }// for (i=1; i<=aNbParts; i++) { }// case IntPatch_Lin: case IntPatch_Parabola: case IntPatch_Hyperbola: break; diff --git a/tests/bugs/modalg_5/bug25456 b/tests/bugs/modalg_5/bug25456 new file mode 100755 index 0000000000..278aa03598 --- /dev/null +++ b/tests/bugs/modalg_5/bug25456 @@ -0,0 +1,17 @@ +puts "============" +puts "OCC25456" +puts "============" +puts "" +############################### +## BOPAlgo_CheckerSI reports an error on the given shape +############################### + +restore [locate_data_file bug25456_shape.brep] a + +set info [bopcheck a] + +if {[string compare ${info} " This shape seems to be OK.\n"] == 0} { + puts "OK: BOPAlgo_CheckerSI report is good" +} else { + puts "Error : BOPAlgo_CheckerSI report is wrong" +} -- 2.20.1