From 43267f53e416b664bbd90f98032d0e8fbfc348a9 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 30 Sep 2019 09:23:39 +0000 Subject: [PATCH] EgtMachKernel 2.1i3 : - in Pocketing con SpiralIn se ci sono lati aperti si cerca l'ingresso da fuori. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes Pocketing.cpp | 16 ++++++++++++++-- Pocketing.h | 2 +- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index bb134880784cbc7d6279b09250d06bbba647d82a..690a2e141eb909ff6100192b547ae0c98109c84e 100644 GIT binary patch delta 97 zcmewt{V#gMFE&Qw&A-`fnHh~IKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmUD-Bai?9 delta 97 zcmewt{V#gMFE&P_&A-`fnHh~HKa|wnoW?bQ1uSxrY4Qod0+^@}R1`^_2jk{d(jGv4 NK<#LXK~l;gTmU8!BZvS1 diff --git a/Pocketing.cpp b/Pocketing.cpp index 0b416d7..c1aebc7 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -1621,7 +1621,7 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId) return false ; break ; case POCKET_SUB_SPIRALIN : - if ( ! AddSpiralIn( pCompo, vtTool, vtExtr, dDepth, dElev, dOkStep, bSplitArcs)) + if ( ! AddSpiralIn( pCompo, vtTool, vtExtr, dDepth, dElev, dOkStep, bSplitArcs, bMidOpen, ptMidOpen)) return false ; break ; case POCKET_SUB_SPIRALOUT : @@ -2594,7 +2594,7 @@ Pocketing::AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, con //---------------------------------------------------------------------------- bool Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr, - double dDepth, double dElev, double dOkStep, bool bSplitArcs) + double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bMidOpen, const Point3d& ptMidOpen) { // recupero distanze di sicurezza double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ; @@ -2620,6 +2620,18 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c if ( pMCrv->GetCurveCount() == 0) break ; ++ nReg ; + + // se prima regione e gestione lato aperto + if ( nReg == 1 && bMidOpen) { + // premetto alla spirale la partenza da fuori + Point3d ptStart ; pMCrv->GetStartPoint( ptStart) ; + Vector3d vtMove = ptMidOpen - ptStart ; vtMove.Normalize() ; + Point3d ptOut = ptMidOpen + vtMove * ( 0.5 * m_TParams.m_dDiam + dSafeZ) ; + pMCrv->AddLine( ptOut, false) ; + // aggiungo al ritorno l'uscita + Point3d ptEnd ; pRCrv->GetEndPoint( ptEnd) ; + pRCrv->AddLine( ptOut, true) ; + } // determino numero e affondamento degli step int nStep = 1 ; diff --git a/Pocketing.h b/Pocketing.h index 868a831..e2e5061 100644 --- a/Pocketing.h +++ b/Pocketing.h @@ -80,7 +80,7 @@ class Pocketing : public Machining bool AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr, double dDepth, double dElev, double dOkStep, bool bSplitArcs) ; bool AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr, - double dDepth, double dElev, double dOkStep, bool bSplitArcs) ; + double dDepth, double dElev, double dOkStep, bool bSplitArcs, bool bMidOpen, const Point3d& ptMidOpen) ; bool AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr, double dDepth, double dElev, double dOkStep, bool bSplitArcs) ; bool CalcSpiral( const ICurveComposite* pCompo, int nReg, bool bSplitArcs,