EgtMachKernel :
- correzione per gestire archi su macchine con assi rotanti su tavola.
This commit is contained in:
@@ -421,6 +421,7 @@ class MachMgr : public IMachMgr
|
||||
bool IsKinematicRotAxisBlocked( int nInd) const ;
|
||||
int GetCalcTool( void) const ;
|
||||
double GetCalcRot1W( void) const ;
|
||||
bool GetCalcPartDirFromAngles( const Vector3d& vtPart, const DBLVECTOR& vAng, Vector3d& vtDir) const ;
|
||||
bool SetCalcSolCh( int nScc, bool bExact) ;
|
||||
bool VerifyAngleOutstroke( int nInd, double dAng) const ;
|
||||
bool VerifyOutstroke( double dX, double dY, double dZ, const DBLVECTOR& vAng, bool bClear, int& nStat) const ;
|
||||
|
||||
@@ -651,6 +651,16 @@ MachMgr::GetCalcAuxDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const
|
||||
return pMch->GetAuxDirFromAngles( vAng, vtDir) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetCalcPartDirFromAngles( const Vector3d& vtPart, const DBLVECTOR& vAng, Vector3d& vtDir) const
|
||||
{
|
||||
Machine* pMch = GetCurrMachine() ;
|
||||
if ( pMch == nullptr)
|
||||
return false ;
|
||||
return pMch->GetPartDirFromAngles( vtPart, vAng, vtDir) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
MachMgr::GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const
|
||||
|
||||
@@ -131,6 +131,7 @@ class Machine
|
||||
bool bBottom, bool bOverall, Point3d& ptTip) const ;
|
||||
bool GetToolDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const ;
|
||||
bool GetAuxDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const ;
|
||||
bool GetPartDirFromAngles( const Vector3d& vtPart, const DBLVECTOR& vAng, Vector3d& vtDir) const ;
|
||||
bool GetBackToolDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const ;
|
||||
bool GetBackAuxDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const ;
|
||||
bool GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const ;
|
||||
|
||||
@@ -1191,6 +1191,29 @@ Machine::GetAuxDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const
|
||||
return GetDirection( m_vtCalcADir, vAng, vtDir) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::GetPartDirFromAngles( const Vector3d& vtPart, const DBLVECTOR& vAng, Vector3d& vtDir) const
|
||||
{
|
||||
// è espressa nel riferimento di macchina (tiene conto delle sole rotazioni di tavola)
|
||||
|
||||
// verifico dimensione vettore angoli rispetto al numero di assi rotanti
|
||||
if ( vAng.size() < m_vCalcRotAx.size())
|
||||
return false ;
|
||||
|
||||
// direzione a riposo
|
||||
vtDir = vtPart ;
|
||||
|
||||
// ciclo sugli assi dal primo (solo assi di tavola)
|
||||
for ( size_t i = 1 ; i <= m_vCalcRotAx.size() ; ++ i) {
|
||||
// se asse di tavola
|
||||
if ( ! m_vCalcRotAx[i-1].bHead)
|
||||
vtDir.Rotate( m_vCalcRotAx[i-1].vtDir, vAng[i-1]) ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::GetBackToolDirFromAngles( const DBLVECTOR& vAng, Vector3d& vtDir) const
|
||||
|
||||
+3
-1
@@ -1510,7 +1510,9 @@ Operation::CalculateClPathAxesValues( int nClPathId, int nLinAxes, int nRotAxes,
|
||||
if ( pCurve->GetType() == CRV_ARC) {
|
||||
ICurveArc* pArc = GetCurveArc( pCurve) ;
|
||||
// verifico il piano
|
||||
if ( pArc->GetNormVersor() * pCamData->GetNormDir() < 0)
|
||||
Vector3d vtRef ;
|
||||
m_pMchMgr->GetCalcPartDirFromAngles( pCamData->GetNormDir(), vAngEnd, vtRef) ;
|
||||
if ( pArc->GetNormVersor() * vtRef < 0)
|
||||
pArc->InvertN() ;
|
||||
// assegno il centro e il raggio di questo arco ai dati cam
|
||||
pCamData->SetAxesCen( pArc->GetCenter()) ;
|
||||
|
||||
Reference in New Issue
Block a user