From 9267f902aea9acda9f7e9e32e7604f8d408e2a42 Mon Sep 17 00:00:00 2001 From: Riccardo Elitropi Date: Wed, 29 Nov 2023 12:41:34 +0100 Subject: [PATCH] EgtMachKernel : merge con Master. --- Pocketing.cpp | 66 +++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Pocketing.cpp b/Pocketing.cpp index ca1dd9d..7e3ab2a 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -3168,11 +3168,11 @@ Pocketing::AddZigZag( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, c double dStElev = dSink ; dStElev -= ( ptP1 - ptStart) * vtExtr ; // se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco - if ( GetLeadInType() == POCKET_LI_ZIGZAG || - GetLeadInType() == POCKET_LI_HELIX || - GetLeadInType() == POCKET_LI_GLIDE) { - ptP1 += vtExtr * dStElev ; - dStElev = 0 ; + if ( GetLeadInType() == POCKET_LI_ZIGZAG || + GetLeadInType() == POCKET_LI_HELIX || + GetLeadInType() == POCKET_LI_GLIDE) { + ptP1 += vtExtr * ( dStElev + LIO_ELEV_TOL) ; + dStElev = -LIO_ELEV_TOL ; } // approccio al punto iniziale if ( ! AddLinkApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, @@ -4681,11 +4681,11 @@ Pocketing::AddOneWay( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, c dStElev = max( dStElev, j * dStep) ; dStElev -= ( ptP1 - ptStart) * vtExtr ;*/ // se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco - if ( GetLeadInType() == POCKET_LI_ZIGZAG || - GetLeadInType() == POCKET_LI_HELIX || - GetLeadInType() == POCKET_LI_GLIDE) { - ptP1 += vtExtr * dStElev ; - dStElev = 0 ; + if ( GetLeadInType() == POCKET_LI_ZIGZAG || + GetLeadInType() == POCKET_LI_HELIX || + GetLeadInType() == POCKET_LI_GLIDE) { + ptP1 += vtExtr * ( dStElev + LIO_ELEV_TOL) ; + dStElev = -LIO_ELEV_TOL ; } // approccio al punto iniziale // false sempre ? if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, vbMidOut[u] || vbForcedOutStart[u])) { @@ -5177,11 +5177,11 @@ Pocketing::AddSpiralIn( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, double dStElev = dSink ; dStElev -= ( ptP1 - ptStart) * vtExtr ; // se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco - if ( GetLeadInType() == POCKET_LI_ZIGZAG || - GetLeadInType() == POCKET_LI_HELIX || - GetLeadInType() == POCKET_LI_GLIDE) { - ptP1 += vtExtr * dStElev ; - dStElev = 0 ; + if ( GetLeadInType() == POCKET_LI_ZIGZAG || + GetLeadInType() == POCKET_LI_HELIX || + GetLeadInType() == POCKET_LI_GLIDE) { + ptP1 += vtExtr * ( dStElev + LIO_ELEV_TOL) ; + dStElev = -LIO_ELEV_TOL ; } // approccio al punto iniziale if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart || bForcedOutStart)) { @@ -5524,11 +5524,11 @@ Pocketing::AddSpiralOut( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool dStElev = max( dStElev, j * dStep) ; dStElev -= ( ptP1 - ptStart) * vtExtr ; // se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco - if ( GetLeadInType() == POCKET_LI_ZIGZAG || - GetLeadInType() == POCKET_LI_HELIX || - GetLeadInType() == POCKET_LI_GLIDE) { - ptP1 += vtExtr * dStElev ; - dStElev = 0 ; + if ( GetLeadInType() == POCKET_LI_ZIGZAG || + GetLeadInType() == POCKET_LI_HELIX || + GetLeadInType() == POCKET_LI_GLIDE) { + ptP1 += vtExtr * ( dStElev + LIO_ELEV_TOL) ; + dStElev = -LIO_ELEV_TOL ; } // approccio al punto iniziale if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, false)) { @@ -8742,7 +8742,7 @@ Pocketing::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafe // se con aggregato da sotto o equivalente (rinvio a 90 gradi su testa 5 assi) bool bBottomOutStart = false ; if ( m_bAggrBottom) { - // distanza dal bordo del pezzo (se negativa il punto è fuori dal grezzo) + // distanza dal bordo del pezzo (se negativa il punto � fuori dal grezzo) double dDistBottom ; if ( ! GetDistanceFromRawSide( m_nPhase, ptP, m_vtAggrBottom, dDistBottom)) dDistBottom = 0 ; @@ -8772,7 +8772,7 @@ Pocketing::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafe SetFlag( 0) ; } } - // se sopra attacco c'è spazio per sicurezza o approccio + // se sopra attacco c'� spazio per sicurezza o approccio double dSafeDist = ( m_bAggrBottom ? dSafeAggrBottZ : dSafeZ) ; if ( ! bBottomOutStart && dElev + max( dSafeDist, dAppr) > 10 * EPS_SMALL) { Point3d ptP1 = ptP + vtTool * ( dElev + dAppr) ; @@ -15042,18 +15042,18 @@ Pocketing::GetHomogeneousParts( ICurveComposite* pCrvCompo, ICURVEPOVECTOR& vCrv } // unisco il primo e l'ultimo tratto chiuso, avendo cambiato l'inizio e la fine -#if 0 : - if ( vCrvClose.size() > 0 && bCallAdjust) { - PtrOwner pCrvCompoFirstLast( CreateCurveComposite()) ; - if ( IsNull( pCrvCompoFirstLast)) - return false ; - pCrvCompoFirstLast->AddCurve( vCrvClose.back()->Clone()) ; - pCrvCompoFirstLast->AddCurve( vCrvClose.front()->Clone()) ; - vCrvClose.front().Set( Release( pCrvCompoFirstLast)) ; - if ( int( vCrvClose.size() != 1)) - vCrvClose.pop_back() ; + if ( false) { + if ( vCrvClose.size() > 0 && bCallAdjust) { + PtrOwner pCrvCompoFirstLast( CreateCurveComposite()) ; + if ( IsNull( pCrvCompoFirstLast)) + return false ; + pCrvCompoFirstLast->AddCurve( vCrvClose.back()->Clone()) ; + pCrvCompoFirstLast->AddCurve( vCrvClose.front()->Clone()) ; + vCrvClose.front().Set( Release( pCrvCompoFirstLast)) ; + if ( int( vCrvClose.size() != 1)) + vCrvClose.pop_back() ; + } } -#endif return true ; }