]> OCCT Git - occt-copy.git/commitdiff
0027761: Intersection loops infinitely
authoremv <emv@opencascade.com>
Thu, 11 Aug 2016 08:55:29 +0000 (11:55 +0300)
committernbv <nbv@opencascade.com>
Tue, 23 May 2017 10:20:30 +0000 (13:20 +0300)
The static method CorrectSurfaceBoundaries() in the class IntTools_FaceFace,
which is used for correction of the boundaries of the faces before their intersection,
contains two inconsistent adjustments of the boundaries of the faces based on periodic surfaces.
One of these adjustments has been removed. The remaining adjustment, the one that is based on the
2D bounding boxes of the closed curves, should be sufficient.

Test case for the issue.

(cherry picked from commit 7cb2f40993b9699ca7dc80b5f3c54662d9e345dd)

src/IntTools/IntTools_FaceFace.cxx
tests/blend/bfuseblend/B7
tests/bugs/modalg_5/bug25488
tests/bugs/modalg_6/bug26310_1
tests/bugs/modalg_6/bug27761 [new file with mode: 0644]
tests/bugs/modalg_6/bug27766

index d99c0c1792e8384d2bebc1f7dea86635a0158018..3a6a0bb3a6ac88cda641d08477268f9bc73244ff 100644 (file)
@@ -2629,59 +2629,6 @@ Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine
     }
   }
   //
-  {
-    Standard_Integer aNbP;
-    Standard_Real aXP, dXfact, aXmid, aX1, aX2, aTolPA;
-    //
-    aTolPA=Precision::Angular();
-    // U
-    if (isuperiodic) {
-      aXP=anAdaptorSurface.UPeriod();
-      dXfact=theumax-theumin;
-      if (dXfact-aTolPA>aXP) {
-        aXmid=0.5*(theumax+theumin);
-        aNbP=RealToInt(aXmid/aXP);
-        if (aXmid<0.) {
-          aNbP=aNbP-1;
-        }
-        aX1=aNbP*aXP;
-        if (theumin>aTolPA) {
-          aX1=theumin+aNbP*aXP;
-        }
-        aX2=aX1+aXP;
-        if (theumin<aX1) {
-          theumin=aX1;
-        }
-        if (theumax>aX2) {
-          theumax=aX2;
-        }
-      }
-    }
-    // V
-    if (isvperiodic) {
-      aXP=anAdaptorSurface.VPeriod();
-      dXfact=thevmax-thevmin;
-      if (dXfact-aTolPA>aXP) {
-        aXmid=0.5*(thevmax+thevmin);
-        aNbP=RealToInt(aXmid/aXP);
-        if (aXmid<0.) {
-          aNbP=aNbP-1;
-        }
-        aX1=aNbP*aXP;
-        if (thevmin>aTolPA) {
-          aX1=thevmin+aNbP*aXP;
-        }
-        aX2=aX1+aXP;
-        if (thevmin<aX1) {
-          thevmin=aX1;
-        }
-        if (thevmax>aX2) {
-          thevmax=aX2;
-        }
-      }
-    }
-  }
-  //
   if(isuperiodic || isvperiodic) {
     Standard_Boolean correct = Standard_False;
     Standard_Boolean correctU = Standard_False;
@@ -2736,16 +2683,13 @@ Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine
       aBox.Get(umin, vmin, umax, vmax);
 
       if(isuperiodic && correctU) {
-        
         if(theumin < umin)
           theumin = umin;
-        
         if(theumax > umax) {
           theumax = umax;
         }
       }
       if(isvperiodic && correctV) {
-        
         if(thevmin < vmin)
           thevmin = vmin;
         if(thevmax > vmax)
index 8fc8db94afe50a123725365799bfaf93df7462bc..07e68f09605051d09e48710f8b59bf70f47f12db 100644 (file)
@@ -6,4 +6,4 @@ tscale s1 0 0 0 SCALE1
 tscale s2 0 0 0 SCALE1
 bfuseblend result s1 s2 1*SCALE1
 
-set square 53457.8
+set square 52920.7
index d3fb0b87f6499a3e9c1fd517bf05c7156658dc3b..13af1f40c6b5fdde80e9bf2d3c208a1837e9405b 100644 (file)
@@ -6,7 +6,7 @@ puts ""
 # Wrong result of two trimmed cylinders intersection
 ######################################################
 
-set Tolerance 1.1e-7
+set Tolerance 2.0e-6
 set D_good 0.
 set Limit_Tol 1.0e-7
 
index 3d5224783f5cfc7fcc2d911dd9d140354b15a60d..1e83547474839d954a9495f0682ac8eecf7c4e80 100644 (file)
@@ -7,9 +7,9 @@ puts ""
 #################################################
 
 if { [regexp {Debug mode} [dversion]] } {
-    set max_time 1.0
+    set max_time 3.0
 } else {
-    set max_time 0.5
+    set max_time 1.0
 }
 
 set ExpTol1 1.3823335207427231e-006
diff --git a/tests/bugs/modalg_6/bug27761 b/tests/bugs/modalg_6/bug27761
new file mode 100644 (file)
index 0000000..abf6323
--- /dev/null
@@ -0,0 +1,16 @@
+puts "========"
+puts "OCC27761"
+puts "========"
+puts ""
+#################################################
+# Intersection loops infinitely
+#################################################
+
+restore [locate_data_file bug27761_c1.brep] c1
+restore [locate_data_file bug27761_c2.brep] c2
+
+bsection result c1 c2
+
+checkshape result
+# approximate theoretical length of the result
+set length 0.00192547
index c039cd8efc872040d6469d19b13534c024629d78..cc49710432b7d9d39d9e20dfb0b16d985691d05c 100644 (file)
@@ -6,7 +6,7 @@ puts ""
 # Incorrect section curves between attached cylinders
 #################################################
 
-set ExpTol 1.0e-7
+set ExpTol 2.3528376469664739e-011
 set GoodNbCurv 3
 
 restore [locate_data_file bug27761_c1.brep] c1
@@ -27,4 +27,4 @@ don c_*
 fit
 disp c1 c2
 
-checkview -screenshot -2d -path ${imagedir}/${test_image}.png
+set only_screen_axo 1
\ No newline at end of file