EgtGeomKernel 1.5j1 :

- modifica sui punti medi (ora sempre a metà lunghezza)
- correzioni a GetParamAtLength delle curve.
This commit is contained in:
Dario Sassi
2014-10-14 06:50:57 +00:00
parent ee0c3830ef
commit 1e2d4dfc59
7 changed files with 48 additions and 17 deletions
+20 -7
View File
@@ -869,16 +869,29 @@ CurveComposite::GetMidPoint( Point3d& ptMid) const
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// determino il valore medio del parametro della curva
double dStart, dEnd, dMid ;
GetDomain( dStart, dEnd) ;
dMid = 0.5 * ( dStart + dEnd) ;
// determino il valore del parametro a metà lunghezza
double dLen, dMid ;
if ( ! GetLength( dLen) || ! GetParamAtLength( 0.5 * dLen, dMid))
return false ;
// calcolo il punto
return GetPointD1D2( dMid, FROM_MINUS, ptMid) ;
}
//----------------------------------------------------------------------------
bool
CurveComposite::GetMidDir( Vector3d& vtDir) const
{
// verifico lo stato
if ( m_nStatus != OK)
return false ;
// determino il valore del parametro a metà lunghezza
double dLen, dMid ;
if ( ! GetLength( dLen) || ! GetParamAtLength( 0.5 * dLen, dMid))
return false ;
// calcolo la direzione
return ::GetTang( *this, 0.5 * m_nCounter, FROM_MINUS, vtDir) ;
}
//----------------------------------------------------------------------------
bool
CurveComposite::GetDomain( double& dStart, double& dEnd) const
@@ -1064,7 +1077,7 @@ CurveComposite::GetParamAtLength( double dLen, double& dU) const
}
}
return false ;
return true ;
}
//----------------------------------------------------------------------------