]> OCCT Git - occt.git/commitdiff
0030944: [Regression to 7.0.0] Modeling Algorithms - Intersection curves between...
authorifv <ifv@opencascade.com>
Mon, 20 Apr 2020 12:44:28 +0000 (15:44 +0300)
committerifv <ifv@opencascade.com>
Mon, 3 Aug 2020 07:52:59 +0000 (10:52 +0300)
IntPatch_ImpPrmIntersection.cxx: treatment of coinciding lines is improved
IntWalk_IWalking_1.gxx: bug correction
bug30944 : test case added

src/IntPatch/IntPatch_ImpPrmIntersection.cxx
src/IntWalk/IntWalk_IWalking_1.gxx
tests/bugs/modalg_6/bug27240_1
tests/bugs/modalg_7/bug30944 [new file with mode: 0644]

index 5f90008268c05d79db1d3a9ff0c8822e817dcb39..19c84ea841ba83896c93016a235f02aca9f6d4b9 100644 (file)
@@ -3138,6 +3138,8 @@ Standard_Boolean IsCoincide(IntPatch_TheSurfFunction& theFunc,
                             const Standard_Real theToler2D,
                             const Standard_Real thePeriod) // Period of parametric surface in direction which is perpendicular to theArc direction.
 {
+  const Standard_Real aCoeffs[] = { 0.02447174185,  0.09549150281, 0.20610737385, 0.34549150281, /*Sin(x)*Sin(x)*/
+                                    0.5, 0.65450849719, 0.79389262615 };
   if(theLine->ArcType() == IntPatch_Restriction)
   {//Restriction-restriction processing
     const Handle(IntPatch_RLine)& aRL2 = Handle(IntPatch_RLine)::DownCast(theLine);
@@ -3226,13 +3228,13 @@ Standard_Boolean IsCoincide(IntPatch_TheSurfFunction& theFunc,
 
     const Standard_Real aUl = aPmin.X(), aVl = aPmin.Y();
 
-    const Standard_Integer aNbPoints = 4;
-    const Standard_Real aStepU = (aUl - aUf)/aNbPoints,
-                        aStepV = (aVl - aVf)/aNbPoints;
-
-    Standard_Real aU = aUf+aStepU, aV = aVf+aStepV;
-    for(Standard_Integer i = 1; i < aNbPoints; i++)
+    Standard_Real aU, aV;
+    Standard_Real dU = aUl - aUf, dV = aVl - aVf;
+    for(Standard_Integer i = 0; i < 7; i++)
     {
+      aU = aUf + aCoeffs[i] * dU;
+      aV = aVf + aCoeffs[i] * dV;
+
       aX.Value(1) = aU;
       aX.Value(2) = aV;
 
@@ -3241,13 +3243,10 @@ Standard_Boolean IsCoincide(IntPatch_TheSurfFunction& theFunc,
         return Standard_False;
       }
 
-      if(Abs(aVal(1)) > theToler3D)
+      if(Abs(theFunc.Root()) > theToler3D)
       {
         return Standard_False;
-      }
-      
-      aU += aStepU;
-      aV += aStepV;
+      }     
     }
   }
 
index 18610fa5a9a1e4d4513c7d20dfc1a972821d3de3..272da63b03b2c5bc9104b06071bd71b73b234514 100644 (file)
@@ -59,7 +59,7 @@ static Standard_Boolean IsTangentExtCheck(TheIWFunction& theFunc,
     if(!theFunc.Value(aX, aVal))
       continue;
 
-    if(aVal(1) > aTol)
+    if(Abs(theFunc.Root()) > aTol)
       return Standard_False;
   }
 
index 1a2498d8a9b7e6e6c295a45c2ec3efba9311b08f..c63629ef6cbec4167c8b16c37d806a05fec0dd37 100644 (file)
@@ -13,6 +13,10 @@ explode b
 explode b_1 v
 settolerance b_1_1 0.005
 
+# workaround - increate the tolerance value of the edge to fill the gap between section curves
+explode b_2 e
+settolerance b_2_5 0.0005
+
 bclearobjects
 bcleartools
 
diff --git a/tests/bugs/modalg_7/bug30944 b/tests/bugs/modalg_7/bug30944
new file mode 100644 (file)
index 0000000..f338fe1
--- /dev/null
@@ -0,0 +1,30 @@
+puts "================"
+puts "0030944: Modeling Algorithms - Intersection curves between pair of faces are not found"
+puts "================"
+puts ""
+
+set MaxTol 2.e-7
+set GoodNbCurv 12
+
+restore [locate_data_file bug27469_shapes.brep] b
+explode b
+explode b_1 f
+explode b_2 f
+set log [bopcurves b_1_2 b_2_3 -2d]
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
+
+if {${Toler} > ${MaxTol}} {
+  puts "Error: Tolerance is too big!"
+}
+
+if {${NbCurv} != ${GoodNbCurv}} {
+  puts "Error: Curve Number is bad!"
+}
+
+
+smallview
+donly b_1_2 b_2_3 
+eval display [directory c_*]
+fit
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png