EgtMachKernel :

- migliorata gestione angoli indeterminati con SCC e DirAux.
This commit is contained in:
Dario Sassi
2017-01-23 07:30:30 +00:00
parent 868559c293
commit 43ee7ed105
4 changed files with 28 additions and 7 deletions
+26 -4
View File
@@ -754,9 +754,11 @@ Machine::GetMyAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
// se indeterminato, provo a determinarlo con la direzione ausiliaria
if ( ! bDet2) {
bool bDetX ;
vtDirI2.GetRotation( vtDirAn, vtAx1, dAngA2, bDetX) ;
Vector3d vtSccDir ;
bool bSccDir = GetSccDir( m_nCalcSolCh, vtDirAn, vtSccDir) ;
vtDirI2.GetRotation( vtSccDir, vtAx1, dAngA2, bDetX) ;
if ( bDetX)
bDet2 = true ;
bDet2 = bSccDir ;
else
dAngA2 = 0 ;
}
@@ -775,9 +777,11 @@ Machine::GetMyAngles( const Vector3d& vtDirT, const Vector3d& vtDirA,
// se indeterminato, provo a determinarlo con la direzione ausiliaria
if ( ! bDet1) {
bool bDetX ;
vtDirI1.GetRotation( vtDirAn, vtAx1, dAngA1, bDetX) ;
Vector3d vtSccDir ;
bool bSccDir = GetSccDir( m_nCalcSolCh, vtDirAn, vtSccDir) ;
vtDirI1.GetRotation( vtSccDir, vtAx1, dAngA1, bDetX) ;
if ( bDetX)
bDet1 = true ;
bDet1 = bSccDir ;
else
dAngA1 = 0 ;
}
@@ -1012,6 +1016,24 @@ Machine::GetToolDirFromAngles( double dAngA, double dAngB, Vector3d& vtDir) cons
return GetDirection( m_vtCalcDir, vAng, vtDir) ;
}
//----------------------------------------------------------------------------
bool
Machine::GetSccDir( int nSolCh, const Vector3d& vtDirA, Vector3d& vtDirScc) const
{
switch ( nSolCh) {
case MCH_SCC_ADIR_XP : vtDirScc = X_AX ; return true ;
case MCH_SCC_ADIR_XM : vtDirScc = - X_AX ; return true ;
case MCH_SCC_ADIR_YP : vtDirScc = Y_AX ; return true ;
case MCH_SCC_ADIR_YM : vtDirScc = - Y_AX ; return true ;
case MCH_SCC_ADIR_ZP : vtDirScc = Z_AX ; return true ;
case MCH_SCC_ADIR_ZM : vtDirScc = - Z_AX ; return true ;
case MCH_SCC_ADIR_NEAR : vtDirScc = vtDirA ; return true ;
case MCH_SCC_ADIR_FAR : vtDirScc = - vtDirA ; return true ;
}
vtDirScc = vtDirA ;
return false ;
}
//----------------------------------------------------------------------------
bool
Machine::VerifyScc( const Vector3d& vtDirI, const Vector3d& vtDirA, int nSolCh) const