EgtMachKernel :

- in svuotature gestione SpiralIn e SpiralOut ottimizzate per cerchi
- in svuotatura aggiunti attacchi zigzag e elica e uscita Glide
- in contornatura miglioramenti vari.
This commit is contained in:
Dario Sassi
2017-02-20 18:28:57 +00:00
parent 11df3f63f6
commit 2d0ea787fa
17 changed files with 825 additions and 401 deletions
+24 -12
View File
@@ -31,6 +31,15 @@
using namespace std ;
//------------------------------ Errors --------------------------------------
// 2901 = "Error in Chiseling : UpdateToolData failed"
// 2902 = "Error in Chiseling : Offset not computable"
// 2903 = "Error in Chiseling : Empty RawBox"
// 2904 = "Error in Chiseling : Depth not computable"
// 2905 = "Error in Chiseling : machining depth (xxx) bigger than MaxMaterial (yyy)"
// 2906 = "Error in Chiseling : Entity GetElevation"
// 2907 = "Error in Chiseling : Chaining failed"
//----------------------------------------------------------------------------
struct SqHole
{
@@ -371,14 +380,15 @@ Chiseling::Preview( bool bRecalc)
// aggiorno dati geometrici dell'utensile
if ( ! UpdateToolData()) {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : UpdateToolData failed") ;
m_pMchMgr->SetLastError( 2901, "Error in Chiseling : UpdateToolData failed") ;
return false ;
}
// se necessario, eseguo concatenamento ed inserisco i percorsi sotto la geometria ausiliaria
if ( bChain && ! Chain( nAuxId))
if ( bChain && ! Chain( nAuxId)) {
m_pMchMgr->SetLastError( 2907, "Error in Chiseling : Chaining failed") ;
return false ;
}
// recupero gruppo per geometria di Preview
int nPvId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_PV) ;
// se non c'è, lo aggiungo
@@ -434,13 +444,15 @@ Chiseling::Apply( bool bRecalc)
// aggiorno dati geometrici dell'utensile
if ( ! UpdateToolData()) {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : UpdateToolData failed") ;
m_pMchMgr->SetLastError( 2901, "Error in Chiseling : UpdateToolData failed") ;
return false ;
}
// se necessario, eseguo concatenamento ed inserisco i percorsi sotto la geometria ausiliaria
if ( bChain && ! Chain( nAuxId))
if ( bChain && ! Chain( nAuxId)) {
m_pMchMgr->SetLastError( 2907, "Error in Chiseling : Chaining failed") ;
return false ;
}
// recupero gruppo per geometria di lavorazione (Cutter Location)
int nClId = m_pGeomDB->GetFirstNameInGroup( m_nOwnerId, MCH_CL) ;
@@ -975,7 +987,7 @@ Chiseling::ProcessPath( int nPathId, int nPvId, int nClId)
}
}
if ( ! bOk) {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : Offset not computable") ;
m_pMchMgr->SetLastError( 2902, "Error in Chiseling : Offset not computable") ;
return false ;
}
}
@@ -988,7 +1000,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()) {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : Empty RawBox") ;
m_pMchMgr->SetLastError( 2903, "Error in Chiseling : Empty RawBox") ;
return false ;
}
@@ -1005,7 +1017,7 @@ Chiseling::ProcessPath( int nPathId, int nPvId, int nClId)
double dDepth ;
string sMyDepth = m_Params.m_sDepth ;
if ( ! ExeLuaEvalNumExpr( ToUpper( sMyDepth), &dDepth)) {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : Depth not computable") ;
m_pMchMgr->SetLastError( 2904, "Error in Chiseling : Depth not computable") ;
return false ;
}
// se spessore positivo, lo sottraggo dal risultato
@@ -1046,7 +1058,7 @@ Chiseling::ProcessPath( int nPathId, int nPvId, int nClId)
else {
string sInfo = "Error in Chiseling : machining depth (" + ToString( dElev, 1) +
") bigger than MaxMaterial (" + ToString( m_TParams.m_dMaxMat, 1) + ")" ;
LOG_INFO( GetEMkLogger(), sInfo.c_str()) ;
m_pMchMgr->SetLastError( 2905, sInfo.c_str()) ;
return false ;
}
}
@@ -1187,7 +1199,7 @@ Chiseling::CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtT
dElev = dCurrElev ;
}
else {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : Entity GetElevation") ;
m_pMchMgr->SetLastError( 2906, "Error in Chiseling : Entity GetElevation") ;
return false ;
}
// da una parte
@@ -1197,7 +1209,7 @@ Chiseling::CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtT
dElev = dCurrElev ;
}
else {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : Entity GetElevation") ;
m_pMchMgr->SetLastError( 2906, "Error in Chiseling : Entity GetElevation") ;
return false ;
}
// dall'altra parte
@@ -1207,7 +1219,7 @@ Chiseling::CalcPathElevation( const ICurveComposite* pCompo, const Vector3d& vtT
dElev = dCurrElev ;
}
else {
LOG_INFO( GetEMkLogger(), "Error in Chiseling : Entity GetElevation") ;
m_pMchMgr->SetLastError( 2906, "Error in Chiseling : Entity GetElevation") ;
return false ;
}
}