]> OCCT Git - occt.git/commitdiff
0027469: Modeling Algorithms - Regression vs 6.9.1: Wrong result of Edge/Face interse...
authorifv <ifv@opencascade.com>
Thu, 15 Oct 2020 07:34:35 +0000 (10:34 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 22 Oct 2020 14:49:17 +0000 (17:49 +0300)
IntTools/IntTools_BeanFaceIntersector.cxx - decreasing parameter aDeltaRestrictor in method ComputeRangeFromStartPoint(...) to avoid "jumping" across the common part boundary.

IntTools/IntTools_EdgeFace.cxx - method IsCoincident() - improving criteria of coincidence between edge and face.

src/IntTools/IntTools_BeanFaceIntersector.cxx
src/IntTools/IntTools_EdgeFace.cxx
tests/bugs/modalg_7/bug27469_1
tests/bugs/modalg_7/bug27469_2

index 513e3e5c2a5463b847b1ef417275b2a75fe44386..5bc0d5a946c85fcf3a18e189819f21789f3e18f0 100644 (file)
@@ -1140,7 +1140,7 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo
   Standard_Integer aValidIndex = theIndex;
   
   Standard_Real aMinDelta        = myCurveResolution * 0.5;
-  Standard_Real aDeltaRestrictor = myLastParameter - myFirstParameter;
+  Standard_Real aDeltaRestrictor = 0.1 * (myLastParameter - myFirstParameter);
 
   if(aMinDelta > aDeltaRestrictor)
     aMinDelta = aDeltaRestrictor * 0.5;
@@ -1202,7 +1202,7 @@ void IntTools_BeanFaceIntersector::ComputeRangeFromStartPoint(const Standard_Boo
     
     aDelta = (pointfound) ? (aDelta * 2.) : (aDelta * 0.5);
     aDelta = (aDelta < aDeltaRestrictor) ? aDelta : aDeltaRestrictor;
-    
+
     aCurPar = (ToIncreaseParameter) ? (aPrevPar + aDelta) : (aPrevPar - aDelta);
     
     
index dffdb25c2cef80bcbd0f2ca01465ed511c49cecd..37bfcec4a8d5923a5047abc1a8c10b0b94aed982 100644 (file)
@@ -93,13 +93,18 @@ Standard_Boolean IntTools_EdgeFace::IsCoincident()
       myS.GetType() == GeomAbs_Plane)
     aNbSeg = 2; // Check only three points for Line/Plane intersection
 
-  const Standard_Real aTresh=0.5;
+  const Standard_Real aTresh = 0.5;
   const Standard_Integer aTreshIdxF = RealToInt((aNbSeg+1)*0.25),
                          aTreshIdxL = RealToInt((aNbSeg+1)*0.75);
   const Handle(Geom_Surface) aSurf = BRep_Tool::Surface(myFace);
 
   aT1=myRange.First();
   aT2=myRange.Last();
+  Standard_Real aBndShift = 0.01 * (aT2 - aT1);
+  //Shifting first and last curve points in order to avoid projection
+  //on surface boundary and rejection projection point with minimal distance
+  aT1 += aBndShift;
+  aT2 -= aBndShift;
   dT=(aT2-aT1)/aNbSeg;
   //
   Standard_Boolean isClassified = Standard_False;
@@ -115,8 +120,11 @@ Standard_Boolean IntTools_EdgeFace::IsCoincident()
     //
     
     aD=aProjector.LowerDistance();
-    if (aD>myCriteria) {
-      continue;
+    if (aD > myCriteria) {
+      if (aD > 100. * myCriteria)
+        return Standard_False;
+      else
+        continue;
     }
     //
 
index 9fc5079ac3b23c5dc9382068aa7c220008b087e2..db4544278540f7973a0479bfbe01fb03d4a5a651 100644 (file)
@@ -1,12 +1,7 @@
-puts "TODO OCC27469 ALL: Error :  is WRONG because number of"
-
-puts "========"
-puts "OCC27469"
-puts "========"
+puts "===================================================================="
+puts "OCC27469 Regression vs 6.9.1: Wrong result of Edge/Face intersection"
+puts "===================================================================="
 puts ""
-###############################################################
-# Regression vs 6.9.1: Wrong result of Edge/Face intersection
-###############################################################
 
 restore [locate_data_file bug27469_shapes.brep] b
 
@@ -21,4 +16,9 @@ baddtools b_2_10 b_2_9
 bfillds
 bbuild result
 
-checknbshapes result -edge 35
+checkshape result
+checknbshapes result -face 1 -wire 3 -edge 35 -vertex 30
+checkmaxtol result -min_tol 2.42e-7
+checkprops result -l  38486.5
+
+checkview -display result -2d -path ${imagedir}/${test_image}.png
\ No newline at end of file
index 1ddb9ff9a82d4a6a7039d7b6ea683f9321c294bb..3b4accea8078673a39def9f1b904b765e3eb29b4 100644 (file)
@@ -1,12 +1,7 @@
-puts "TODO OCC27469 ALL: Faulty shapes in variables faulty_1 to faulty_"
-
-puts "========"
-puts "OCC27469"
-puts "========"
+puts "===================================================================="
+puts "OCC27469 Regression vs 6.9.1: Wrong result of Edge/Face intersection"
+puts "===================================================================="
 puts ""
-###############################################################
-# Regression vs 6.9.1: Wrong result of Edge/Face intersection
-###############################################################
 
 restore [locate_data_file bug27469_shapes.brep] b
 
@@ -20,3 +15,7 @@ bfillds
 bbuild result
 
 checkshape result
+checknbshapes result -solid 7 -shell 7 -face 39 -wire 46 -edge 67 -vertex 34
+checkmaxtol result -min_tol 2.17e-2
+checkprops result -l 352002
+checkview -display result -2d -path ${imagedir}/${test_image}.png