From 7ab0f5c4a25b7d7ff8359741b2dd945666342a5c Mon Sep 17 00:00:00 2001 From: DarioS Date: Wed, 8 Jun 2022 11:41:32 +0200 Subject: [PATCH] EgtMachKernel 2.4f2 : - modifiche a fresature per caso con tavola tilting/asse a ralla - corretta in simulazione gestione errore collisione. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Milling.cpp | 27 +++++++++++++++++++++------ Simulator.cpp | 4 +++- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index 89d3e087327d14f57dab861d0256f42b29410a2e..89cc9ee5b4e86f850ca28fbb20c53385647773ce 100644 GIT binary patch delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 delta 97 zcmewt{V#gMFE&QQ&A-`fnHdcyKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU3rBY*$^ diff --git a/Milling.cpp b/Milling.cpp index b2dd76a..3490b37 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -3578,7 +3578,7 @@ Milling::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, } // se testa da sopra senza aggregato da sotto, approccio mai da Z negativo Vector3d vtAppr = vtTool ; - if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) { + if ( m_bAboveHead && ! m_bAggrBottom && ! m_bTiltingTab && vtTool.z < - EPS_SMALL) { vtAppr.z = 0 ; vtAppr.Normalize() ; } @@ -3677,7 +3677,7 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, { // se testa da sopra senza aggregato da sotto, retrazione mai da Z negativo Vector3d vtAppr = vtTool ; - if ( m_bAboveHead && ! m_bAggrBottom && vtTool.z < - EPS_SMALL) { + if ( m_bAboveHead && ! m_bAggrBottom && ! m_bTiltingTab && vtTool.z < - EPS_SMALL) { vtAppr.z = 0 ; vtAppr.Normalize() ; } @@ -5196,11 +5196,26 @@ Milling::GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool, const Vec Vector3d vtMove = ( m_bAboveHead ? Z_AX : -Z_AX) ; Vector3d vtSafe = vtCorr ; vtSafe.z = 0 ; vtSafe.Normalize() ; Point3d ptQ = ptP - ( vtSafe + vtMove) * max( 0.2 * dSafeZ, MIN_SAFEDIST) ; - if ( ! GetElevation( m_nPhase, ptQ, vtTool, 0.5 * m_TParams.m_dDiam, vtMove, dTemp) || dTemp > 10 * EPS_SMALL) - return false ; + bool bOut = true ; + if ( ! GetElevation( m_nPhase, ptQ, vtTool, 0.5 * m_TParams.m_dDiam, vtMove, dTemp) || dTemp > 10 * EPS_SMALL) { + bOut = false ; + if ( ! m_bTiltingTab) + return false ; + } Point3d ptR = ptP + vtTool * m_TParams.m_dThick ; - if ( ! GetElevation( m_nPhase, ptR, vtTool, 0.5 * m_TParams.m_dDiam, vtMove, dTemp) || dTemp > 10 * EPS_SMALL) - return false ; + if ( ! GetElevation( m_nPhase, ptR, vtTool, 0.5 * m_TParams.m_dDiam, vtMove, dTemp) || dTemp > 10 * EPS_SMALL) { + bOut = false ; + if ( ! m_bTiltingTab) + return false ; + } + // se tavola rotante (o asse basculante) e non esterno, provo in direzione utensile + if ( m_bTiltingTab && ! bOut) { + vtMove = vtTool ; + if ( ! GetElevation( m_nPhase, ptQ, vtTool, 0.5 * m_TParams.m_dDiam, vtMove, dTemp) || dTemp > 10 * EPS_SMALL) + return false ; + if ( ! GetElevation( m_nPhase, ptR, vtTool, 0.5 * m_TParams.m_dDiam, vtMove, dTemp) || dTemp > 10 * EPS_SMALL) + return false ; + } return true ; } } diff --git a/Simulator.cpp b/Simulator.cpp index e567122..7971b4f 100644 --- a/Simulator.cpp +++ b/Simulator.cpp @@ -1879,8 +1879,10 @@ Simulator::OnCollision( int nCdInd, int nObjInd, int& nErr) // verifico codice di errore m_pMachine->LuaGetGlobVar( GLOB_VAR + GVAR_ERR, nErr) ; // l'errore standard di collisione è stato portato da 1 a 11 per non collidere con altri tipi di errori - if ( nErr == 1) + if ( nErr == 1) { nErr = 11 ; + m_pMachine->LuaSetGlobVar( GLOB_VAR + GVAR_ERR, nErr) ; + } return ( nErr == 0) ; }