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.
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));
# 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
-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 "========"
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
--- /dev/null
+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