]> OCCT Git - occt-copy.git/commitdiff
0027766: Incorrect section curves between attached cylinders
authornbv <nbv@opencascade.com>
Fri, 12 Aug 2016 19:08:50 +0000 (22:08 +0300)
committerbugmaster <bugmaster@opencascade.com>
Thu, 18 Aug 2016 11:46:35 +0000 (14:46 +0300)
2d-tolerance has been bounded above (earlier it was too big for precise computation).

Creation of the test case for this issue.
Adjusting some test cases according to their new behavior.

Adjusting test case according to its new behavior.

src/IntPatch/IntPatch_ImpImpIntersection_2.gxx
tests/bugs/modalg_6/bug27310_2
tests/bugs/modalg_6/bug27761
tests/bugs/modalg_6/bug27766 [new file with mode: 0644]

index f94f8096d2577a4379601b3e9ed3408fabd1e328..b1d3dfcbfde4803c3b19322166292ba14b6427ce 100644 (file)
@@ -177,8 +177,11 @@ void IntPatch_ImpImpIntersection::Perform(const Handle(Adaptor3d_HSurface)&  S1,
           aBox2.Add(gp_Pnt2d(aU2f, S2->FirstVParameter()));
           aBox2.Add(gp_Pnt2d(aU2l, S2->LastVParameter()));
 
-          const Standard_Real a2DTol = Min( S1->UResolution(TolTang),
-                                              S2->UResolution(TolTang));
+          // Resolution is too big if the cylinder radius is
+          // too small. Therefore, we shall bounde its value above. 
+          // Here, we use simple constant.
+          const Standard_Real a2DTol = Min(1.0e-4, Min( S1->UResolution(TolTang),
+                                              S2->UResolution(TolTang)));
 
           Standard_Boolean isReversed = ((aU2l - aU2f) < (aU1l - aU1f));
 
index 30e5754f8db8a2735a00d08785af8ed7f9e8760a..fe5faee133e93851aff665f184050136d4906270 100644 (file)
@@ -6,7 +6,7 @@ puts ""
 # Huge tolerance obtained in the result of intersection of two cylindrical faces
 #################################################
 
-set ExpTol 7.7015195151142059e-006
+set ExpTol 0.00027580830315682321
 set GoodNbCurv 2
 
 restore [locate_data_file OCC496a.brep] a 
index 68222063ea14dd88761e323c41091b26e1171ed0..4b5c54f8662f6d2d36b4983580d1125257ae7eb5 100644 (file)
@@ -1,6 +1,3 @@
-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 "========"
@@ -16,4 +13,16 @@ bsection result c1 c2
 
 checkshape result
 # approximate theoretical length of the result
-checkprops result -l 0.00201518
\ No newline at end of file
+checkprops result -l 0.00192624
+
+regexp {nb alone Vertices : ([-0-9.+eE]+)} [checksection result] full nbv
+if { $nbv != 0 } { puts "Error : Section is incorrect" }
+
+smallview
+don result
+fit
+clear
+disp c1 c2
+disp result
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
diff --git a/tests/bugs/modalg_6/bug27766 b/tests/bugs/modalg_6/bug27766
new file mode 100644 (file)
index 0000000..d992b88
--- /dev/null
@@ -0,0 +1,30 @@
+puts "========"
+puts "OCC27766"
+puts "========"
+puts ""
+#################################################
+# Incorrect section curves between attached cylinders
+#################################################
+
+set ExpTol 1.0e-7
+set GoodNbCurv 5
+
+restore [locate_data_file bug27761_c1.brep] c1
+restore [locate_data_file bug27761_c2.brep] c2
+
+set log [bopcurves c1 c2 -2d]
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} ${log} full Toler NbCurv
+
+if {${NbCurv} != ${GoodNbCurv}} {
+  puts "Error: Number of curves is bad!"
+}
+
+checkreal TolReached $Toler $ExpTol 0.0 0.1
+
+smallview
+don c_*
+fit
+disp c1 c2
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png