diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index ec5f87f..e466631 100644 Binary files a/EgtMachKernel.rc and b/EgtMachKernel.rc differ diff --git a/Machine.h b/Machine.h index eb90497..8e6850c 100644 --- a/Machine.h +++ b/Machine.h @@ -56,6 +56,7 @@ class Machine bool GetAllTablesNames( STRVECTOR& vNames) const ; int GetHeadExitCount( const std::string& sHead) const ; int GetHeadExitPosDirAux( const std::string& sHead, int nExit, Point3d& ptPos, Vector3d& vtDir, Vector3d& vtAux) const ; + int GetHeadSolCh( const std::string& sHead) const ; double GetAngDeltaMinForHome( void) const { return m_dAngDeltaMinForHome ; } bool LoadTool( const std::string& sHead, int nExit, const std::string& sTool) ; diff --git a/MachineHeads.cpp b/MachineHeads.cpp index 8a9f45c..563a9b6 100644 --- a/MachineHeads.cpp +++ b/MachineHeads.cpp @@ -70,6 +70,18 @@ Machine::GetHeadExitPosDirAux( const string& sHead, int nExit, Point3d& ptPos, V return true ; } +//---------------------------------------------------------------------------- +int +Machine::GetHeadSolCh( const string& sHead) const +{ + // recupero testa + Head* pHead = GetHead( GetGroup( sHead)) ; + if ( pHead == nullptr) + return MCH_SCC_NONE ; + // recupero criterio di soluzione associato alla testa + return pHead->GetSolCh() ; +} + //---------------------------------------------------------------------------- bool Machine::LoadTool( const string& sHead, int nExit, const string& sTool) diff --git a/Milling.cpp b/Milling.cpp index 686e55b..8db185a 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -182,6 +182,7 @@ Milling::Milling( void) m_TParams.m_sHead = "*" ; m_nMills = 0 ; m_bStepOn = false ; + m_nHeadSolCh = MCH_SCC_NONE ; } //---------------------------------------------------------------------------- @@ -458,6 +459,7 @@ Milling::Preview( bool bRecalc) m_pMchMgr->SetLastError( 2301, "Error in Milling : UpdateToolData failed") ; return false ; } + m_nHeadSolCh = m_pMchMgr->GetCurrMachine()->GetHeadSolCh( m_TParams.m_sHead) ; // se necessario, eseguo concatenamento ed inserisco i percorsi sotto la geometria ausiliaria if ( bChain && ! Chain( nAuxId)) { @@ -523,6 +525,7 @@ Milling::Apply( bool bRecalc, bool bPostApply) m_pMchMgr->SetLastError( 2301, "Error in Milling : UpdateToolData failed") ; return false ; } + m_nHeadSolCh = m_pMchMgr->GetCurrMachine()->GetHeadSolCh( m_TParams.m_sHead) ; // se necessario, eseguo concatenamento ed inserisco i percorsi sotto la geometria ausiliaria if ( bChain && ! Chain( nAuxId)) { @@ -1629,7 +1632,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo pCurve->GetStartDir( vtStart) ; // determino elevazione su inizio percorso di lavoro double dStElev ; - if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev)) + if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) dStElev = dElev ; // determino inizio attacco Point3d ptP1 ; @@ -1639,6 +1642,8 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo bool bOutStart = GetPointOutOfRaw( ptP1, vtTool) ; // determino se l'inizio dell'attacco è sopra il grezzo bool bAboveStart = m_pMchMgr->GetHeadAbove( m_TParams.m_sHead) && GetPointAboveRaw( ptP1) ; + // imposto versore correzione e ausiliario sul punto di partenza + CalcAndSetCorrAuxDir( pCompo, i) ; // aggiungo approccio per frese normali if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) { // correggo elevazione iniziale con punto inizio attacco @@ -1673,6 +1678,8 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo return false ; } } + // imposto versore correzione e ausiliario sul punto di arrivo + CalcAndSetCorrAuxDir( pCompo, i+1) ; // elaborazioni sulla curva corrente if ( pCurve->GetType() == CRV_LINE) { ICurveLine* pLine = GetCurveLine( pCurve) ; @@ -1686,8 +1693,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo Point3d ptCen = pArc->GetCenter() ; double dAngCen = pArc->GetAngCenter() ; Vector3d vtN = pArc->GetNormVersor() ; - Point3d ptP3 ; - pArc->GetEndPoint( ptP3) ; + Point3d ptP3 ; pArc->GetEndPoint( ptP3) ; SetFeed( GetFeed()) ; if ( AddArcMove( ptP3, ptCen, dAngCen, vtN) == GDB_ID_NULL) return false ; @@ -1701,7 +1707,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo pCurve->GetEndDir( vtEnd) ; // elevazione sul punto finale double dEndElev ; - if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev)) + if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev)) dEndElev = dElev ; // aggiungo uscita Point3d ptP1 ; @@ -1772,7 +1778,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool // determino elevazione su inizio attacco double dStElev ; if ( j == 1) { - if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev)) + if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) dStElev = dElev ; } else @@ -1785,6 +1791,8 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool bool bOutStart = GetPointOutOfRaw( ptP1, vtTool) ; // determino se l'inizio dell'attacco è sopra il grezzo bool bAboveStart = m_pMchMgr->GetHeadAbove( m_TParams.m_sHead) && GetPointAboveRaw( ptP1) ; + // imposto versore correzione e ausiliario sul punto di partenza + CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i + 1 : i)) ; // se primo step aggiungo approccio per frese normali if ( j == 1 && ( m_TParams.m_nType & TF_SAWBLADE) == 0) { // correggo elevazione iniziale con punto inizio attacco @@ -1829,6 +1837,8 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool return false ; } } + // imposto versore correzione e ausiliario sul punto di arrivo + CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i : i + 1)) ; // elaborazioni sulla curva corrente if ( pCurve->GetType() == CRV_LINE) { ICurveLine* pLine = GetCurveLine( pCurve) ; @@ -1858,7 +1868,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool // elevazione sul punto finale double dEndElev ; if ( j == nStep) { - if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev)) + if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev)) dEndElev = dElev ; } else @@ -1932,6 +1942,8 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool pCurve->GetStartPoint( ptStart) ; Vector3d vtStart ; pCurve->GetStartDir( vtStart) ; + // imposto versore correzione e ausiliario sul punto di partenza + CalcAndSetCorrAuxDir( pCompo, i) ; // punto inizio attacco Point3d ptP1 ; // se speciale e step intermedio @@ -1942,7 +1954,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool else { // determino elevazione su inizio attacco double dStElev ; - if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev)) + if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) dStElev = dElev ; // determino inizio attacco if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, false, pCompo, ptP1)) @@ -1984,6 +1996,8 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool return false ; } } + // imposto versore correzione e ausiliario sul punto di arrivo + CalcAndSetCorrAuxDir( pCompo, i+1) ; // elaborazioni sulla curva corrente if ( pCurve->GetType() == CRV_LINE) { ICurveLine* pLine = GetCurveLine( pCurve) ; @@ -2015,7 +2029,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool pCurve->GetEndDir( vtEnd) ; // elevazione sul punto finale double dEndElev ; - if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev)) + if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev)) dEndElev = dElev ; // aggiungo uscita Point3d ptP1 ; @@ -2090,7 +2104,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool pCrvC->GetStartDir( vtStart) ; // determino elevazione su inizio attacco double dStElev ; - if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev)) + if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) dStElev = 0 ; dStElev -= dStart ; // determino inizio attacco @@ -2101,6 +2115,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool bool bOutStart = GetPointOutOfRaw( ptP1, vtTool) ; // determino se l'inizio dell'attacco è sopra il grezzo bool bAboveStart = m_pMchMgr->GetHeadAbove( m_TParams.m_sHead) && GetPointAboveRaw( ptP1) ; + // imposto versore correzione e ausiliario sul punto di partenza + CalcAndSetCorrAuxDir( pCompo, i) ; // aggiungo approccio per frese normali if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) { // correggo elevazione iniziale con punto inizio attacco @@ -2130,6 +2146,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool return false ; } } + // imposto versore correzione e ausiliario sul punto di arrivo + CalcAndSetCorrAuxDir( pCompo, i+1) ; // elaborazioni sulla curva corrente if ( pCrvC->GetType() == CRV_LINE) { const ICurveLine* pLine = GetCurveLine( pCrvC) ; @@ -2162,7 +2180,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool pCrvC->GetEndDir( vtEnd) ; // elevazione sul punto finale double dEndElev ; - if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev)) + if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev)) dEndElev = dElev ; // aggiungo uscita Point3d ptP1 ; @@ -2192,11 +2210,11 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool else { // ciclo sugli step for ( int j = 0 ; j <= nStep ; ++ j) { + // flag direzione (prima passata indice 0) + bool bInvert = ( ( j % 2) == 1) ; // ciclo sulle curve elementari double dCurrLen = 0 ; for ( int i = 0 ; i <= nMaxInd ; ++ i) { - // flag direzione (prima passata indice 0) - bool bInvert = ( ( j % 2) == 1) ; // curva corrente const ICurve* pCrvC = pCompo->GetCurve( ( bInvert ? nMaxInd - i : i)) ; // copio la curva @@ -2221,13 +2239,15 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool pCurve->GetStartDir( vtStart) ; // determino elevazione su inizio attacco double dStElev ; - if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev)) + if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) dStElev = dElev ; dStElev -= dStart ; // determino inizio attacco Point3d ptP1 ; if ( ! CalcLeadInStart( ptStart, vtStart, vtExtr, dStElev, bInvert, pCompo, ptP1)) return false ; + // imposto versore correzione e ausiliario sul punto di partenza + CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i + 1 : i)) ; // aggiungo approccio per frese normali if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) { // correggo elevazione iniziale con punto inizio attacco @@ -2255,6 +2275,8 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool return false ; } } + // imposto versore correzione e ausiliario sul punto di arrivo + CalcAndSetCorrAuxDir( pCompo, ( bInvert ? nMaxInd - i : i + 1)) ; // elaborazioni sulla curva corrente if ( pCurve->GetType() == CRV_LINE) { ICurveLine* pLine = GetCurveLine( pCurve) ; @@ -2287,7 +2309,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool pCurve->GetEndDir( vtEnd) ; // elevazione sul punto finale double dEndElev ; - if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dEndElev)) + if ( ! GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dEndElev)) dEndElev = dElev ; // aggiungo uscita Point3d ptP1 ; @@ -2863,11 +2885,24 @@ Milling::GetRadiusForStartEndElevation( void) bool Milling::GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool) { - // determino se l'inizio dell'attacco è fuori dal grezzo - double dTemp ; - if ( ! GetElevation( m_nPhase, ptP, vtTool, 0.5 * m_TParams.m_dDiam, dTemp)) - return false ; - return ( dTemp < 10 * EPS_SMALL) ; + // per frese normali + if ( ( m_TParams.m_nType & TF_SAWBLADE) == 0) { + // determino se l'inizio dell'attacco è fuori dal grezzo (considero movimento fresa lungo il suo asse) + double dTemp ; + if ( ! GetElevation( m_nPhase, ptP, vtTool, 0.5 * m_TParams.m_dDiam, vtTool, dTemp)) + return false ; + return ( dTemp < 10 * EPS_SMALL) ; + } + // per lame + else { + // determino se l'inizio dell'attacco è fuori dal grezzo (considero movimento lama in Z) + double dTemp ; + if ( ! GetElevation( m_nPhase, ptP, vtTool, 0.5 * m_TParams.m_dDiam, Z_AX, dTemp) || dTemp > 10 * EPS_SMALL) + return false ; + if ( ! GetElevation( m_nPhase, ptP + vtTool * m_TParams.m_dThick, vtTool, 0.5 * m_TParams.m_dDiam, Z_AX, dTemp) || dTemp > 10 * EPS_SMALL) + return false ; + return true ; + } } //---------------------------------------------------------------------------- @@ -2890,3 +2925,93 @@ Milling::GetPointAboveRaw( const Point3d& ptP) } return true ; } + +//---------------------------------------------------------------------------- +bool +Milling::CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU) +{ + // verifico curva + if ( pCompo == nullptr) + return false ; + // se utensile centrato, direzione di correzione nulla + if ( m_Params.m_nWorkSide == MILL_WS_CENTER) + return true ; + // calcolo del versore correzione + Vector3d vtCorr = CalcCorrDir( pCompo, dU) ; + // imposto versore correzione + SetCorrDir( vtCorr) ; + // se rinvio da sotto in uso, non devo impostare direzione aux da correzione + if ( m_bAggrBottom) + return true ; + // se impostato uso direttamente da lavorazione, imposto anche come versore aux + if ( m_Params.m_nSolCh == MCH_SCC_ADIR_NEAR || m_Params.m_nSolCh == MCH_SCC_ADIR_FAR) + SetAuxDir( vtCorr) ; + // se standard o nullo o suo opposto + if ( m_Params.m_nSolCh == MCH_SCC_STD || m_Params.m_nSolCh == MCH_SCC_NONE || m_Params.m_nSolCh == MCH_SCC_OPPOSITE) { + // verifico se richiesto dalla testa + if ( m_nHeadSolCh == MCH_SCC_ADIR_NEAR || m_nHeadSolCh == MCH_SCC_ADIR_FAR) + SetAuxDir( vtCorr) ; + } + return true ; +} + +//---------------------------------------------------------------------------- +Vector3d +Milling::CalcCorrDir( const ICurveComposite* pCompo, double dU) +{ + // verifico curva + if ( pCompo == nullptr) + return V_NULL ; + // se utensile centrato, direzione di correzione nulla + if ( m_Params.m_nWorkSide == MILL_WS_CENTER) + return V_NULL ; + // angolo di rotazione da tg a versore corr/aux + bool bCcwRot = (m_Params.m_nWorkSide == MILL_WS_LEFT) ; + double dCaRot = ( bCcwRot ? ANG_RIGHT : -ANG_RIGHT) ; + // dominio parametrico della curva + double dUs, dUe ; + pCompo->GetDomain( dUs, dUe) ; + // se inizio + if ( dU < dUs + EPS_ZERO) { + // recupero la tangente dopo + Point3d ptP ; + Vector3d vtN ; + pCompo->GetPointTang( dU, ICurve::FROM_PLUS, ptP, vtN) ; + vtN.Rotate( m_vtTool, dCaRot) ; + return vtN ; + } + // se fine + else if ( dU > dUe - EPS_ZERO) { + // recupero la tangente prima + Point3d ptP ; + Vector3d vtN ; + pCompo->GetPointTang( dU, ICurve::FROM_MINUS, ptP, vtN) ; + vtN.Rotate( m_vtTool, dCaRot) ; + return vtN ; + } + // altrimenti + else { + // recupero la tangente prima e dopo il punto + Point3d ptP1, ptP2 ; + Vector3d vtT1, vtT2 ; + pCompo->GetPointTang( dU, ICurve::FROM_MINUS, ptP1, vtT1) ; + pCompo->GetPointTang( dU, ICurve::FROM_PLUS, ptP2, vtT2) ; + // se coincidono + if ( AreSameVectorApprox( vtT1, vtT2)) { + Vector3d vtN = vtT1 ; + vtN.Rotate( m_vtTool, dCaRot) ; + return vtN ; + } + // se sono opposte + else if ( AreOppositeVectorApprox( vtT1, vtT2)) { + Vector3d vtN = ( bCcwRot ? vtT2 : vtT1) ; + return vtN ; + } + // altrimenti + else { + Vector3d vtN = ( vtT1 + vtT2) / 2 ; + vtN.Rotate( m_vtTool, dCaRot) ; + return vtN ; + } + } +} diff --git a/Milling.h b/Milling.h index 7491c2f..f84847a 100644 --- a/Milling.h +++ b/Milling.h @@ -93,6 +93,8 @@ class Milling : public Machining double GetRadiusForStartEndElevation( void) ; bool GetPointOutOfRaw( const Point3d& ptP, const Vector3d& vtTool) ; bool GetPointAboveRaw( const Point3d& ptP) ; + bool CalcAndSetCorrAuxDir( const ICurveComposite* pCompo, double dU) ; + Vector3d CalcCorrDir( const ICurveComposite* pCompo, double dU) ; private : double GetSpeed() const @@ -121,6 +123,7 @@ class Milling : public Machining ToolData m_TParams ; // parametri utensile int m_nMills ; // numero di percorsi di lavoro generati bool m_bStepOn ; // flag per indicare che effettivamente si lavora a step + int m_nHeadSolCh ; // criterio scelta soluzione impostato nella testa bool m_bAggrBottom ; // flag utilizzo di aggregato da sotto Vector3d m_vtAggrBottom ; // vettore direzione ausiliaria aggregato da sotto AggrBottom m_AggrBottom ; // dati eventuale aggregato da sotto diff --git a/Operation.cpp b/Operation.cpp index bb327ad..5b98958 100644 --- a/Operation.cpp +++ b/Operation.cpp @@ -233,8 +233,8 @@ Operation::GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2, c //---------------------------------------------------------------------------- bool -Operation::GetElevation( int nPhase, const Point3d& ptP, - const Vector3d& vtDir, double dRad, double& dElev) +Operation::GetElevation( int nPhase, const Point3d& ptP, const Vector3d& vtTool, double dRad, + const Vector3d& vtDir, double& dElev) { if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr) return false ; @@ -243,7 +243,7 @@ Operation::GetElevation( int nPhase, const Point3d& ptP, return false ; // considero 8 direzioni sulla circonferenza const int N_STEP = 8 ; - Vector3d vtRad = FromUprightOrtho( vtDir) * dRad ; + Vector3d vtRad = FromUprightOrtho( vtTool) * dRad ; for ( int i = 0 ; i < N_STEP ; ++ i) { // esploro 4 posizioni sulle direzioni for ( int j = 1 ; j <= 8 ; j *= 2) { @@ -253,7 +253,7 @@ Operation::GetElevation( int nPhase, const Point3d& ptP, dElev = max( dElev, dElevT) ; } // passo alla direzione successiva - vtRad.Rotate( vtDir, ANG_FULL / N_STEP) ; + vtRad.Rotate( vtTool, ANG_FULL / N_STEP) ; } return true ; } @@ -566,8 +566,7 @@ Operation::AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nF else if ( nToolDir == TOOL_ORTUP) { Vector3d vtN ; pCrvCompo->GetExtrusion( vtN) ; - if ( vtN.z < - sin( 2 * DEGTORAD)) { - // pCrvCompo->Invert() ; + if ( vtN.z < - EPS_SMALL) { pCrvCompo->Translate( vtN * dToolThick) ; pCrvCompo->SetExtrusion( - vtN) ; } diff --git a/Operation.h b/Operation.h index 643bd36..5682e90 100644 --- a/Operation.h +++ b/Operation.h @@ -65,8 +65,8 @@ class Operation : public IUserObj const Vector3d& vtDir, double& dElev) ; bool GetElevation( int nPhase, const Point3d& ptP1, const Point3d& ptP2, const Point3d& ptP3, const Vector3d& vtDir, double& dElev) ; - bool GetElevation( int nPhase, const Point3d& ptP, - const Vector3d& vtDir, double dRad, double& dElev) ; + bool GetElevation( int nPhase, const Point3d& ptP, const Vector3d& vtTool, double dRad, + const Vector3d& vtDir, double& dElev) ; bool GetDistanceFromRawSide( int nPhase, const Point3d& ptP, const Vector3d& vtDir, double& dDist) ; bool GetMinDistanceFromRawSide( int nPhase, const Point3d& ptP, double& dDist, Vector3d& vtDir) ; bool GetDistanceFromRawBottom( int nPhase, int nPathId, double dToler, double& dRbDist) ; diff --git a/Pocketing.cpp b/Pocketing.cpp index d5a22c4..501fc28 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -1507,7 +1507,7 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c return false ; // determino elevazione su inizio attacco double dStElev ; - if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev)) + if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) dStElev = dElev ; dStElev -= ( ptP1 - ptStart) * vtExtr ; // se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco @@ -1671,7 +1671,7 @@ Pocketing::AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, } // determino elevazione su inizio attacco double dStElev ; - if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), dStElev)) + if ( ! GetElevation( m_nPhase, ptStart - 10 * EPS_SMALL * vtTool, vtTool, GetRadiusForStartEndElevation(), vtTool, dStElev)) dStElev = dElev ; dStElev -= ( ptP1 - ptStart) * vtExtr ; // se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco @@ -2230,7 +2230,7 @@ Pocketing::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector ptP1 = ptEnd ; // determino elevazione su fine uscita double dEndElev ; - if ( GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtN, vtN, GetRadiusForStartEndElevation(), dEndElev)) + if ( GetElevation( m_nPhase, ptEnd - 10 * EPS_SMALL * vtN, vtN, GetRadiusForStartEndElevation(), vtN, dEndElev)) dElev = dEndElev ; return true ; case POCKET_LO_GLIDE : @@ -2261,7 +2261,7 @@ Pocketing::AddLeadOut( const Point3d& ptEnd, const Vector3d& vtEnd, const Vector // determino elevazione su fine uscita ptP1 = ptFin ; double dEndElev ; - if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtN, vtN, GetRadiusForStartEndElevation(), dEndElev)) + if ( GetElevation( m_nPhase, ptP1 - 10 * EPS_SMALL * vtN, vtN, GetRadiusForStartEndElevation(), vtN, dEndElev)) dElev = dEndElev ; return true ; }