From: abv Date: Wed, 17 Aug 2016 20:35:11 +0000 (+0300) Subject: // minor X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=3d31c2f0784e60529683ef737ee967d02abb15d2;p=occt-copy.git // minor --- diff --git a/src/ApproxInt/ApproxInt_KnotTools.cxx b/src/ApproxInt/ApproxInt_KnotTools.cxx index eb0e5bc55a..7d7a77d021 100644 --- a/src/ApproxInt/ApproxInt_KnotTools.cxx +++ b/src/ApproxInt/ApproxInt_KnotTools.cxx @@ -28,9 +28,9 @@ #include // (Sqrt(5.0) - 1.0) / 4.0 -static const Standard_Real aSinCoeff = 0.30901699437494742410229341718282; +//static const Standard_Real aSinCoeff = 0.30901699437494742410229341718282; +static const Standard_Real aSinCoeff2 = 0.09549150281252627; // aSinCoeff^2 = (3. - Sqrt(5.)) / 8. static const Standard_Integer aMaxPntCoeff = 15; -static const Standard_Real Epsilon1 = Epsilon(1.); //======================================================================= //function : EvalCurv @@ -238,7 +238,6 @@ void ApproxInt_KnotTools::ComputeKnotInds(const NCollection_LocalArray aSinCoeff) + if(mp > aSinCoeff2 * m1 * m2) // Sqrt (mp/(m1*m2)) > aSinCoeff { //Insert new knots Standard_Real d1 = Abs(aCurv(anInd) - aCurv(anIndPrev)); @@ -494,7 +491,6 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI(const Standard_Integer theI, { if(ChkCurv) { - Standard_Real sina; Standard_Integer ici = (anInd - theCurv.Lower()) * theDim, ici1 = (anInd1 - theCurv.Lower()) * theDim, icm = (mid - theCurv.Lower()) * theDim; @@ -519,9 +515,8 @@ Standard_Boolean ApproxInt_KnotTools::InsKnotBefI(const Standard_Integer theI, } //mp *= 2.; //P(j,i) = -P(i,j); // - Standard_Real m1m2 = m1*m2; - sina = (m1m2 > Epsilon1 ? Sqrt (mp / m1m2) : 0.); - if(sina > aSinCoeff) + + if (mp > aSinCoeff2 * m1 * m2) // Sqrt (mp / m1m2) > aSinCoeff { theInds.InsertBefore(theI, mid); return Standard_True; diff --git a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx index d017d37202..e92fc7fd94 100644 --- a/src/BRepMesh/BRepMesh_FastDiscretFace.cxx +++ b/src/BRepMesh/BRepMesh_FastDiscretFace.cxx @@ -984,7 +984,6 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( gp_Pnt aPrevPnt2; gp_Vec aPrevVec2; aIso.D1 (aPrevParam2, aPrevPnt2, aPrevVec2); - Standard_Real aMod2PrevVec2 = aPrevVec2.SquareMagnitude(); for (Standard_Integer j = 2; j <= aParams2.Length();) { Standard_Real aParam2 = aParams2(j); @@ -1011,7 +1010,9 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( if (aDist < aDefFace) { // Lets check parameters for angular deflection. - if (aMod2PrevVec2 > gp::Resolution() && (aPrevVec2.Angle(aNextVec) < myAngle)) + if (aPrevVec2.SquareMagnitude() > gp::Resolution() && + aNextVec.SquareMagnitude() > gp::Resolution() && + aPrevVec2.Angle(aNextVec) < myAngle) { // For current Iso line we can remove this parameter. #ifdef DEBUG_InsertInternal @@ -1026,7 +1027,6 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( aPrevParam2 = aNextParam; aPrevPnt2 = aNextPnt; aPrevVec2 = aNextVec; - aMod2PrevVec2 = aPrevVec2.SquareMagnitude(); j += 2; continue; } @@ -1049,7 +1049,6 @@ void BRepMesh_FastDiscretFace::insertInternalVerticesOther( aPrevParam2 = aParam2; aPrevPnt2 = aPnt2; aPrevVec2 = aVec2; - aMod2PrevVec2 = aPrevVec2.SquareMagnitude(); ++j; } }