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-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=bdb1db500eec88dbd5a651109d64219cecc12011;p=occt-copy.git 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.cdl b/src/IntWalk/IntWalk_PWalking.cdl index 99b7bcd644..12ae0e388e 100644 --- a/src/IntWalk/IntWalk_PWalking.cdl +++ b/src/IntWalk/IntWalk_PWalking.cdl @@ -224,7 +224,8 @@ is --private - TestDeflection(me : in out) + TestDeflection(me : in out; + ChoixIso : ConstIsoparametric from IntImp) returns StatusDeflection from IntWalk is static; diff --git a/src/IntWalk/IntWalk_PWalking.cxx b/src/IntWalk/IntWalk_PWalking.cxx index ae9e675e82..df54db47c2 100644 --- a/src/IntWalk/IntWalk_PWalking.cxx +++ b/src/IntWalk/IntWalk_PWalking.cxx @@ -1019,7 +1019,7 @@ void IntWalk_PWalking::Perform(const TColStd_Array1OfReal& ParDep, LevelOfEmptyInmyIntersectionOn2S=0; if(LevelOfIterWithoutAppend < 10) { - Status = TestDeflection(); + Status = TestDeflection(ChoixIso); } else { @@ -1759,7 +1759,7 @@ Standard_Boolean IntWalk_PWalking::ExtendLineInCommonZone(const IntImp_ConstIsop return bOutOfTangentZone; } - Status = TestDeflection(); + Status = TestDeflection(ChoixIso); if(Status == IntWalk_OK) { @@ -2800,7 +2800,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 @@ -2823,6 +2823,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(); //================================================================================== @@ -2876,6 +2879,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/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/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 5600525f17..ec696aadf4 100755 --- a/tests/bugs/modalg_1/buc60462_2 +++ b/tests/bugs/modalg_1/buc60462_2 @@ -14,6 +14,6 @@ puts "Fuse end" checkshape result r -set square 94371.7 +set square 93255.6 checkshape result set 2dviewer 0 diff --git a/tests/bugs/modalg_2/bug472_2 b/tests/bugs/modalg_2/bug472_2 index eb00f2c0dd..d922b4e0b1 100755 --- a/tests/bugs/modalg_2/bug472_2 +++ b/tests/bugs/modalg_2/bug472_2 @@ -1,5 +1,4 @@ -puts "TODO OCC25917 ALL: Faulty shapes in variables faulty_1 to faulty_" -puts "TODO OCC25917 ALL: Error : The square of result shape is" +puts "TODO OCC25917 ALL: Error : The command is not valid. The square is 0." puts "========================" puts " OCC472 " 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