EgtGeomKernel 1.9l4 :
- fabs sostituito da abs - in Zmap razionalizzazione operazioni taglio spilloni - in SurfTriMesh UpdateFaceting senza più chiamate recursive.
This commit is contained in:
+16
-16
@@ -363,7 +363,7 @@ CurveComposite::FromPolyArc( const PolyArc& PA)
|
||||
if ( AreSamePointApprox( ptIni, ptFin))
|
||||
continue ;
|
||||
// se retta
|
||||
if ( fabs( dBulge) < EPS_SMALL) {
|
||||
if ( abs( dBulge) < EPS_SMALL) {
|
||||
// creo la retta
|
||||
PtrOwner<CurveLine> pCrvLine( CreateBasicCurveLine()) ;
|
||||
if ( IsNull( pCrvLine))
|
||||
@@ -724,7 +724,7 @@ CurveComposite::GetLocalBBox( BBox3d& b3Loc, int nFlag) const
|
||||
pCrvSmpl = GetNextCurve() ;
|
||||
}
|
||||
// se c'è estrusione, devo tenerne conto (curve componenti sempre con vtExtr e dThick nulli)
|
||||
if ( ! m_VtExtr.IsSmall() && fabs( m_dThick) > EPS_SMALL) {
|
||||
if ( ! m_VtExtr.IsSmall() && abs( m_dThick) > EPS_SMALL) {
|
||||
Point3d ptMinExtr = b3Loc.GetMin() + m_VtExtr * m_dThick ;
|
||||
Point3d ptMaxExtr = b3Loc.GetMax() + m_VtExtr * m_dThick ;
|
||||
b3Loc.Add( ptMinExtr) ;
|
||||
@@ -758,7 +758,7 @@ CurveComposite::GetBBox( const Frame3d& frRef, BBox3d& b3Ref, int nFlag) const
|
||||
pCrvSmpl = GetNextCurve() ;
|
||||
}
|
||||
// se c'è estrusione, devo tenerne conto (curve componenti sempre con vtExtr e dThick nulli)
|
||||
if ( ! m_VtExtr.IsSmall() && fabs( m_dThick) > EPS_SMALL) {
|
||||
if ( ! m_VtExtr.IsSmall() && abs( m_dThick) > EPS_SMALL) {
|
||||
Vector3d vtFrExtr = m_VtExtr ;
|
||||
vtFrExtr.ToGlob( frRef) ;
|
||||
Point3d ptMinExtr = b3Ref.GetMin() + vtFrExtr * m_dThick ;
|
||||
@@ -1062,11 +1062,11 @@ CurveComposite::GetIndSCurveAndLocPar( double dU, Side nS, int& nSCrv, double& d
|
||||
// determino la curva di appartenenza e il valore locale (ovvero nella curva) del parametro
|
||||
nSCrv = static_cast<int>( dU) ;
|
||||
dLocU = dU - nSCrv ;
|
||||
if ( fabs( dLocU) < 5 * EPS_PARAM && nSCrv > 0 && nS == ICurve::FROM_MINUS) {
|
||||
if ( abs( dLocU) < 5 * EPS_PARAM && nSCrv > 0 && nS == ICurve::FROM_MINUS) {
|
||||
-- nSCrv ;
|
||||
dLocU = 1 ;
|
||||
}
|
||||
else if ( fabs( dLocU) > 1 - 5 * EPS_PARAM && nSCrv < dMaxU - 1 && nS == ICurve::FROM_PLUS) {
|
||||
else if ( abs( dLocU) > 1 - 5 * EPS_PARAM && nSCrv < dMaxU - 1 && nS == ICurve::FROM_PLUS) {
|
||||
++ nSCrv ;
|
||||
dLocU = 0 ;
|
||||
}
|
||||
@@ -1490,7 +1490,7 @@ bool
|
||||
CurveComposite::SimpleOffset( double dDist, int nType)
|
||||
{
|
||||
// se distanza di offset nulla, non devo fare alcunché
|
||||
if ( fabs( dDist) < EPS_SMALL)
|
||||
if ( abs( dDist) < EPS_SMALL)
|
||||
return true ;
|
||||
|
||||
// --- l'offset va effettuato in un piano perpendicolare al vettore estrusione ---
|
||||
@@ -2131,7 +2131,7 @@ bool
|
||||
CurveComposite::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, double dCoeffZ)
|
||||
{
|
||||
// verifico non sia nulla
|
||||
if ( fabs( dCoeffX) < EPS_ZERO && fabs( dCoeffY) < EPS_ZERO && fabs( dCoeffZ) < EPS_ZERO)
|
||||
if ( abs( dCoeffX) < EPS_ZERO && abs( dCoeffY) < EPS_ZERO && abs( dCoeffZ) < EPS_ZERO)
|
||||
return false ;
|
||||
|
||||
// calcolo bbox allineato con riferimento di scalatura e senza tener conto dello spessore
|
||||
@@ -2143,16 +2143,16 @@ CurveComposite::Scale( const Frame3d& frRef, double dCoeffX, double dCoeffY, dou
|
||||
return false ;
|
||||
swap( dOriThick, m_dThick) ;
|
||||
Vector3d vtDelta = b3Ref.GetMax() - b3Ref.GetMin() ;
|
||||
if ( fabs( vtDelta.x * dCoeffX) < EPS_SMALL &&
|
||||
fabs( vtDelta.y * dCoeffY) < EPS_SMALL &&
|
||||
fabs( vtDelta.z * dCoeffZ) < EPS_SMALL)
|
||||
if ( abs( vtDelta.x * dCoeffX) < EPS_SMALL &&
|
||||
abs( vtDelta.y * dCoeffY) < EPS_SMALL &&
|
||||
abs( vtDelta.z * dCoeffZ) < EPS_SMALL)
|
||||
return false ;
|
||||
|
||||
// imposto ricalcolo della grafica
|
||||
m_OGrMgr.Reset() ;
|
||||
|
||||
// se scalatura non omogenea, devo trasformare tutti gli archi in curve di Bezier
|
||||
if ( fabs( dCoeffX - dCoeffY) > EPS_SMALL || fabs( dCoeffX - dCoeffZ) > EPS_SMALL) {
|
||||
if ( abs( dCoeffX - dCoeffY) > EPS_SMALL || abs( dCoeffX - dCoeffZ) > EPS_SMALL) {
|
||||
if ( ! ArcsToBezierCurves())
|
||||
return false ;
|
||||
}
|
||||
@@ -2435,9 +2435,9 @@ CurveComposite::IsParamAtJoint( double dU) const
|
||||
{
|
||||
// se aperta e all'inizio o alla fine o lontano dagli interi non è giunzione
|
||||
bool bClosed = IsClosed() ;
|
||||
if ( ( ! bClosed && fabs( dU) < EPS_PARAM) ||
|
||||
( ! bClosed && fabs( dU - double( m_CrvSmplS.size())) < EPS_PARAM) ||
|
||||
fabs( dU - (int) ( dU + EPS_PARAM)) > EPS_PARAM)
|
||||
if ( ( ! bClosed && abs( dU) < EPS_PARAM) ||
|
||||
( ! bClosed && abs( dU - double( m_CrvSmplS.size())) < EPS_PARAM) ||
|
||||
abs( dU - (int) ( dU + EPS_PARAM)) > EPS_PARAM)
|
||||
return false ;
|
||||
else
|
||||
return true ;
|
||||
@@ -2633,7 +2633,7 @@ CurveComposite::MergeTwoCurves( ICurve* pCrvP, ICurve* pCrvC, double& dCurrLinTo
|
||||
if ( ! AreSamePointEpsilon( ptC1Fin, ptC2Ini, dCurrLinTol))
|
||||
return false ;
|
||||
// verifico la coincidenza dei raggi
|
||||
if ( fabs( pArcP->GetRadius() - pArcC->GetRadius()) > dCurrLinTol)
|
||||
if ( abs( pArcP->GetRadius() - pArcC->GetRadius()) > dCurrLinTol)
|
||||
return false ;
|
||||
// verifico la collinearità delle normali (tenendo conto del raggio)
|
||||
if ( ! (( pArcP->GetNormVersor() - pArcC->GetNormVersor()) * pArcP->GetRadius()).IsSmall() &&
|
||||
@@ -2672,7 +2672,7 @@ CurveComposite::MergeTwoCurves( ICurve* pCrvP, ICurve* pCrvC, double& dCurrLinTo
|
||||
}
|
||||
// verifico coincidenza pendenza sulla normale
|
||||
double dN = pArcP->GetNormVersor() * pArcC->GetNormVersor() ;
|
||||
if ( fabs(( pArcC->GetDeltaN() * pArcP->GetAngCenter() - dN * pArcP->GetDeltaN() * pArcC->GetAngCenter()) /
|
||||
if ( abs(( pArcC->GetDeltaN() * pArcP->GetAngCenter() - dN * pArcP->GetDeltaN() * pArcC->GetAngCenter()) /
|
||||
( pArcP->GetAngCenter() + pArcC->GetAngCenter())) < dCurrLinTol) {
|
||||
// se calcolo nuovo arco ok, procedo con l'unione
|
||||
Point3d ptP1 ;
|
||||
|
||||
Reference in New Issue
Block a user