#include <TColgp_Array1OfPnt.hxx>
// (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
{
Standard_Integer anIndPrev = theInds(j-1);
Standard_Integer anIndNext = theInds(j+1);
- Standard_Real sina;
Standard_Integer ici = (anIndPrev - aCurv.Lower()) * theDim,
ici1 = (anIndNext - aCurv.Lower()) * theDim,
icm = (anInd - aCurv.Lower()) * theDim;
}
//mp *= 2.; //P(j,i) = -P(i,j);
//
- sina = mp/(m1*m2);
- sina = Sqrt(sina);
- if(sina > aSinCoeff)
+ if(mp > aSinCoeff2 * m1 * m2) // Sqrt (mp/(m1*m2)) > aSinCoeff
{
//Insert new knots
Standard_Real d1 = Abs(aCurv(anInd) - aCurv(anIndPrev));
{
if(ChkCurv)
{
- Standard_Real sina;
Standard_Integer ici = (anInd - theCurv.Lower()) * theDim,
ici1 = (anInd1 - theCurv.Lower()) * theDim,
icm = (mid - theCurv.Lower()) * theDim;
}
//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;
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);
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
aPrevParam2 = aNextParam;
aPrevPnt2 = aNextPnt;
aPrevVec2 = aNextVec;
- aMod2PrevVec2 = aPrevVec2.SquareMagnitude();
j += 2;
continue;
}
aPrevParam2 = aParam2;
aPrevPnt2 = aPnt2;
aPrevVec2 = aVec2;
- aMod2PrevVec2 = aPrevVec2.SquareMagnitude();
++j;
}
}