EgtGeomKernel 1.5g2 :

- aggiunte intersezioni tra linee ed archi
- aggiunte intersezioni tra archi e archi
- aggiunte funzioni di utilità per angoli.
This commit is contained in:
Dario Sassi
2014-07-16 09:08:32 +00:00
parent 19fda49699
commit 56d6307a1c
19 changed files with 1357 additions and 99 deletions
+27
View File
@@ -726,3 +726,30 @@ CurveLine::LocToLoc( const Frame3d& frOri, const Frame3d& frDest)
return ( m_PtStart.ToGlob( frOri) && m_PtStart.ToLoc( frDest) &&
m_PtEnd.ToGlob( frOri) && m_PtEnd.ToLoc( frDest)) ;
}
//----------------------------------------------------------------------------
bool
CurveLine::CalcPointParamPosiz( const Point3d& ptP, bool bOnXY, double& dU, int& nPos) const
{
// vettore linea nel piano XY
Vector3d vtDir = m_PtEnd - m_PtStart ;
if ( bOnXY)
vtDir.z = 0 ;
if ( vtDir.IsSmall())
return false ;
// calcolo parametro
dU = ( ptP - m_PtStart) * vtDir / vtDir.SqLen() ;
// verifica posizione intersezione su linea
nPos = ICurve::PP_NULL ; // fuori
if ( ( dU * vtDir).IsSmall()) {
nPos = ICurve::PP_START ; // vicino a inizio
dU = max( dU, 0.) ;
}
else if ( (( 1 - dU) * vtDir).IsSmall()) {
nPos = ICurve::PP_END ; // vicino a fine
dU = min( dU, 1.) ;
}
else if ( dU > 0 && dU < 1)
nPos = ICurve::PP_MID ; // nell'interno
return true ;
}