EgtMachKernel :

- correzione per gestire archi su macchine con assi rotanti su tavola.
This commit is contained in:
Dario Sassi
2020-09-22 07:48:13 +00:00
parent 648d080090
commit 61d0c583e8
5 changed files with 38 additions and 1 deletions
+1
View File
@@ -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 ;
+10
View File
@@ -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
+1
View File
@@ -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 ;
+23
View File
@@ -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
View File
@@ -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()) ;