0027175: Intersection algorithm with increased tolerance works incorrect with some...
authornbv <nbv@opencascade.com>
Wed, 9 Mar 2016 06:54:42 +0000 (09:54 +0300)
committerbugmaster <bugmaster@opencascade.com>
Mon, 28 Mar 2016 14:31:15 +0000 (17:31 +0300)
1. Algorithm of coincidence check between Walking and Restriction line has been improved in IntPatch_ImpPrmIntersection.
2. Creation of test case for this issue.

src/IntPatch/IntPatch_ImpPrmIntersection.cxx
tests/bugs/modalg_6/bug27175 [new file with mode: 0644]

index a1e3b71..ee57dfc 100644 (file)
@@ -1572,7 +1572,7 @@ void IntPatch_ImpPrmIntersection::Perform (const Handle(Adaptor3d_HSurface)& Sur
   // Now slin is filled as follows: lower indices correspond to Restriction line,
   // after (higher indices) - only Walking-line.
 
-  const Standard_Real aTol3d = Func.Tolerance(); 
+  const Standard_Real aTol3d = Max(Func.Tolerance(), TolTang); 
   const Handle(Adaptor3d_HSurface)& aQSurf = (reversed) ? Surf2 : Surf1;
   const Handle(Adaptor3d_HSurface)& anOtherSurf = (reversed) ? Surf1 : Surf2;
 
diff --git a/tests/bugs/modalg_6/bug27175 b/tests/bugs/modalg_6/bug27175
new file mode 100644 (file)
index 0000000..7b4c645
--- /dev/null
@@ -0,0 +1,29 @@
+puts "================"
+puts "OCC27175"
+puts "================"
+puts ""
+#######################################################################
+# Intersection algorithm with increased tolerance works incorrect with some shapes
+#######################################################################
+
+set ExpectTol 3.002046539399851e-006
+set GoodNbCurv 2
+
+plane pl 0.195808075898442 -0.229262227170656 4.05546403129991 0 0 1
+psphere s1 pl 0.03101752454
+restore [locate_data_file bug27128-Helix_Pipe.brep] s2
+
+explode s1 f
+explode s2 f
+
+settolerance s1_1 2.0e-6
+settolerance s2_2 2.0e-6
+bopcurves s1_1 s2_2 -2d
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves s1_1 s2_2 -2d] full Toler NbCurv
+
+checkreal "Tolerance Reached" ${Toler} ${ExpectTol} 0.0 0.1
+
+if {${NbCurv} != ${GoodNbCurv}} {
+  puts "Error: Curve Number is bad!"
+}