The algorithm in WorkWithBoundaries::BoundaryEstimation(...) did not take into account opposite directions of cylindrical axes (when the angle between them is obtuse). After the fix it does it.
Small correction of test cases for issue CR28009
//projections of two opposite parallelogram vertices
//(joined by the maximal diagonal) to the cylinder axis.
const Standard_Real aSinA = sqrt(aSqSinA);
- const Standard_Real aHDV1 = (aR1 * aCosA + aR2)/aSinA,
- aHDV2 = (aR2 * aCosA + aR1)/aSinA;
+ const Standard_Real anAbsCosA = Abs(aCosA);
+ const Standard_Real aHDV1 = (aR1 * anAbsCosA + aR2) / aSinA,
+ aHDV2 = (aR2 * anAbsCosA + aR1) / aSinA;
#ifdef INTPATCH_IMPIMPINTERSECTION_DEBUG
//The code in this block is created for test only.It is stupidly to create
--- /dev/null
+puts "================"
+puts "OCC28009"
+puts "================"
+puts ""
+#######################################################################
+# [Regression vs OCCT7.0.0] Cut produces not valid shape
+#######################################################################
+
+restore [locate_data_file bug28009_shape.brep] a
+
+explode a
+bcut result a_1 a_2
+
+# Check result validity.
+checkshape result
+
+# Check number of topological entities in the result.
+checknbshapes result -solid 1 -shell 1 -face 12 -wire 12 -edge 28 -vertex 17
+
+# Check result area.
+checkprops result -s 4347.99
+
+smallview
+don result
+fit
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png
--- /dev/null
+puts "================"
+puts "OCC28009"
+puts "================"
+puts ""
+#######################################################################
+# [Regression vs OCCT7.0.0] Cut produces not valid shape
+#######################################################################
+
+set NbCurvGood 1
+set ExpToler 9.0002189481237598e-008
+
+restore [locate_data_file bug28009_shape.brep] a
+
+explode a
+
+explode a_1 f
+explode a_2 f
+
+regexp {Tolerance Reached=+([-0-9.+eE]+)\n+([-0-9.+eE]+)} [bopcurves a_1_6 a_2_1 -2d] full Toler NbCurv
+if {${NbCurv} != 1} {
+ puts "Error: Number of curves is bad!"
+}
+
+checkreal TolReached $Toler $ExpToler 0.0 0.1
+
+smallview
+don c_*
+fit
+display a_1_6 a_2_1
+
+checkview -screenshot -2d -path ${imagedir}/${test_image}.png