EgtMachKernel :
- corretto calcolo angoli più vicini a quelli di lavorazione precedente.
This commit is contained in:
+6
-6
@@ -1015,18 +1015,18 @@ Machine::AdjustAngleInStroke( const STROKE& Stroke, double& dAng) const
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Machine::GetNearestAngleInStroke( int nId, double dAngRef, double& dAng) const
|
||||
Machine::GetNearestAngleInStroke( int nInd, double dAngRef, double& dAng) const
|
||||
{
|
||||
// se angolo fittizio (non esiste l'asse rotante corrispondente), non c'è alcunchè da fare
|
||||
if ( nId <= 0 || nId > int( m_vCalcRotAx.size()))
|
||||
if ( nInd < 0 || nInd >= int( m_vCalcRotAx.size()))
|
||||
return true ;
|
||||
// cerco l'angolo più vicino stando nella corsa
|
||||
while ( dAng - dAngRef > ANG_STRAIGHT && dAng - ANG_FULL >= m_vCalcRotAx[nId-1].stroke.Min)
|
||||
while ( dAng - dAngRef > ANG_STRAIGHT && dAng - ANG_FULL >= m_vCalcRotAx[nInd].stroke.Min)
|
||||
dAng -= ANG_FULL ;
|
||||
while ( dAng - dAngRef < - ANG_STRAIGHT && dAng + ANG_FULL <= m_vCalcRotAx[nId-1].stroke.Max)
|
||||
while ( dAng - dAngRef < - ANG_STRAIGHT && dAng + ANG_FULL <= m_vCalcRotAx[nInd].stroke.Max)
|
||||
dAng += ANG_FULL ;
|
||||
return ( dAng >= m_vCalcRotAx[nId-1].stroke.Min &&
|
||||
dAng <= m_vCalcRotAx[nId-1].stroke.Max) ;
|
||||
return ( dAng >= m_vCalcRotAx[nInd].stroke.Min &&
|
||||
dAng <= m_vCalcRotAx[nInd].stroke.Max) ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user