]> OCCT Git - occt-copy.git/commitdiff
0026717: Error in IntPatch_PrmPrmIntersection: change of local resolution leads to...
authorjgv <jgv@opencascade.com>
Thu, 8 Oct 2015 07:21:38 +0000 (10:21 +0300)
committeremv <emv@opencascade.com>
Tue, 26 Feb 2019 04:56:57 +0000 (07:56 +0300)
Test case for issue CR26717

Correction of test cases for issue CR26717

Test case for issue CR26717

src/IntWalk/IntWalk_PWalking.cdl
src/IntWalk/IntWalk_PWalking.cxx
tests/boolean/bsection/R9
tests/bugs/modalg_1/buc60462_1
tests/bugs/modalg_1/buc60462_2
tests/bugs/modalg_2/bug472_2
tests/bugs/modalg_4/pro18892
tests/bugs/modalg_6/bug26717 [new file with mode: 0755]

index 99b7bcd6442797f4bc38d98d5d3112ff14dab9c4..12ae0e388e51f0c14d623fd82a07600cea3d8b77 100644 (file)
@@ -224,7 +224,8 @@ is
 
 --private
 
-    TestDeflection(me : in out)
+    TestDeflection(me : in out;
+                   ChoixIso : ConstIsoparametric from IntImp)
 
        returns StatusDeflection from IntWalk
        is static;
index ae9e675e82b2a9fbde0a63bc634cd6c97541186c..df54db47c2a994146f7990bbdc865749897000f0 100644 (file)
@@ -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;
   }
 
index 37d251b5ca23ce6a115b9b0b2ffba82d527e6a2d..4aa959d7baa4432e0460567ad67620cf3aafc033 100644 (file)
@@ -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
index bb20c30538b053eceb1791a3b9f431e839a972e3..56c5a093e8c85afab70b0007d859d5c0fbf562bf 100755 (executable)
@@ -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
index 5600525f17cf78b7e69d6033f1ed6626ecfffbf3..ec696aadf4c2fa78722296cf53a7b86c108cadb4 100755 (executable)
@@ -14,6 +14,6 @@ puts "Fuse end"
 
 checkshape result r
 
-set square 94371.7
+set square 93255.6
 checkshape result
 set 2dviewer 0
index eb00f2c0dd0e508838bacf2e727e2d83343dfc76..d922b4e0b1d3d693a2e63fcc072144ff575a46a2 100755 (executable)
@@ -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 "
index 64ad937977db269a502323268a320f9f998deaaf..b37bf4d19bf40fcc38b58d466ed28ba1e02e117c 100755 (executable)
@@ -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 (executable)
index 0000000..417e112
--- /dev/null
@@ -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