EgtMachKernel :

- corretto passaggio parametri spezzatura in pocketing e milling (correzione #1765).
This commit is contained in:
Dario Sassi
2024-04-17 11:39:10 +02:00
parent 89d46baf43
commit d1406baa2e
4 changed files with 58 additions and 58 deletions
+27 -27
View File
@@ -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 ;
}
}