EgtMachKernel 2.6d1 :

- se robot sempre spezzatura
- spezzatura movimenti per robot
- in tagli con lama, tolto da Apply preview.
This commit is contained in:
Dario Sassi
2024-04-02 15:37:22 +02:00
parent 4e3079e504
commit f8d2f26692
23 changed files with 473 additions and 255 deletions
+24 -21
View File
@@ -96,7 +96,6 @@ struct HoleInfo {
int nIndInSelVector = 0 ; // indice nel vettore m_vId (id fori selezionati)
} ;
struct ToolInfo
{
const ToolData* pTool ; // puntatore per utensile (nullo se utensile non presente)
@@ -2110,6 +2109,8 @@ Drilling::DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double
GetElevation( m_nPhase, hole.ptIni, hole.vtDir, m_TParams.m_dDiam / 2, hole.vtDir, dElev) ;
// determino alcune caratteristiche dell'utensile
double dTExtrLen = max( 0.0, m_TParams.m_dTLen - m_TParams.m_dLen) ;
// necessità di spezzatura per robot
bool bSplitArcs = GetSplitArcs( V_NULL) ;
// imposto dati comuni
SetPathId( nPathId) ;
SetToolDir( hole.vtDir) ;
@@ -2131,7 +2132,7 @@ Drilling::DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double
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
@@ -2141,7 +2142,7 @@ Drilling::DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double
return false ;
SetFlag( 0) ;
}
if ( AddRapidMove( ptP1) == GDB_ID_NULL)
if ( AddRapidMove( ptP1, bSplitArcs) == GDB_ID_NULL)
return false ;
}
else {
@@ -2154,7 +2155,7 @@ Drilling::DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double
// 2 -> punto fuori (se diverso dal precedente)
if ( m_Params.m_dStartPos < dAppr) {
Point3d ptP2 = hole.ptIni + hole.vtDir * ( m_Params.m_dStartPos + dTExtrLen) ;
if ( AddRapidMove( ptP2) == GDB_ID_NULL)
if ( AddRapidMove( ptP2, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// 3 -> punto termine velocità ridotta iniziale (se previsto)
@@ -2165,7 +2166,7 @@ Drilling::DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double
Point3d ptP3 = hole.ptIni - hole.vtDir * dStartSlowLen ;
if ( ! bStd && ! bEndSlow)
ptP3 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// 4 -> punto termine velocità standard (se risulta)
@@ -2176,7 +2177,7 @@ Drilling::DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double
Point3d ptP4 = hole.ptIni - hole.vtDir * ( hole.dLen - dEndSlowLen) ;
if ( ! bEndSlow)
ptP4 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
if ( AddLinearMove( ptP4, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// 5 -> punto termine velocità finale ridotta (se previsto)
@@ -2184,27 +2185,27 @@ Drilling::DoStandardDrilling( const Hole& hole, SelData Id, int nPathId, double
SetFeed( GetTipFeed()) ;
SetFlag( 101) ; // fondo del foro
Point3d ptP5 = hole.ptIni - hole.vtDir * ( hole.dLen + dAddLen) ;
if ( AddLinearMove( ptP5) == GDB_ID_NULL)
if ( AddLinearMove( ptP5, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// 6 -> ritorno all'approccio del foro
SetFeed( GetEndFeed()) ;
SetFlag( 104) ; // risalita sopra il foro
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
if ( AddLinearMove( ptP1, bSplitArcs) == GDB_ID_NULL)
return false ;
// 7 -> punto fuori (se uso aggregato da sotto)
if ( m_bAggrBottom) {
SetFlag( 0) ;
Point3d ptP0 = ptP1 + m_vtAggrBottom * ( m_dDistBottom + m_AggrBottom.dEncH + dSafeZ) ;
Point3d ptP00 = ptP0 + Z_AX * ( m_AggrBottom.dEncV + m_TParams.m_dLen + dAppr + dTExtrLen) ;
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 ;
}
}
@@ -2241,6 +2242,8 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
GetElevation( m_nPhase, hole.ptIni, hole.vtDir, m_TParams.m_dDiam / 2, hole.vtDir, dElev) ;
// determino alcune caratteristiche dell'utensile
double dTExtrLen = max( 0.0, m_TParams.m_dTLen - m_TParams.m_dLen) ;
// necessità di spezzatura per robot
bool bSplitArcs = GetSplitArcs( V_NULL) ;
// imposto dati comuni
SetPathId( nPathId) ;
SetToolDir( hole.vtDir) ;
@@ -2262,7 +2265,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
return false ;
SetFlag( 0) ;
SetAuxDir( m_vtAggrBottom) ;
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
@@ -2272,7 +2275,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
return false ;
SetFlag( 0) ;
}
if ( AddRapidMove( ptP1) == GDB_ID_NULL)
if ( AddRapidMove( ptP1, bSplitArcs) == GDB_ID_NULL)
return false ;
}
else {
@@ -2283,7 +2286,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
// 2 -> punto fuori (se diverso dal precedente)
if ( m_Params.m_dStartPos < dAppr) {
Point3d ptP2 = hole.ptIni + hole.vtDir * ( m_Params.m_dStartPos + dTExtrLen) ;
if ( AddRapidMove( ptP2) == GDB_ID_NULL)
if ( AddRapidMove( ptP2, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// ciclo di affondamento a step
@@ -2303,13 +2306,13 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
SetFeed( GetEndFeed()) ;
SetFlag( 103) ; // punto di scarico truciolo
Point3d ptPr = hole.ptIni + hole.vtDir * dReturnPos ;
if ( AddLinearMove( ptPr) == GDB_ID_NULL)
if ( AddLinearMove( ptPr, bSplitArcs) == GDB_ID_NULL)
return false ;
// riaffondo
SetFeed( GetEndFeed()) ;
SetFlag( 0) ;
Point3d ptPa = hole.ptIni - hole.vtDir * ( dCurrLen - APPR_STEP) ;
if ( AddLinearMove( ptPa) == GDB_ID_NULL)
if ( AddLinearMove( ptPa, bSplitArcs) == GDB_ID_NULL)
return false ;
}
// lunghezza di fine step
@@ -2332,7 +2335,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
Point3d ptP3 = hole.ptIni - hole.vtDir * dLen ;
if ( bHoleEnd)
ptP3 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP3) == GDB_ID_NULL)
if ( AddLinearMove( ptP3, bSplitArcs) == GDB_ID_NULL)
return false ;
// aggiorno posizione e verifico se step completato
dCurrLen = dLen ;
@@ -2357,7 +2360,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
Point3d ptP4 = hole.ptIni - hole.vtDir * dLen ;
if ( bHoleEnd)
ptP4 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP4) == GDB_ID_NULL)
if ( AddLinearMove( ptP4, bSplitArcs) == GDB_ID_NULL)
return false ;
// aggiorno posizione e verifico se step completato
dCurrLen = dLen ;
@@ -2381,7 +2384,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
Point3d ptP5 = hole.ptIni - hole.vtDir * dLen ;
if ( bHoleEnd)
ptP5 -= hole.vtDir * dAddLen ;
if ( AddLinearMove( ptP5) == GDB_ID_NULL)
if ( AddLinearMove( ptP5, bSplitArcs) == GDB_ID_NULL)
return false ;
// aggiorno posizione
dCurrLen = dLen ;
@@ -2391,7 +2394,7 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
// 6 -> ritorno all'approccio del foro
SetFeed( GetEndFeed()) ;
SetFlag( 104) ; // risalita sopra il foro
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
if ( AddLinearMove( ptP1, bSplitArcs) == GDB_ID_NULL)
return false ;
// 7 -> punto fuori (se uso aggregato da sotto)
@@ -2399,14 +2402,14 @@ Drilling::DoPeckDrilling( const Hole& hole, SelData Id, int nPathId)
SetFlag( 0) ;
Point3d ptP0 = ptP1 + m_vtAggrBottom * ( m_dDistBottom + m_AggrBottom.dEncH + dSafeZ) ;
Point3d ptP00 = ptP0 + Z_AX * ( m_AggrBottom.dEncV + m_TParams.m_dLen + dAppr + dTExtrLen) ;
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 ;
}
}