From: pkv Date: Wed, 20 Nov 2013 09:41:36 +0000 (+0400) Subject: 0024384: Wrong result obtained by Fuse X-Git-Tag: V6_7_0~57 X-Git-Url: http://git.dev.opencascade.org/gitweb/?p=occt.git;a=commitdiff_plain;h=4889b44e3e930eb89b7f3762330d348def1e1482 0024384: Wrong result obtained by Fuse 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. --- diff --git a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx index fb9132c7c9..ab7c9f066b 100644 --- a/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx +++ b/src/BOPAlgo/BOPAlgo_WireSplitter_1.cxx @@ -49,6 +49,7 @@ #include #include #include +#include // 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; } diff --git a/src/BOPTools/BOPTools_AlgoTools.cxx b/src/BOPTools/BOPTools_AlgoTools.cxx index f0c6145f32..eebf26094a 100644 --- a/src/BOPTools/BOPTools_AlgoTools.cxx +++ b/src/BOPTools/BOPTools_AlgoTools.cxx @@ -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: