diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index f55ad18..fb07e83 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/Milling.cpp b/Milling.cpp index 3429cb0..2b5d7b1 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -4034,8 +4034,9 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT } bool bAdjustLoPerp = ( m_Params.m_dLoPerp > 10 * EPS_SMALL) ; if ( bAdjustLoPerp) { - m_Params.m_dLoTang = 0 ; - m_Params.m_dLoPerp = 0. ; + double dNewLoPerp = max( 0., m_Params.m_dLoPerp - ( nStep - 1) * dStep) ; + m_Params.m_dLoTang *= dNewLoPerp / m_Params.m_dLoPerp ; + m_Params.m_dLoPerp = dNewLoPerp ; } // ciclo sugli step @@ -4059,11 +4060,16 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT if ( ! TrimExtendCurveToClosedStm( pMyCompo, nTriExtCstm, bInvert)) pMyCompo.Set( pMyCopy) ; } - // dopo primo step annullo parametri di attacco - if ( j > 1 && bAdjustLiPerp) { + // se necessario e invertito oppure step successivo annullo parametri di attacco + if ( bAdjustLiPerp && ( bInvert || j == 2)) { m_Params.m_dLiPerp = 0. ; m_Params.m_dLiTang = 0. ; } + // se necessario e non invertito oppure step successivo annullo parametri di uscita + if ( bAdjustLoPerp && ( ! bInvert || j == 2)) { + m_Params.m_dLoPerp = 0. ; + m_Params.m_dLoTang = 0. ; + } // ciclo sulle curve elementari int nMaxInd = pMyCompo->GetCurveCount() - 1 ; for ( int i = 0 ; i <= nMaxInd ; ++ i) {