0025285: Wrong result of General Fuse operation for an edge and a face.
authorpkv <pkv@opencascade.com>
Thu, 2 Oct 2014 10:10:34 +0000 (14:10 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 2 Oct 2014 10:11:16 +0000 (14:11 +0400)
Changes:
class BOPTools_AlgoTools2D
    method:
void BOPTools_AlgoTools2D::AdjustPCurveOnFace
  (const TopoDS_Face& aF,
   const Standard_Real aFirst,
   const Standard_Real aLast,
   const Handle(Geom2d_Curve)& aC2D,
   Handle(Geom2d_Curve)& aC2DA)

The adjustment value for 2D curve has been calrified with precision value in parametric space

Test case for issue CR25285

src/BOPTools/BOPTools_AlgoTools2D.cxx
tests/bugs/modalg_5/bug25285 [new file with mode: 0755]

index 4c6d976..2c700a9 100644 (file)
@@ -323,10 +323,21 @@ void BOPTools_AlgoTools2D::AdjustPCurveOnFace
   // du
   du = 0.;
   if (aBAS.IsUPeriodic()) {
-    Standard_Real newu;
+    Standard_Real u2x;
     aUPeriod = aBAS.UPeriod(); 
     //
-    GeomInt::AdjustPeriodic(u2, UMin, UMax, aUPeriod, newu, du);
+    // A. drive u2 into the stall [Umin, Umin+aUPeriod] -> u2x
+    GeomInt::AdjustPeriodic(u2, UMin, UMax, aUPeriod, u2x, du, 0.);
+    //
+    // b. try to clarify u2 using the precision (aDelta)
+    if (fabs(u2x-UMin) < aDelta) {
+        u2=UMin;
+      }
+    else if (fabs(u2x-UMin-aUPeriod) < aDelta) {
+      u2=UMin+aUPeriod;
+    }
+    // C. compute du again using clarified value of u2
+    GeomInt::AdjustPeriodic(u2, UMin, UMax, aUPeriod, u2x, du, 0.);
     //
     if (du==0.) {
       if (aBAS.GetType()==GeomAbs_Cylinder) {
diff --git a/tests/bugs/modalg_5/bug25285 b/tests/bugs/modalg_5/bug25285
new file mode 100755 (executable)
index 0000000..a74e0fa
--- /dev/null
@@ -0,0 +1,34 @@
+puts "================"
+puts "OCC25285"
+puts "================"
+puts ""
+#######################################################################
+# Wrong result of General Fuse operation for an edge and a face.
+#######################################################################
+
+restore [locate_data_file bug25285_qefx.brep] qefx
+
+explode qefx
+copy qefx_1 e
+copy qefx_2 f
+
+bclearobjects
+bcleartools
+baddobjects f e
+
+bfillds
+bbuild result
+
+set square 8.83493
+
+set nb_v_good 4
+set nb_e_good 4
+set nb_w_good 1
+set nb_f_good 1
+set nb_sh_good 0
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good 1
+set nb_shape_good 11
+
+set 3dviewer 1