EgtMachKernel 1.8b6 :
- migliorati controlli massimo materiale in fresatura e svuotatura.
This commit is contained in:
+41
-11
@@ -52,6 +52,7 @@ using namespace std ;
|
||||
// 2417 = "Error in Pocketing : Linear Approx not computable"
|
||||
// 2418 = "Error in Pocketing : Return toolpath not computable"
|
||||
// 2419 = "Error in Pocketing : Chaining failed"
|
||||
// 2420 = "Error in Pocketing : Tool MaxMaterial too small (xxx)"
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
USEROBJ_REGISTER( "EMkPocketing", Pocketing) ;
|
||||
@@ -1078,10 +1079,35 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
else
|
||||
return false ;
|
||||
|
||||
// verifico che il massimo materiale dell'utensile sia sensato
|
||||
const double MIN_MAXMAT = 1.0 ;
|
||||
if ( m_TParams.m_dMaxMat < dElev && m_TParams.m_dMaxMat < MIN_MAXMAT) {
|
||||
string sInfo = "Error in Pocketing : Tool MaxMaterial too small (" +
|
||||
ToString( m_TParams.m_dMaxMat, 2) + ")" ;
|
||||
m_pMchMgr->SetLastError( 2420, sInfo) ;
|
||||
return false ;
|
||||
}
|
||||
|
||||
// verifico che lo step dell'utensile sia sensato
|
||||
double dOkStep = m_Params.m_dStep ;
|
||||
const double MIN_ZSTEP = 1.0 ;
|
||||
if ( dOkStep < MIN_ZSTEP) {
|
||||
dOkStep = MIN_ZSTEP ;
|
||||
string sInfo = "Warning in Pocketing : machining step too small (" +
|
||||
ToString( m_Params.m_dStep, 2) + ")" ;
|
||||
LOG_INFO( GetEMkLogger(), sInfo.c_str()) ;
|
||||
}
|
||||
|
||||
// verifico di non superare il massimo materiale
|
||||
const double MAXMAT_TOL = EPS_SMALL ;
|
||||
if ( ( m_Params.m_dStep < EPS_SMALL && dElev > m_TParams.m_dMaxMat + MAXMAT_TOL) ||
|
||||
( m_Params.m_dStep > EPS_SMALL && m_Params.m_dStep > m_TParams.m_dMaxMat + EPS_SMALL)) {
|
||||
// se lo step supera la capacità dell'utensile
|
||||
if ( m_Params.m_dStep > m_TParams.m_dMaxMat + EPS_SMALL) {
|
||||
dOkStep = m_TParams.m_dMaxMat ;
|
||||
string sInfo = "Warning in Pocketing : machining step (" + ToString( m_Params.m_dStep, 1) +
|
||||
") bigger than MaxMaterial (" + ToString( m_TParams.m_dMaxMat, 1) + ")" ;
|
||||
LOG_INFO( GetEMkLogger(), sInfo.c_str()) ;
|
||||
}
|
||||
// se lavorazione singola e l'elevazione supera la capacità dell'utensile
|
||||
if ( ( dOkStep < EPS_SMALL || dOkStep > dElev) && dElev > m_TParams.m_dMaxMat + EPS_SMALL) {
|
||||
if ( dDepth + max( dThick, 0.0) > m_TParams.m_dMaxMat) {
|
||||
dDepth = m_TParams.m_dMaxMat - max( dThick, 0.0) ;
|
||||
string sInfo = "Warning in Pocketing : machining depth (" + ToString( dElev, 1) +
|
||||
@@ -1147,11 +1173,11 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId)
|
||||
case POCKET_SUB_ZIGZAG :
|
||||
case POCKET_SUB_ONEWAY :
|
||||
case POCKET_SUB_SPIRALIN :
|
||||
if ( ! AddSpiralIn( pCompo, vtTool, vtExtr, dDepth, dElev, bSplitArcs))
|
||||
if ( ! AddSpiralIn( pCompo, vtTool, vtExtr, dDepth, dElev, dOkStep, bSplitArcs))
|
||||
return false ;
|
||||
break ;
|
||||
case POCKET_SUB_SPIRALOUT :
|
||||
if ( ! AddSpiralOut( pCompo, vtTool, vtExtr, dDepth, dElev, bSplitArcs))
|
||||
if ( ! AddSpiralOut( pCompo, vtTool, vtExtr, dDepth, dElev, dOkStep, bSplitArcs))
|
||||
return false ;
|
||||
break ;
|
||||
}
|
||||
@@ -1369,7 +1395,7 @@ GetCurveRadius( const ICurve* pCrv)
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, bool bSplitArcs)
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs)
|
||||
{
|
||||
// recupero distanza di sicurezza
|
||||
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
|
||||
@@ -1388,8 +1414,7 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c
|
||||
|
||||
// determino numero e affondamento degli step
|
||||
int nStep = 1 ;
|
||||
if ( m_Params.m_dStep > 100 * EPS_SMALL)
|
||||
nStep = max( 1, static_cast<int>( ceil( dElev / m_Params.m_dStep))) ;
|
||||
nStep = max( 1, static_cast<int>( ceil( dElev / dOkStep))) ;
|
||||
double dStep = dElev / nStep ;
|
||||
|
||||
int nMaxInd = pMCrv->GetCurveCount() - 1 ;
|
||||
@@ -1512,7 +1537,7 @@ Pocketing::AddSpiralIn( const ICurveComposite* pCompo, const Vector3d& vtTool, c
|
||||
//----------------------------------------------------------------------------
|
||||
bool
|
||||
Pocketing::AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool, const Vector3d& vtExtr,
|
||||
double dDepth, double dElev, bool bSplitArcs)
|
||||
double dDepth, double dElev, double dOkStep, bool bSplitArcs)
|
||||
{
|
||||
// recupero distanza di sicurezza
|
||||
double dSafeZ = m_pMchMgr->GetCurrMachiningsMgr()->GetSafeZ() ;
|
||||
@@ -1533,8 +1558,7 @@ Pocketing::AddSpiralOut( const ICurveComposite* pCompo, const Vector3d& vtTool,
|
||||
|
||||
// determino numero e affondamento degli step
|
||||
int nStep = 1 ;
|
||||
if ( m_Params.m_dStep > 100 * EPS_SMALL)
|
||||
nStep = max( 1, static_cast<int>( ceil( dElev / m_Params.m_dStep))) ;
|
||||
nStep = max( 1, static_cast<int>( ceil( dElev / dOkStep))) ;
|
||||
double dStep = dElev / nStep ;
|
||||
|
||||
int nMaxInd = pMCrv->GetCurveCount() - 1 ;
|
||||
@@ -1941,6 +1965,9 @@ Pocketing::CalcLeadInStart( const Point3d& ptStart, const Vector3d& vtStart, con
|
||||
double dLen= m_Params.m_dLiTang ;
|
||||
// senso di rotazione da dir tg a dir esterna
|
||||
bool bCcwRot = true ;
|
||||
// !!! provvisorio : GLIDE -> NONE !!!
|
||||
if ( nType == POCKET_LI_GLIDE)
|
||||
nType = POCKET_LI_NONE ;
|
||||
// Calcolo punto iniziale
|
||||
switch ( nType) {
|
||||
case POCKET_LI_NONE :
|
||||
@@ -1964,6 +1991,9 @@ Pocketing::AddLeadIn( const Point3d& ptP1, const Point3d& ptStart, const Vector3
|
||||
{
|
||||
// Assegno il tipo
|
||||
int nType = GetLeadInType() ;
|
||||
// !!! provvisorio : GLIDE -> NONE !!!
|
||||
if ( nType == POCKET_LI_GLIDE)
|
||||
nType = POCKET_LI_NONE ;
|
||||
// Eseguo a seconda del tipo
|
||||
switch ( nType) {
|
||||
case POCKET_LI_NONE :
|
||||
|
||||
Reference in New Issue
Block a user