EgtMachKernel 2.4g3 :

- altra correzione per asse rotante con corsa nulla.
This commit is contained in:
DarioS
2022-07-15 07:40:16 +02:00
parent 91005b36ba
commit 0ec3726fc6
2 changed files with 19 additions and 10 deletions
+19 -10
View File
@@ -1418,14 +1418,26 @@ Machine::VerifyScc( const Vector3d& vtDirI, const Vector3d& vtDirA, int nSolCh,
bool
Machine::AdjustAngleInStroke( const STROKE& Stroke, double& dAng) const
{
// eseguo gli aggiustamenti
while ( dAng < Stroke.Min)
dAng += ANG_FULL ;
while ( dAng > Stroke.Max)
dAng -= ANG_FULL ;
// se asse rotante a corsa nulla
if ( Stroke.Max - Stroke.Min < EPS_ANG_SMALL) {
// se asse rotante vero
if ( Stroke.Max - Stroke.Min > EPS_ANG_SMALL) {
// eseguo gli aggiustamenti
while ( dAng < Stroke.Min)
dAng += ANG_FULL ;
while ( dAng > Stroke.Max)
dAng -= ANG_FULL ;
// verifico
return ( dAng >= Stroke.Min && dAng <= Stroke.Max) ;
}
// altrimenti asse rotante senza corsa
else {
// angolo di riferimento
double dStrokeMid = ( Stroke.Min + Stroke.Max) / 2 ;
// eseguo gli aggiustamenti
while ( dAng < dStrokeMid - EPS_ANG_SMALL)
dAng += ANG_FULL ;
while ( dAng > dStrokeMid + EPS_ANG_SMALL)
dAng -= ANG_FULL ;
// verifico
if ( abs( dAng - dStrokeMid) < EPS_ANG_SMALL) {
dAng = dStrokeMid ;
return true ;
@@ -1433,9 +1445,6 @@ Machine::AdjustAngleInStroke( const STROKE& Stroke, double& dAng) const
else
return false ;
}
// altrimenti assi rotante vero
else
return ( dAng >= Stroke.Min && dAng <= Stroke.Max) ;
}
//----------------------------------------------------------------------------