From: jgv Date: Thu, 8 Oct 2015 07:21:38 +0000 (+0300) Subject: 0026717: Error in IntPatch_PrmPrmIntersection: change of local resolution leads to... X-Git-Tag: V7_0_0_beta~213 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=6fa29cbf06dc59263215ed853e5bfb0846b38503 0026717: Error in IntPatch_PrmPrmIntersection: change of local resolution leads to break of walking line Test case for issue CR26717 Correction of test cases for issue CR26717 Test case for issue CR26717 --- diff --git a/src/IntWalk/IntWalk_PWalking.cxx b/src/IntWalk/IntWalk_PWalking.cxx index b30d0bd0d7..abbca82257 100644 --- a/src/IntWalk/IntWalk_PWalking.cxx +++ b/src/IntWalk/IntWalk_PWalking.cxx @@ -1018,7 +1018,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, LevelOfEmptyInmyIntersectionOn2S=0; if(LevelOfIterWithoutAppend < 10) { - Status = TestDeflection(); + Status = TestDeflection(ChoixIso); } else { @@ -1758,7 +1758,7 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop return bOutOfTangentZone; } - Status = TestDeflection(); + Status = TestDeflection(ChoixIso); if(Status == IntWalk_OK) { @@ -2782,7 +2782,7 @@ namespace { static const Standard_Real d = 7.0; } -IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection() +IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection(const IntImp_ConstIsoparametric choixIso) // test if vector is observed by calculating an increase of vector // or the previous point and its tangent, the new calculated point and its @@ -2805,6 +2805,9 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection() IntWalk_StatusDeflection Status = IntWalk_OK; Standard_Real FlecheCourante ,Ratio; + // Caro1 and Caro2 + const Handle(Adaptor3d_HSurface)& Caro1 = myIntersectionOn2S.Function().AuxillarSurface1(); + const Handle(Adaptor3d_HSurface)& Caro2 = myIntersectionOn2S.Function().AuxillarSurface2(); const IntSurf_PntOn2S& CurrentPoint = myIntersectionOn2S.Point(); //================================================================================== @@ -2858,6 +2861,56 @@ IntWalk_StatusDeflection IntWalk_PWalking::TestDeflection() pasuv[1] = Max(5.*ResoV1,Min(1.5*pasuv[1],pasInit[1])); pasuv[2] = Max(5.*ResoU2,Min(1.5*pasuv[2],pasInit[2])); pasuv[3] = Max(5.*ResoV2,Min(1.5*pasuv[3],pasInit[3])); + //Compute local resolution: for OCC26717 + if (Abs(pasuv[choixIso] - pasInit[choixIso]) <= Precision::Confusion()) + { + Standard_Real CurU, CurV; + if (choixIso == IntImp_UIsoparametricOnCaro1 || + choixIso == IntImp_VIsoparametricOnCaro1) + previousPoint.ParametersOnS1(CurU, CurV); + else + previousPoint.ParametersOnS2(CurU, CurV); + gp_Pnt CurPnt = (choixIso == IntImp_UIsoparametricOnCaro1 || + choixIso == IntImp_VIsoparametricOnCaro1)? + Adaptor3d_HSurfaceTool::Value(Caro1, CurU, CurV) : + Adaptor3d_HSurfaceTool::Value(Caro2, CurU, CurV); + gp_Pnt OffsetPnt; + switch(choixIso) + { + case IntImp_UIsoparametricOnCaro1: + OffsetPnt = + Adaptor3d_HSurfaceTool::Value(Caro1, + CurU + sensCheminement*pasuv[0], + CurV); + break; + case IntImp_VIsoparametricOnCaro1: + OffsetPnt = + Adaptor3d_HSurfaceTool::Value(Caro1, + CurU, + CurV + sensCheminement*pasuv[1]); + break; + case IntImp_UIsoparametricOnCaro2: + OffsetPnt = + Adaptor3d_HSurfaceTool::Value(Caro2, + CurU + sensCheminement*pasuv[2], + CurV); + break; + case IntImp_VIsoparametricOnCaro2: + OffsetPnt = + Adaptor3d_HSurfaceTool::Value(Caro2, + CurU, + CurV + sensCheminement*pasuv[3]); + break; + default:break; + } + Standard_Real RefDist = CurPnt.Distance(OffsetPnt); + Standard_Real LocalResol = 0.; + if (RefDist > gp::Resolution()) + LocalResol = pasuv[choixIso] * tolconf / RefDist; + if (pasuv[choixIso] <= LocalResol) + pasuv[choixIso] = pasInit[choixIso] = 2*LocalResol; + } + //////////////////////////////////////// Status = IntWalk_PointConfondu; } diff --git a/src/IntWalk/IntWalk_PWalking.hxx b/src/IntWalk/IntWalk_PWalking.hxx index da63d3bd8f..35b4aea5e0 100644 --- a/src/IntWalk/IntWalk_PWalking.hxx +++ b/src/IntWalk/IntWalk_PWalking.hxx @@ -126,7 +126,7 @@ public: const gp_Dir& TangentAtLine (Standard_Integer& Index) const; - Standard_EXPORT IntWalk_StatusDeflection TestDeflection(); + Standard_EXPORT IntWalk_StatusDeflection TestDeflection (const IntImp_ConstIsoparametric ChoixIso) ; Standard_EXPORT Standard_Boolean TestArret (const Standard_Boolean DejaReparti, TColStd_Array1OfReal& Param, IntImp_ConstIsoparametric& ChoixIso); diff --git a/tests/boolean/bsection/R9 b/tests/boolean/bsection/R9 index 37d251b5ca..4aa959d7ba 100644 --- a/tests/boolean/bsection/R9 +++ b/tests/boolean/bsection/R9 @@ -7,4 +7,4 @@ restore [locate_data_file buc60462b.brep] b bsection result a b -set length 268.348 \ No newline at end of file +set length 282.421 \ No newline at end of file diff --git a/tests/boolean/gdml_private/G7 b/tests/boolean/gdml_private/G7 index 1af9cde9a7..efeb096c51 100644 --- a/tests/boolean/gdml_private/G7 +++ b/tests/boolean/gdml_private/G7 @@ -1,5 +1,5 @@ puts "TODO OCC26018 ALL: Error : The area of the resulting shape is" -puts "TODO OCC26018 Linux: Faulty shapes in variables faulty_1 to faulty_" +#puts "TODO OCC26018 Linux: Faulty shapes in variables faulty_1 to faulty_" source [locate_data_file 20000_et3_401-ta6037.prt.2.gdml.tcl] ## image is differ from application diff --git a/tests/bugs/modalg_1/buc60462_1 b/tests/bugs/modalg_1/buc60462_1 index bb20c30538..56c5a093e8 100755 --- a/tests/bugs/modalg_1/buc60462_1 +++ b/tests/bugs/modalg_1/buc60462_1 @@ -1,5 +1,4 @@ -puts "TODO OCC12345 ALL: Faulty : Section is incorrect" -puts "TODO OCC12345 ALL: Error : The length of result shape is" +#puts "TODO OCC12345 ALL: Error : The length of result shape is" puts "=============" puts "BUC60462" @@ -19,5 +18,5 @@ if { $cs != 0 } { puts "Faulty : Section is incorrect" } -set length 0 +set length 282.421 set 2dviewer 0 diff --git a/tests/bugs/modalg_1/buc60462_2 b/tests/bugs/modalg_1/buc60462_2 index bfe611097c..996c2d5e06 100755 --- a/tests/bugs/modalg_1/buc60462_2 +++ b/tests/bugs/modalg_1/buc60462_2 @@ -1,3 +1,5 @@ +puts "TODO OCC26717 ALL: Faulty shapes in variables faulty_1 to faulty_" + puts "==========" puts "BUC60462" puts "==========" @@ -12,5 +14,5 @@ puts "Fuse end" checkshape result r -set square 94371.7 +set square 93255.6 set 2dviewer 0 diff --git a/tests/bugs/modalg_4/pro18892 b/tests/bugs/modalg_4/pro18892 index 64ad937977..b37bf4d19b 100755 --- a/tests/bugs/modalg_4/pro18892 +++ b/tests/bugs/modalg_4/pro18892 @@ -1,6 +1,3 @@ -puts "TODO OCC12345 ALL: Faulty : Result is BAD. Distance is more than MaxTolerance" -puts "TODO OCC12345 ALL: Error : The length of result shape is" - puts "==========" puts "PRO18892" puts "==========" @@ -32,4 +29,4 @@ if { [expr $d > $MaxEdgeTolerance] || [expr $d > $MaxVertexTolerance] } { puts "Faulty : Result is BAD. Distance is more than MaxTolerance" } -set length 0 +set length 6.46299 diff --git a/tests/bugs/modalg_6/bug26717 b/tests/bugs/modalg_6/bug26717 new file mode 100755 index 0000000000..417e1123ca --- /dev/null +++ b/tests/bugs/modalg_6/bug26717 @@ -0,0 +1,46 @@ +puts "============" +puts "OCC26717" +puts "============" +puts "" +###################################################### +# Error in IntPatch_PrmPrmIntersection: change of local resolution leads to break of walking line +###################################################### + +smallview + +set expected_MaxTolerance 2.14e-05 +set tol_abs_MaxTolerance 1.e-06 +set tol_rel_MaxTolerance 1.e-06 + +set FileName1 bug26717_xrf1_eval_fuselage.brep +restore [locate_data_file ${FileName1}] a + +set FileName2 bug26717_xrf1_eval5_wing.brep +restore [locate_data_file ${FileName2}] b + +bfuse r a b + +set aList [explode r] + +# check 1 +if { [llength ${aList}] == 1} { + puts "OK: Good explode of result" +} else { + puts "Error: Bad explode of result" +} + +# check2 +checknbshapes r -solid 1 + +# check3 +checkshape r + +# check4 +regexp {Tolerance +MAX=([-0-9.+eE]+)} [tolerance r] full MaxTolerance +checkreal "MaxTolerance" ${MaxTolerance} ${expected_MaxTolerance} ${tol_abs_MaxTolerance} ${tol_rel_MaxTolerance} + +clear +donly r +fit + +xwd ${imagedir}/${test_image}.png