diff --git a/Milling.cpp b/Milling.cpp index fcf9ada..2183ffd 100644 --- a/Milling.cpp +++ b/Milling.cpp @@ -2447,7 +2447,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo } else { Point3d ptP3 = pLine->GetEnd() ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -2525,7 +2525,7 @@ Milling::AddStandardMilling( const ICurveComposite* pCompo, const Vector3d& vtTo bool bUhAboveEnd = ! m_bAboveHead && GetUhPointAboveRaw( ptP1 + vtWkTip, vtTool, 0, GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, vtEscape, dEndElev) ; // aggiungo retrazione - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd, bSplitArcs)) { m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ; return false ; } @@ -2793,11 +2793,11 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool return false ; Vector3d vtToolOrt = OrthoCompo( ptP1 - ptCurr, vtTool) ; if ( vtToolOrt.Len() > 100 * EPS_SMALL) { - if ( AddLinearMove( ptP1 - vtToolOrt) == GDB_ID_NULL) + if ( AddLinearMove( ptP1 - vtToolOrt, bSplitArcs) == GDB_ID_NULL) return false ; } // movimento standard - if ( AddLinearMove( ptP1) == GDB_ID_NULL) + if ( AddLinearMove( ptP1, bSplitArcs) == GDB_ID_NULL) return false ; } // se attacco a zigzag o a spirale, non affondo @@ -2809,7 +2809,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool else { bool bStartFeed = ( bOutStart || m_TParams.m_nType == TT_MILL_POLISHING) ; SetFeed( bStartFeed ? GetStartFeed() : GetTipFeed()) ; - if ( ! SameAsCurrPos( ptP1) && AddLinearMove( ptP1) == GDB_ID_NULL) + if ( ! SameAsCurrPos( ptP1) && AddLinearMove( ptP1, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -2836,7 +2836,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool } else { Point3d ptP3 = pLine->GetEnd() ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -2970,7 +2970,7 @@ Milling::AddZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtTool bool bUhAboveEnd = ! m_bAboveHead && GetUhPointAboveRaw( ptP1, vtTool, 0, GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, vtEscape, dEndElev) ; // aggiungo retrazione - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd, bSplitArcs)) { m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ; return false ; } @@ -3285,7 +3285,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool } else { Point3d ptP3 = pLine->GetEnd() ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -3366,7 +3366,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool bool bUhAboveEnd = ! m_bAboveHead && GetUhPointAboveRaw( ptP1, vtTool, 0, GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, vtEscape, dEndElev) ; // aggiungo retrazione - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAhAboveStartEnd || bUhBelowStartEnd)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAhAboveStartEnd || bUhBelowStartEnd, bSplitArcs)) { m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ; return false ; } @@ -3434,7 +3434,7 @@ Milling::AddOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtTool // se richiesta estrazione in direzione utensile else if ( bAddExtract) { Point3d ptExtract = ptP1 + ( dEndElev + dSafeZ) * vtTool ; - if ( AddRapidMove( ptExtract) == GDB_ID_NULL) + if ( AddRapidMove( ptExtract, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -3581,7 +3581,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool else { Point3d ptP3 = pLine->GetEnd() ; ptP3 -= vtEndDepth ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -3648,7 +3648,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool bool bUhAboveEnd = ! m_bAboveHead && GetUhPointAboveRaw( ptP1, vtTool, 0, GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, vtEscape, dEndElev) ; // aggiungo retrazione - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd, bSplitArcs)) { m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ; return false ; } @@ -3763,7 +3763,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool else { Point3d ptP3 = pLine->GetEnd() ; ptP3 -= vtEndDepth ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -3831,7 +3831,7 @@ Milling::AddSpiralMilling( const ICurveComposite* pCompo, const Vector3d& vtTool bool bUhAboveEnd = ! m_bAboveHead && GetUhPointAboveRaw( ptP1, vtTool, 0, GetRadiusForStartEndElevation(), m_TParams.m_dLen, false, dSafeZ, vtEscape, dEndElev) ; // aggiungo retrazione - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dExtrAppr, bAboveEnd, bSplitArcs)) { m_pMchMgr->SetLastError( 2312, "Error in Milling : Retract not computable") ; return false ; } @@ -3987,7 +3987,7 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT else { bool bStartFeed = ( bOutStart || m_TParams.m_nType == TT_MILL_NOTIP || m_TParams.m_nType == TT_MILL_POLISHING) ; SetFeed( bStartFeed ? GetStartFeed() : GetTipFeed()) ; - if ( AddLinearMove( ptP1) == GDB_ID_NULL) + if ( AddLinearMove( ptP1, bSplitArcs) == GDB_ID_NULL) return false ; } // aggiungo attacco @@ -4005,7 +4005,7 @@ Milling::AddSawZigZagMilling( const ICurveComposite* pCompo, const Vector3d& vtT const ICurveLine* pLine = GetCurveLine( pCurve) ; Point3d ptP3 = pLine->GetEnd() ; SetFeed( GetFeed()) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { @@ -4171,7 +4171,7 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT else { bool bStartFeed = ( bOutStart || m_TParams.m_nType == TT_MILL_NOTIP || m_TParams.m_nType == TT_MILL_POLISHING) ; SetFeed( bReturn ? GetEndFeed() : ( bStartFeed ? GetStartFeed() : GetTipFeed())) ; - if ( AddLinearMove( ptP1) == GDB_ID_NULL) + if ( AddLinearMove( ptP1, bSplitArcs) == GDB_ID_NULL) return false ; } // aggiungo attacco @@ -4192,7 +4192,7 @@ Milling::AddSawOneWayMilling( const ICurveComposite* pCompo, const Vector3d& vtT const ICurveLine* pLine = GetCurveLine( pCurve) ; Point3d ptP3 = pLine->GetEnd() ; SetFeed( bReturn ? GetEndFeed() : GetFeed()) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) { + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) { SetFlag( 0) ; return false ; } @@ -4461,7 +4461,7 @@ Milling::AddDirectApproach( const Point3d& ptP, bool bSplitArcs) //---------------------------------------------------------------------------- bool Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, - double dElev, double dAppr, bool bAboveEnd) + double dElev, double dAppr, bool bAboveEnd, bool bSplitArcs) { // se testa da sopra senza aggregato da sotto, retrazione mai da Z negativo Vector3d vtAppr = vtTool ; @@ -4487,7 +4487,7 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, // 4 -> movimento di risalita sopra il punto finale SetFeed( GetEndFeed()) ; Point3d ptP4 = ptP + vtAppr * ( dElev + dAppr) ; - if ( AddLinearMove( ptP4) == GDB_ID_NULL) + if ( AddLinearMove( ptP4, bSplitArcs) == GDB_ID_NULL) return false ; } else { @@ -4495,12 +4495,12 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, Point3d ptP4a = ptP + vtAppr * ( dElev + dAppr) ; if ( dElev + dAppr > EPS_SMALL) { SetFeed( GetEndFeed()) ; - if ( AddLinearMove( ptP4a) == GDB_ID_NULL) + if ( AddLinearMove( ptP4a, bSplitArcs) == GDB_ID_NULL) return false ; } // 4b -> movimento di risalita sopra il punto finale Point3d ptP4b = ptP4a + vtAppr * ( dSafeDist - dAppr) ; - if ( AddRapidMove( ptP4b) == GDB_ID_NULL) + if ( AddRapidMove( ptP4b, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -4510,7 +4510,7 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, // 4 -> movimento di risalita sopra il punto finale SetFeed( GetEndFeed()) ; Point3d ptP4 = ptP + Z_AX * ( min( dElevZ, 0.) + dAppr) ; - if ( AddLinearMove( ptP4) == GDB_ID_NULL) + if ( AddLinearMove( ptP4, bSplitArcs) == GDB_ID_NULL) return false ; } else { @@ -4518,12 +4518,12 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, Point3d ptP4a = ptP + Z_AX * ( min( dElevZ, 0.) + dAppr) ; if ( dElev + dAppr > EPS_SMALL) { SetFeed( GetEndFeed()) ; - if ( AddLinearMove( ptP4a) == GDB_ID_NULL) + if ( AddLinearMove( ptP4a, bSplitArcs) == GDB_ID_NULL) return false ; } // 4b -> movimento di risalita sopra il punto finale Point3d ptP4b = ptP4a + Z_AX * ( dSafeDist - dAppr) ; - if ( AddRapidMove( ptP4b) == GDB_ID_NULL) + if ( AddRapidMove( ptP4b, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -4534,14 +4534,14 @@ Milling::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, // post-retract Point3d ptP0 = ptP - Z_AX * dAggZ + m_vtAggrBottom * ( dDistBottom + m_AggrBottom.dEncH + dSafeZ) ; Point3d ptP00 = ptP0 + Z_AX * ( m_AggrBottom.dEncV + m_TParams.m_dLen + dAggZ - dElev) ; - if ( AddRapidMove( ptP0, MCH_CL_AGB_OUT) == GDB_ID_NULL) + if ( AddRapidMove( ptP0, bSplitArcs, MCH_CL_AGB_OUT) == GDB_ID_NULL) return false ; // se rinvio da sotto che richiede speciale rotazione if ( m_AggrBottom.nType == 1) { Vector3d vtAux = m_vtAggrBottom ; vtAux.Rotate( Z_AX, 0, 1) ; SetAuxDir( vtAux) ; - if ( AddRapidMove( ptP00, MCH_CL_AGB_UP) == GDB_ID_NULL) + if ( AddRapidMove( ptP00, bSplitArcs, MCH_CL_AGB_UP) == GDB_ID_NULL) return false ; } } diff --git a/Milling.h b/Milling.h index e9155ff..1a5320c 100644 --- a/Milling.h +++ b/Milling.h @@ -105,7 +105,7 @@ class Milling : public Machining bool bFirst, bool bSplitArcs, bool bAddInsert = false) ; bool AddDirectApproach( const Point3d& ptP, bool bSplitArcs) ; bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, - double dElev, double dAppr, bool bAboveEnd) ; + double dElev, double dAppr, bool bAboveEnd, bool bSplitArcs) ; bool AddSawBladeSideRetract( const Point3d& ptP, const Vector3d& vtRetr, const Vector3d& vtTool, double dSafeZ, double dSawEndElev, double dEndElev, double dAppr, bool bAddExtract = false) ; bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtTool, diff --git a/Pocketing.cpp b/Pocketing.cpp index b55c615..008ec25 100644 --- a/Pocketing.cpp +++ b/Pocketing.cpp @@ -2134,7 +2134,7 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con } // se inizio, approccio globale al punto iniziale if ( bStart) { - if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutRawLeadIn || m_bOpenOutRaw)) { + if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bSplitArcs, bOutRawLeadIn || m_bOpenOutRaw)) { m_pMchMgr->SetLastError( 2414, "Error in Pocketing : Approach not computable") ; return false ; } @@ -2142,7 +2142,7 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con } // altrimenti, approccio di collegamento else { - if ( ! AddLinkApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutRawLeadIn || m_bOpenOutRaw)) { + if ( ! AddLinkApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bSplitArcs, bOutRawLeadIn || m_bOpenOutRaw)) { m_pMchMgr->SetLastError( 2418, "Error in Pocketing : Link not computable") ; return false ; } @@ -2160,7 +2160,7 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con ICurveLine* pLine = GetCurveLine( pCurve) ; Point3d ptP3 = pLine->GetEnd() ; SetFeed( GetFeed()) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { @@ -2191,7 +2191,7 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con } // se lucidatura o caso ottimizzato e ultimo percorso di ultimo step, aggiungo retrazione if ( ( m_TParams.m_nType == TT_MILL_POLISHING || bOptimizedZigZag) && k == nPath - 1 && j == nStep) { - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bSplitArcs)) { m_pMchMgr->SetLastError( 2418, "Error in Pocketing : Retract not computable") ; return false ; } @@ -2322,7 +2322,7 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con ICurveLine* pLine = GetCurveLine( pCurve) ; Point3d ptP3 = pLine->GetEnd() ; SetFeed( GetFeed()) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { @@ -2361,7 +2361,7 @@ Pocketing::AddZigZag( const ICurveComposite* pCompo, const Vector3d& vtTool, con } // altrimenti retrazione finale else { - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bSplitArcs)) { m_pMchMgr->SetLastError( 2418, "Error in Pocketing : Retract not computable") ; return false ; } @@ -3142,7 +3142,7 @@ Pocketing::AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, con dStElev = -LIO_ELEV_TOL ; } // approccio al punto iniziale - if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, false)) { + if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bSplitArcs, false)) { m_pMchMgr->SetLastError( 2414, "Error in Pocketing : Approach not computable") ; return false ; } @@ -3168,7 +3168,7 @@ Pocketing::AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, con ICurveLine* pLine = GetCurveLine( pCurve) ; Point3d ptP3 = pLine->GetEnd() ; SetFeed( dFeedRid * GetFeed()) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { @@ -3323,7 +3323,7 @@ Pocketing::AddOneWay( const ICurveComposite* pCompo, const Vector3d& vtTool, con bFound = inOk.GetNext( dParS, dParE) ; // se ultimo movimento di ultima area, aggiungo retrazione globale if ( j == nStep && i == nYStep && ! bFound && OffsCrv2.GetCurveCount() == 0) { - if ( ! AddRetract( ptQ, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr)) { + if ( ! AddRetract( ptQ, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bSplitArcs)) { m_pMchMgr->SetLastError( 2417, "Error in Pocketing : Retract not computable") ; return false ; } @@ -3492,7 +3492,7 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c dStElev = -LIO_ELEV_TOL ; } // approccio al punto iniziale - if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutStart || bForcedOutStart)) { + if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bSplitArcs, bOutStart || bForcedOutStart)) { m_pMchMgr->SetLastError( 2414, "Error in Pocketing : Approach not computable") ; return false ; } @@ -3518,7 +3518,7 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c ICurveLine* pLine = GetCurveLine( pCurve) ; Point3d ptP3 = pLine->GetEnd() ; SetFeed( GetFeed()) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { @@ -3574,7 +3574,7 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c return false ; } // aggiungo retrazione - if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr)) { + if ( ! AddRetract( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bSplitArcs)) { m_pMchMgr->SetLastError( 2417, "Error in Pocketing : Retract not computable") ; return false ; } @@ -3720,7 +3720,7 @@ Pocketing::AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, dStElev = -LIO_ELEV_TOL ; } // approccio al punto iniziale - if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, false)) { + if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bSplitArcs, false)) { m_pMchMgr->SetLastError( 2414, "Error in Pocketing : Approach not computable") ; return false ; } @@ -3746,7 +3746,7 @@ Pocketing::AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, ICurveLine* pLine = GetCurveLine( pCurve) ; Point3d ptP3 = pLine->GetEnd() ; SetFeed( GetFeed()) ; - if ( AddLinearMove( ptP3) == GDB_ID_NULL) + if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL) return false ; } else if ( pCurve->GetType() == CRV_ARC) { @@ -3802,7 +3802,7 @@ Pocketing::AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, return false ; } // aggiungo retrazione - if ( ! AddRetract( ptQ, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr)) { + if ( ! AddRetract( ptQ, vtTool, dSafeZ, dSafeAggrBottZ, dEndElev, dAppr, bSplitArcs)) { m_pMchMgr->SetLastError( 2417, "Error in Pocketing : Retract not computable") ; return false ; } @@ -5040,7 +5040,7 @@ Pocketing::AddEpicycles( ICurveComposite* pCompo, ICurveComposite * pCrv, ICurve //---------------------------------------------------------------------------- bool Pocketing::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, - double dElev, double dAppr, bool bOutStart) + double dElev, double dAppr, bool bSplitArcs, bool bOutStart) { SetFlag( 1) ; // se con aggregato da sotto o equivalente (rinvio a 90 gradi su testa 5 assi) @@ -5065,7 +5065,7 @@ Pocketing::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafe return false ; SetAuxDir( m_vtAggrBottom) ; SetFlag( 0) ; - if ( AddRapidMove( ptP0, MCH_CL_AGB_IN) == GDB_ID_NULL) + if ( AddRapidMove( ptP0, bSplitArcs, MCH_CL_AGB_IN) == GDB_ID_NULL) return false ; } // altrimenti rinvio normale @@ -5083,18 +5083,18 @@ Pocketing::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafe // se distanza di sicurezza minore di distanza di inizio if ( dSafeDist < dAppr + 10 * EPS_SMALL) { // 1 -> punto sopra inizio - if ( AddRapidStartOrMove( ptP1, ! m_bAggrBottom) == GDB_ID_NULL) + if ( AddRapidStartOrMove( ptP1, ! m_bAggrBottom, bSplitArcs) == GDB_ID_NULL) return false ; } else { // 1a -> punto molto sopra inizio Point3d ptP1a = ptP1 + vtTool * ( dSafeDist - dAppr) ; - if ( AddRapidStartOrMove( ptP1a, ! m_bAggrBottom) == GDB_ID_NULL) + if ( AddRapidStartOrMove( ptP1a, ! m_bAggrBottom, bSplitArcs) == GDB_ID_NULL) return false ; // 1 -> punto sopra inizio if ( ( dElev + dAppr) > 10 * EPS_SMALL || (( dElev + dAppr) > -EPS_ZERO && dAppr > EPS_SMALL)) { SetFlag( 0) ; - if ( AddRapidMove( ptP1) == GDB_ID_NULL) + if ( AddRapidMove( ptP1, bSplitArcs) == GDB_ID_NULL) return false ; } else @@ -5104,13 +5104,13 @@ Pocketing::AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafe SetFlag( 0) ; bool bStartFeed = ( bOutStart || m_TParams.m_nType == TT_MILL_NOTIP) ; SetFeed( bStartFeed ? GetStartFeed() : GetTipFeed()) ; - if ( ! AreSamePointApprox( ptP1, ptP) && AddLinearMove( ptP) == GDB_ID_NULL) + if ( ! AreSamePointApprox( ptP1, ptP) && AddLinearMove( ptP, bSplitArcs) == GDB_ID_NULL) return false ; } else { // affondo diretto al punto iniziale SetFlag( 0) ; - if ( AddRapidStartOrMove( ptP, ! m_bAggrBottom) == GDB_ID_NULL) + if ( AddRapidStartOrMove( ptP, ! m_bAggrBottom, bSplitArcs) == GDB_ID_NULL) return false ; } return true ; @@ -5164,7 +5164,7 @@ Pocketing::AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dS //---------------------------------------------------------------------------- bool Pocketing::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, - double dElev, double dAppr) + double dElev, double dAppr, bool bSplitArcs) { // se con aggregato da sotto o equivalente (rinvio a 90 gradi su testa 5 assi) bool bBottomOutStart = false ; @@ -5182,7 +5182,7 @@ Pocketing::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ // 4 -> movimento di risalita sopra il punto finale SetFeed( GetEndFeed()) ; Point3d ptP4 = ptP + vtTool * ( dElev + dAppr) ; - if ( AddLinearMove( ptP4) == GDB_ID_NULL) + if ( AddLinearMove( ptP4, bSplitArcs) == GDB_ID_NULL) return false ; } else { @@ -5190,12 +5190,12 @@ Pocketing::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ Point3d ptP4a = ptP + vtTool * ( dElev + dAppr) ; if ( dElev + dAppr > EPS_SMALL) { SetFeed( GetEndFeed()) ; - if ( AddLinearMove( ptP4a) == GDB_ID_NULL) + if ( AddLinearMove( ptP4a, bSplitArcs) == GDB_ID_NULL) return false ; } // 4b -> movimento di risalita sopra il punto finale Point3d ptP4b = ptP4a + vtTool * ( dSafeDist - dAppr) ; - if ( AddRapidMove( ptP4b) == GDB_ID_NULL) + if ( AddRapidMove( ptP4b, bSplitArcs) == GDB_ID_NULL) return false ; } } @@ -5206,14 +5206,14 @@ Pocketing::AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ // post-retract Point3d ptP0 = ptP - Z_AX * dAggZ + m_vtAggrBottom * ( dDistBottom + m_AggrBottom.dEncH + dSafeZ) ; Point3d ptP00 = ptP0 + Z_AX * ( m_AggrBottom.dEncV + m_TParams.m_dLen + dAggZ - dElev) ; - if ( AddRapidMove( ptP0, MCH_CL_AGB_OUT) == GDB_ID_NULL) + if ( AddRapidMove( ptP0, bSplitArcs, MCH_CL_AGB_OUT) == GDB_ID_NULL) return false ; // se rinvio da sotto che richiede speciale rotazione if ( m_AggrBottom.nType == 1) { Vector3d vtAux = m_vtAggrBottom ; vtAux.Rotate( Z_AX, 0, 1) ; SetAuxDir( vtAux) ; - if ( AddRapidMove( ptP00, MCH_CL_AGB_UP) == GDB_ID_NULL) + if ( AddRapidMove( ptP00, bSplitArcs, MCH_CL_AGB_UP) == GDB_ID_NULL) return false ; } } diff --git a/Pocketing.h b/Pocketing.h index 025933b..eaa18a5 100644 --- a/Pocketing.h +++ b/Pocketing.h @@ -116,13 +116,13 @@ class Pocketing : public Machining bool ComputePolishingPath( ICurveComposite* pMCrv, ICurveComposite* pRCrv, bool bSplitArcs) ; bool AddEpicycles( ICurveComposite * pCompo, ICurveComposite * pCrv, ICurveComposite * pCrvBound = nullptr) ; bool AddApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, - double dElev, double dAppr, bool bOutStart) ; + double dElev, double dAppr, bool bSplitArcs, bool bOutStart) ; bool AddLinkApproach( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, double dElev, double dAppr, bool bSplitArcs, bool bOutStart = false) ; bool AddLinkRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, double dElev, double dAppr, bool bSplitArcs) ; bool AddRetract( const Point3d& ptP, const Vector3d& vtTool, double dSafeZ, double dSafeAggrBottZ, - double dElev, double dAppr) ; + double dElev, double dAppr, bool bSplitArcs) ; bool CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN, const ICurveComposite* pRCrv, Point3d& ptP1) const ; bool AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3d& vtStart, const Vector3d& vtN,