diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 5d5c08f..ea6fea0 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/MachineCalc.cpp b/MachineCalc.cpp index 36f0733..bf2867a 100644 --- a/MachineCalc.cpp +++ b/MachineCalc.cpp @@ -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) ; } //----------------------------------------------------------------------------