From 42ec369b8ff66fbb1e7dc0bbb16e4c13bc0e27e1 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 5 Oct 2018 14:04:38 +0000 Subject: [PATCH] EgtMachKernel : - correzioni a calcolo elevazione per percorsi di lavoro appena fuori dal grezzo - correzioni a recupero grezzo per percorsi di lavoro appena fuori dal grezzo. --- Chiseling.cpp | 4 ++-- Milling.cpp | 4 ++-- Mortising.cpp | 4 ++-- Operation.cpp | 11 +++++++---- Pocketing.cpp | 4 ++-- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Chiseling.cpp b/Chiseling.cpp index a52f8b1..16d3ad8 100644 --- a/Chiseling.cpp +++ b/Chiseling.cpp @@ -1153,7 +1153,7 @@ Chiseling::ProcessPath( int nPathId, int nPvId, int nClId) // recupero il box del grezzo in globale BBox3d b3Raw ; - if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dDiam, b3Raw) || b3Raw.IsEmpty()) { + if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dTDiam, b3Raw) || b3Raw.IsEmpty()) { m_pMchMgr->SetLastError( 2903, "Error in Chiseling : Empty RawBox") ; return false ; } @@ -1161,7 +1161,7 @@ Chiseling::ProcessPath( int nPathId, int nPvId, int nClId) // recupero distanza da fondo dei grezzi interessati dal percorso double dRbDist = 0 ; if ( AreSameVectorApprox( vtExtr, Z_AX)) { - if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dDiam, dRbDist)) + if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dTDiam, dRbDist)) return false ; } diff --git a/Milling.cpp b/Milling.cpp index 94089fa..11bd988 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -1398,7 +1398,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId) // recupero il box del grezzo in globale BBox3d b3Raw ; - if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dDiam, b3Raw) || b3Raw.IsEmpty()) { + if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dTDiam, b3Raw) || b3Raw.IsEmpty()) { m_pMchMgr->SetLastError( 2303, "Error in Milling : Empty RawBox") ; return false ; } @@ -1406,7 +1406,7 @@ Milling::ProcessPath( int nPathId, int nPvId, int nClId) // recupero distanza da fondo dei grezzi interessati dal percorso double dRbDist = 0 ; if ( AreSameVectorApprox( vtExtr, Z_AX)) { - if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dDiam, dRbDist)) + if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dTDiam, dRbDist)) return false ; } diff --git a/Mortising.cpp b/Mortising.cpp index 0dffb44..7c4a877 100644 --- a/Mortising.cpp +++ b/Mortising.cpp @@ -1111,7 +1111,7 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId) // recupero il box del grezzo in globale BBox3d b3Raw ; - if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dDiam, b3Raw) || b3Raw.IsEmpty()) { + if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dTDiam, b3Raw) || b3Raw.IsEmpty()) { m_pMchMgr->SetLastError( 2503, "Error in Mortising : Empty RawBox") ; return false ; } @@ -1119,7 +1119,7 @@ Mortising::ProcessPath( int nPathId, int nPvId, int nClId) // recupero distanza da fondo dei grezzi interessati dal percorso double dRbDist = 0 ; if ( AreSameVectorApprox( vtExtr, Z_AX)) { - if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dDiam, dRbDist)) + if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dTDiam, dRbDist)) return false ; } diff --git a/Operation.cpp b/Operation.cpp index 8abfc18..fc9df34 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -34,6 +34,9 @@ using namespace std ; +//---------------------------------------------------------------------------- +const double MAX_DIST_RAW = 200.0 ; + //---------------------------------------------------------------------------- bool Operation::SetOwner( int nId, IGeomDB* pGDB) @@ -124,8 +127,8 @@ Operation::GetElevation( int nPhase, const Point3d& ptP, else if ( Info.dCosDN > - COS_ORTO_ANG_ZERO) { dElev = min( dElev, Info.dU) ; } - // se altrimenti è la prima ed entra, salto tutto - else if ( i == 0 && Info.dCosDN < - COS_ORTO_ANG_ZERO) + // se altrimenti è la prima, distante ed entra, salto tutto + else if ( i == 0 && Info.dU > MAX_DIST_RAW && Info.dCosDN < - COS_ORTO_ANG_ZERO) break ; } } @@ -199,8 +202,8 @@ Operation::GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2, else if ( Info.dCosDN > - COS_ORTO_ANG_ZERO) { dElevP = min( dElevP, Info.dU) ; } - // se altrimenti è la prima ed entra, salto tutto - else if ( i == 0 && Info.dCosDN < - COS_ORTO_ANG_ZERO) + // se altrimenti è la prima, distante ed entra, salto tutto + else if ( i == 0 && Info.dU > MAX_DIST_RAW && Info.dCosDN < - COS_ORTO_ANG_ZERO) break ; } } diff --git a/Pocketing.cpp b/Pocketing.cpp index 3f83d30..58e79b5 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -1232,7 +1232,7 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId) // recupero il box del grezzo in globale BBox3d b3Raw ; - if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dDiam, b3Raw) || b3Raw.IsEmpty()) { + if ( ! GetRawGlobBox( m_nPhase, nPathId, 0.5 * m_TParams.m_dTDiam, b3Raw) || b3Raw.IsEmpty()) { m_pMchMgr->SetLastError( 2405, "Error in Pocketing : Empty RawBox") ; return false ; } @@ -1240,7 +1240,7 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId) // recupero distanza da fondo dei grezzi interessati dal percorso double dRbDist = 0 ; if ( AreSameVectorApprox( vtExtr, Z_AX)) { - if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dDiam, dRbDist)) + if ( ! GetDistanceFromRawBottom( m_nPhase, nCopyId, m_TParams.m_dTDiam, dRbDist)) return false ; }