]> OCCT Git - occt.git/commitdiff
0027761: Intersection loops infinitely
authoremv <emv@opencascade.com>
Thu, 11 Aug 2016 08:55:29 +0000 (11:55 +0300)
committermkv <mkv@opencascade.com>
Thu, 11 Aug 2016 14:47:36 +0000 (17:47 +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.

src/IntTools/IntTools_FaceFace.cxx
tests/bugs/modalg_6/bug27761 [new file with mode: 0644]

index be31b1339a409473afded862a0e79095df63773d..166b4f15a698bebec0bf836e98c64d4e1bcb5d34 100644 (file)
@@ -2381,59 +2381,6 @@ Handle(Geom_Curve) MakeBSpline  (const Handle(IntPatch_WLine)& WL,
     }
   }
   //
-  {
-    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;
@@ -2488,16 +2435,13 @@ Handle(Geom_Curve) MakeBSpline  (const Handle(IntPatch_WLine)& WL,
       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)
diff --git a/tests/bugs/modalg_6/bug27761 b/tests/bugs/modalg_6/bug27761
new file mode 100644 (file)
index 0000000..6822206
--- /dev/null
@@ -0,0 +1,19 @@
+puts "TODO OCC27766 ALL: Error : The command is not valid. The length is 0."
+puts "TODO OCC27766 ALL: Error : The length of result shape is"
+
+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
+checkprops result -l 0.00201518
\ No newline at end of file