From c4af1502b43b90a433310c7fed79e08bf4abc8ce Mon Sep 17 00:00:00 2001 From: DarioS Date: Tue, 22 Jun 2021 11:08:00 +0200 Subject: [PATCH] EgtMachKernel 2.3f2 : - in svuotatura aggiunta gestione attacchi a spirale con mole a tazza (non lavorano di testa) - in svuotatura modificato preview. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Pocketing.cpp | 35 ++++++++++++++++++++++------------- Pocketing.h | 4 ++++ 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index e04e26ef1e4cf1bfae8a5827d3470ca7212c2e35..22e51876cea3f8c6528e9e35860857e0cd7b264f 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/Pocketing.cpp b/Pocketing.cpp index d38f1f7..1bb5594 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -1835,8 +1835,9 @@ Pocketing::GeneratePocketingPv( int nPathId, const ICurveComposite* pCompo) if ( IsNull( pCrv)) return false ; // calcolo la regione - PtrOwner pSfr ; - pSfr.Set( GetSurfFlatRegionFromFatCurve( Release( pCrv), 0.5 * m_TParams.m_dDiam, false, false)) ; + SurfFlatRegionByContours SfrCntrRr ; + SfrCntrRr.AddCurve( Release( pCrv)) ; + PtrOwner pSfr( SfrCntrRr.GetSurf()) ; if ( IsNull( pSfr)) return false ; // ne recupero il contorno @@ -1850,7 +1851,7 @@ Pocketing::GeneratePocketingPv( int nPathId, const ICurveComposite* pCompo) return false ; // assegno nome e colore m_pGeomDB->SetName( nC2Id, MCH_PV_CUT) ; - m_pGeomDB->SetMaterial( nC2Id, LIME) ; + m_pGeomDB->SetMaterial( nC2Id, RED) ; // eventuali altri contorni ( interni di contornatura chiusa) const int MAX_INT_LOOP = 1000 ; for ( int i = 1 ; i <= MAX_INT_LOOP ; ++i) { @@ -1864,14 +1865,14 @@ Pocketing::GeneratePocketingPv( int nPathId, const ICurveComposite* pCompo) return false ; // assegno nome e colore m_pGeomDB->SetName( nC3Id, MCH_PV_CUT) ; - m_pGeomDB->SetMaterial( nC3Id, LIME) ; + m_pGeomDB->SetMaterial( nC3Id, RED) ; } // inserisco la regione nel DB int nRId = m_pGeomDB->AddGeoObj( GDB_ID_NULL, nPathId, Release( pSfr)) ; if ( nRId == GDB_ID_NULL) return false ; m_pGeomDB->SetName( nRId, MCH_PV_RCUT) ; - m_pGeomDB->SetMaterial( nRId, INVISIBLE) ; + m_pGeomDB->SetMaterial( nRId, Color( 255, 0, 0, 60)) ; // la copio anche come regione ridotta int nRrId = m_pGeomDB->Copy( nRId, GDB_ID_NULL, nPathId) ; if ( nRrId == GDB_ID_NULL) @@ -1909,8 +1910,10 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con // se utensile che non lavora di testa poichè ingresso non fuori dal pezzo, errore if ( m_TParams.m_nType == TT_MILL_NOTIP) { - m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; - return false ; + if ( ! LeadInIsOk()) { + m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; + return false ; + } } // determino numero e affondamento degli step @@ -2454,8 +2457,10 @@ Pocketing::AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, con // se utensile che non lavora di testa poichè ingresso non fuori dal pezzo, errore if ( m_TParams.m_nType == TT_MILL_NOTIP) { - m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; - return false ; + if ( ! LeadInIsOk()) { + m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; + return false ; + } } // determino numero e affondamento degli step @@ -2780,8 +2785,10 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c // se utensile che non lavora di testa e ingresso non fuori dal pezzo, errore if ( m_TParams.m_nType == TT_MILL_NOTIP && ! bOutStart) { - m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; - return false ; + if ( ! LeadInIsOk()) { + m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; + return false ; + } } // determino numero e affondamento degli step @@ -2941,8 +2948,10 @@ Pocketing::AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, // se utensile che non lavora di testa poichè ingresso non fuori dal pezzo, errore if ( m_TParams.m_nType == TT_MILL_NOTIP) { - m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; - return false ; + if ( ! LeadInIsOk()) { + m_pMchMgr->SetLastError( 2431, "Error in Pocketing : LeadIn with Mill NoTip in material") ; + return false ; + } } // ciclo sulle regioni diff --git a/Pocketing.h b/Pocketing.h index 89ec6e3..72b8bf3 100644 --- a/Pocketing.h +++ b/Pocketing.h @@ -134,6 +134,10 @@ class Pocketing : public Machining if ( m_Params.m_nLeadInType != POCKET_LI_GLIDE && m_Params.m_dLiElev < 10 * EPS_SMALL) return POCKET_LI_NONE ; return m_Params.m_nLeadInType ; } + int LeadInIsOk( void) const + { if ( m_TParams.m_nType != TT_MILL_NOTIP) + return true ; + return ( GetLeadInType() == POCKET_LI_HELIX && m_Params.m_dLiTang >= 0.49 * m_TParams.m_dDiam && m_Params.m_dLiElev <= 2) ; } int GetLeadOutType( void) const { if ( m_Params.m_dLoTang < std::min( 0.1 * m_TParams.m_dDiam, 1.0)) return POCKET_LO_NONE ;