From ebeff0a2bc0806efbd114d95e05f2bea6ef536aa Mon Sep 17 00:00:00 2001
From: pdn <pdn@opencascade.com>
Date: Thu, 28 Nov 2013 11:10:10 +0400
Subject: [PATCH] 0024400: Wrong result obtained by Section

Changes:
class IntTools_FaceFace
- static function:
void CorrectSurfaceBoundaries(const TopoDS_Face&  theFace,
			       const Standard_Real theTolerance,
			       Standard_Real&      theumin,
			       Standard_Real&      theumax,
			       Standard_Real&      thevmin,
			       Standard_Real&      thevmax)

Remove unnecessary broadening of UV-bounds for the faces based on the sperical surfaces.

Test case for issue CR24400
---
 src/IntTools/IntTools_FaceFace.cxx |  9 ---------
 tests/bugs/modalg_5/bug23991       |  1 -
 tests/bugs/modalg_5/bug24400       | 25 +++++++++++++++++++++++++
 3 files changed, 25 insertions(+), 10 deletions(-)
 create mode 100644 tests/bugs/modalg_5/bug24400

diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx
index 7815d6a27e..bd1e4f1dab 100755
--- a/src/IntTools/IntTools_FaceFace.cxx
+++ b/src/IntTools/IntTools_FaceFace.cxx
@@ -2638,15 +2638,6 @@ Handle(Geom2d_BSplineCurve) MakeBSpline2d(const Handle(IntPatch_WLine)& theWLine
     enlarge=Standard_True;
   }
   //
-  if (aType==GeomAbs_Sphere) {
-    Standard_Real dV;
-    //
-    dV=thevmax-thevmin;
-    if (dV+delta<M_PI) {
-      enlarge=Standard_True;
-    }
-  }
-  //
   if(!isuperiodic && enlarge) {
 
     if((theumin - uinf) > delta )
diff --git a/tests/bugs/modalg_5/bug23991 b/tests/bugs/modalg_5/bug23991
index e0d82dfc03..808a16d7dc 100644
--- a/tests/bugs/modalg_5/bug23991
+++ b/tests/bugs/modalg_5/bug23991
@@ -1,4 +1,3 @@
-puts "TODO OCC23991 ALL: Error : Result shape is WRONG"
 puts "============"
 puts "OCC23991"
 puts "============"
diff --git a/tests/bugs/modalg_5/bug24400 b/tests/bugs/modalg_5/bug24400
new file mode 100644
index 0000000000..083e4b2363
--- /dev/null
+++ b/tests/bugs/modalg_5/bug24400
@@ -0,0 +1,25 @@
+puts "============"
+puts "OCC24400"
+puts "============"
+puts ""
+#######################################################################
+# Wrong result obtained by Section
+#######################################################################
+
+restore [locate_data_file bug24075_b1.brep] b1
+restore [locate_data_file bug24075_b2.brep] b2
+
+bop b1 b2
+bopsection result
+
+set nb_v_good 2
+set nb_e_good 1
+set nb_w_good 0
+set nb_f_good 0
+set nb_sh_good 0
+set nb_sol_good 0
+set nb_compsol_good 0
+set nb_compound_good  1
+set nb_shape_good 4
+
+set 2dviewer 1