From 50ebe36cd1770392cba97249f5f5cf2558eb2e52 Mon Sep 17 00:00:00 2001 From: Riccardo Elitropi Date: Thu, 27 Jun 2024 12:34:37 +0200 Subject: [PATCH] EgtMachKernel : - migliorie entrate Elica e ZigZag. --- SurfRoughing.cpp | 14 ++++++++++++-- SurfRoughing.h | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/SurfRoughing.cpp b/SurfRoughing.cpp index d375abe..d7e6278 100644 --- a/SurfRoughing.cpp +++ b/SurfRoughing.cpp @@ -1478,7 +1478,7 @@ SurfRoughing::ProcessPath( int nPathId, int nTempId, int nPvId, int nClId) // Eseguo le svuotature double dElev = dDepth ; - if ( ! AddPocket( vPocket, vtTool, vtExtr, dDepth, dElev, dStep, bSplitArcs)) + if ( ! AddPocket( vPocket, vtTool, vtExtr, dElev, dStep, bSplitArcs)) return false ; } @@ -1672,7 +1672,7 @@ SurfRoughing::GetActiveSurfaces( INTVECTOR& vSurfId) const //---------------------------------------------------------------------------- bool SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, const Vector3d& vtExtr, - double dDepth, double dElev, double dStep, bool bSplitArcs) + double dElev, double dStep, bool bSplitArcs) { // recupero distanze di sicurezza double dSafeZ = GetSafeZ() ; @@ -1683,6 +1683,7 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co // ciclo sulle regioni bool bStart = true ; + int nBasicStep = -1 ; for ( auto& vId : vPocket) { // recupero la superficie da lavorare ( è il primo indice ) @@ -1700,6 +1701,8 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co // se il tipo è SPIRAL_OUT e sto gestendo uno step intermedio, lo lavoro come SPIRAL_IN if ( nSubType == SURFROU_SUB_SPIRALOUT && bIsSubStep) nSubType = SURFROU_SUB_SPIRALIN ; + if ( ! bIsSubStep) + ++ nBasicStep ; ICRVCOMPOPOVECTOR vpCrvs ; // percorso di svuotatura // se si tratta di uno step base, allora lavoro l'intera superficie @@ -1779,6 +1782,13 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co m_pMchMgr->SetLastError( 3012, "Error in SurfRoughing : Link not computable") ; return false ; } + if ( ! bIsSubStep) { + ptP1 -= ( nBasicStep * dStep) * vtTool ; + SetFeed( GetTipFeed()) ; + SetFlag( 0) ; + if ( AddLinearMove( ptP1) == GDB_ID_NULL) + return false ; + } } // aggiungo attacco SetFeed( GetStartFeed()) ; diff --git a/SurfRoughing.h b/SurfRoughing.h index 88fbd98..9617ab3 100644 --- a/SurfRoughing.h +++ b/SurfRoughing.h @@ -77,7 +77,7 @@ class SurfRoughing : public Machining bool Chain( int nGrpDestId) ; bool ProcessPath( int nPathId, int nTempId, int nPvId, int nClId) ; bool AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, const Vector3d& vtExtr, - double dDepth, double dElev, double dStep, bool bSplitArcs) ; + double dElev, double dStep, bool bSplitArcs) ; bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ; bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ; bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dElev, double dAppr) ;