0024384: Wrong result obtained by Fuse
authorpkv <pkv@opencascade.com>
Wed, 20 Nov 2013 09:41:36 +0000 (13:41 +0400)
committerbugmaster <bugmaster@opencascade.com>
Thu, 21 Nov 2013 13:19:32 +0000 (17:19 +0400)
Changes:
1. class BOPTools
   - method:
void BOPTools_AlgoTools::MakeVertex(BOPCol_ListOfShape& aLV,
                                                              TopoDS_Vertex& aVnew)
The function fsqrt that calculates the square root of a real number
has been replaced by the standard sqrt.

2. class BOPAlgo_WireSplitter
- static function:
Standard_Real Angle2D (const TopoDS_Vertex& aV,
                         const TopoDS_Edge& anEdge,
                         const TopoDS_Face& myFace,
                         const GeomAdaptor_Surface& aGAS,
                         const Standard_Boolean aFlag)
The value parametric deltas for computations of 2D-angles
have been changed for Bezier, B-Spline 2D-curves.

src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx
src/BOPTools/BOPTools_AlgoTools.cxx

index fb9132c..ab7c9f0 100644 (file)
@@ -49,6 +49,7 @@
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <BOPTools_AlgoTools2D.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
 //
 
 static
@@ -739,7 +740,7 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
   }
   //
   BOPTools_AlgoTools2D::CurveOnSurface (anEdge, myFace, aC2D, 
-                                    aFirst, aLast, aToler);
+                                       aFirst, aLast, aToler);
   dt=2.*Tolerance2D(aV, aGAS);
   //
   //for case chl/927/r9
@@ -753,6 +754,12 @@ Standard_Integer NbWaysOut(const BOPAlgo_ListOfEdgeInfo& aLEInfo)
     dt = aTX; 
   }
   //
+  GeomAbs_CurveType aType;
+  Geom2dAdaptor_Curve aGAC2D(aC2D);
+  aType=aGAC2D.GetType();
+  if (aType==GeomAbs_BSplineCurve || aType==GeomAbs_BezierCurve) {
+    dt=1.1*dt;
+  }
   if (fabs (aTV-aFirst) < fabs(aTV - aLast)) {
     aTV1=aTV + dt;
   }
index f0c6145..eebf260 100644 (file)
@@ -76,8 +76,6 @@ static
   Standard_Real AngleWithRef(const gp_Dir& theD1,
                              const gp_Dir& theD2,
                              const gp_Dir& theDRef);
-static 
-  inline Standard_Real fsqrt(Standard_Real val);
 
 static
   Standard_Boolean FindFacePairs (const TopoDS_Edge& theE,
@@ -1480,7 +1478,7 @@ void BOPTools_AlgoTools::MakeVertex(BOPCol_ListOfShape& aLV,
       aPi=BRep_Tool::Pnt(aVi);
       aTi=BRep_Tool::Tolerance(aVi);
       aDi=aP.SquareDistance(aPi);
-      aDi=fsqrt(aDi);
+      aDi=sqrt(aDi);
       aDi=aDi+aTi;
       if (aDi > aDmax) {
         aDmax=aDi;
@@ -1644,26 +1642,6 @@ Standard_Real AngleWithRef(const gp_Dir& theD1,
   }
   return aBeta;
 }
-//=======================================================================
-//function : fsqrt
-//purpose  : 
-//=======================================================================
-Standard_Real fsqrt(Standard_Real val)  
-{
-  union {
-    int tmp;
-    float val;
-  } u;
-  //
-  u.val = (float)val;
-  u.tmp -= 1<<23; /* Remove last bit so 1.0 gives 1.0 */
-  /* tmp is now an approximation to logbase2(val) */
-  u.tmp >>= 1; /* divide by 2 */
-  u.tmp += 1<<29; /* add 64 to exponent: (e+127)/2 =(e/2)+63, */
-  /* that represents (e/2)-64 but we want e/2 */
-  return (double)u.val;
-}
-
 //=======================================================================
 // function: IsBlockInOnFace
 // purpose: