From 727025d2311ce1b8d464fc85ebe52b713f3a7a53 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 3 Mar 2025 17:24:57 +0100 Subject: [PATCH] EgtMachKernel : - ripristino stato progetto se non si riesce ad impostare il gruppo corrente causa errore in disposizione - in finitura superfici modifica offset silhouette per eliminazione punti inutili a Zminima. --- MachMgrMachGroups.cpp | 4 +++- SurfFinishing.cpp | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MachMgrMachGroups.cpp b/MachMgrMachGroups.cpp index 0956b74..cd2eb33 100644 --- a/MachMgrMachGroups.cpp +++ b/MachMgrMachGroups.cpp @@ -387,8 +387,10 @@ MachMgr::SetCurrMachGroup( int nId) // aggiorno attrezzaggio attivo UpdateCurrSetup() ; // imposto la prima fase come corrente - if ( ! SetCurrPhase( 1)) + if ( ! SetCurrPhase( 1)) { + ResetCurrMachGroup() ; return false ; + } // nascondo i pezzi rimasti sotto la radice ShowRootParts( false) ; // rendo visibile il nuovo gruppo corrente e la relativa macchina diff --git a/SurfFinishing.cpp b/SurfFinishing.cpp index c6c0b42..51ee11b 100644 --- a/SurfFinishing.cpp +++ b/SurfFinishing.cpp @@ -1594,6 +1594,8 @@ SurfFinishing::ProcessSfr( int nPathId, int nPvId, int nClId) return false ; } // creo la regione piana dalle PolyLine ricavate dalla Silhouette + const double SILH_ARC_TOL = 0.1 * SILH_TOL ; + const double SILH_ARC_FEA_MAX = 100. ; SurfFlatRegionByContours SfrMaker ; for ( auto& PL : vPL) { // recupero la curva dalla silhouette @@ -1602,8 +1604,6 @@ SurfFinishing::ProcessSfr( int nPathId, int nPvId, int nClId) return false ; pSilCrv->FromPolyLine( PL) ; // approssimo con archi - const double SILH_ARC_TOL = 0.1 * SILH_TOL ; - const double SILH_ARC_FEA_MAX = 100. ; PolyArc PA ; if ( pSilCrv->ApproxWithArcsEx( SILH_ARC_TOL, ANG_TOL_STD_DEG, SILH_ARC_FEA_MAX, PA)) { PtrOwner pTempCrv( CreateCurveComposite()) ; @@ -1622,7 +1622,7 @@ SurfFinishing::ProcessSfr( int nPathId, int nPvId, int nClId) PtrOwner pSfrSil( SfrMaker.GetSurf()) ; if ( ! IsNull( pSfrSil)) { pSfrSil->ToGlob( frSurf) ; - double dPockRadOffs = m_TParams.m_dDiam - m_Params.m_dSideStep - m_Params.m_dOverlap ; + double dPockRadOffs = SILH_ARC_TOL ; pSfrSil->Offset( dPockRadOffs, ICurve::OFF_CHAMFER) ; // intersezione tra contorno e regione if ( ! pSfrCnt->Intersect( *pSfrSil)) {