EgtMachKernel 2.5h1 :

- alla info di testa ZMAXONROT aggiunto parametro opzionale (3°) che indica lo spessore dei pezzi oltre il quale applicare la prescrizione.
This commit is contained in:
Dario Sassi
2023-08-02 20:02:50 +02:00
parent 2b5aacc160
commit 652aa35aaa
3 changed files with 41 additions and 4 deletions
BIN
View File
Binary file not shown.
+39 -3
View File
@@ -842,6 +842,29 @@ Operation::GetRawGlobBox( int nPhase, const BBox3d& b3Test, double dToler, BBox3
return true ;
}
//----------------------------------------------------------------------------
bool
Operation::GetCurrRawsGlobBox( BBox3d& b3Raw) const
{
if ( m_pMchMgr == nullptr || m_pGeomDB == nullptr)
return false ;
// inizializzo box
b3Raw.Reset() ;
// Ciclo sui grezzi attivi
int nRawId = m_pMchMgr->GetFirstRawPart() ;
while ( nRawId != GDB_ID_NULL) {
if ( m_pMchMgr->VerifyRawPartPhase( nRawId, m_nPhase)) {
BBox3d b3OneRaw ;
int nRawSolidId = m_pGeomDB->GetFirstNameInGroup( nRawId, MACH_RAW_SOLID) ;
if ( m_pGeomDB->GetGlobalBBox( nRawSolidId, b3OneRaw)) {
b3Raw.Add( b3OneRaw) ;
}
}
nRawId = m_pMchMgr->GetNextRawPart( nRawId) ;
}
return true ;
}
//----------------------------------------------------------------------------
//----------------------------------------------------------------------------
inline Vector3d
@@ -2193,12 +2216,15 @@ Operation::AdjustStartEndMovements( bool bVerifyPreviousLink)
else
return false ;
}
// Recupero box complessivo dei grezzi attivi
BBox3d b3Raws ;
GetCurrRawsGlobBox( b3Raws) ;
// Se già a Zmax
if ( bMaxZ) {
// non devo fare alcunché
}
// se altrimenti richiesta risalita a Zmax
else if ( bToZmax || ForcedZmax( vAxVal, vAxIni)) {
else if ( bToZmax || ForcedZmax( vAxVal, vAxIni, b3Raws)) {
// cancello eventuale risalita parziale della lavorazione precedente
pPrevOp->RemoveRise() ;
// aggiungo risalita a Zmax
@@ -2429,6 +2455,9 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
}
// verifico se la testa interferisce con i pezzi o i bloccaggi sulla tavola
else {
// Recupero box complessivo dei grezzi attivi
BBox3d b3Raws ;
GetCurrRawsGlobBox( b3Raws) ;
// recupero se ZHome è in basso
bool bZHomeDown = GetZHomeDown() ;
// determino la Z più alta tra le due posizioni
@@ -2437,7 +2466,7 @@ Operation::AdjustOneStartMovement( int nClPathId, int nPrevClPathId, Operation*
DBLVECTOR vAxPrevTmp = vAxPrev ; vAxPrevTmp[2] = dTopZ ;
DBLVECTOR vAxCurrTmp = vAxCurr ; vAxCurrTmp[2] = dTopZ ;
// verifico se forzata risalita a Zmax
bool bForcedZMax = ForcedZmax( vAxPrevTmp, vAxCurrTmp) ;
bool bForcedZMax = ForcedZmax( vAxPrevTmp, vAxCurrTmp, b3Raws) ;
// se interferisce
if ( bForcedZMax || ! TestCollisionAvoid( vAxPrevTmp, vAxCurrTmp)) {
// recupero HomeZ
@@ -3112,7 +3141,7 @@ Operation::GetRotationAtZmax( void) const
//----------------------------------------------------------------------------
bool
Operation::ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const
Operation::ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, const BBox3d& b3Raws) const
{
// Recupero macchina corrente
Machine* pMch = ( m_pMchMgr != nullptr ? m_pMchMgr->GetCurrMachine() : nullptr) ;
@@ -3130,6 +3159,13 @@ Operation::ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const
int nHeadId = pMch->GetCurrHead() ;
DBLVECTOR vdVal ;
if ( m_pGeomDB->GetInfo( nHeadId, MCH_ZMAXONROT, vdVal) && vdVal.size() >= 1 && lround(vdVal[0]) > 0) {
// controllo altezza minima grezzi
double dHmin = 100 * EPS_SMALL ;
if ( vdVal.size() >= 3)
dHmin = max( vdVal[2], dHmin) ;
if ( b3Raws.GetDimZ() < dHmin)
return false ;
// controllo variazione angolare minima
double dAngTol = 100 * EPS_ANG_SMALL ;
if ( vdVal.size() >= 2)
dAngTol = max( vdVal[1], dAngTol) ;
+2 -1
View File
@@ -99,6 +99,7 @@ class Operation : public IUserObj
bool GetDistanceFromRawBottom( int nPhase, int nPathId, double dToler, double& dRbDist, double& dAllRbDist) const ;
bool GetRawGlobBox( int nPhase, int nPathId, double dToler, BBox3d& b3Raw) const ;
bool GetRawGlobBox( int nPhase, const BBox3d& b3Test, double dToler, BBox3d& b3Raw) const ;
bool GetCurrRawsGlobBox( BBox3d& b3Raw) const ;
bool AdjustCurveFromSurf( ICurveComposite* pCrvCompo, int nToolDir, int nFaceUse, double dToolThick, int nGrade = 3) ;
bool ApproxWithArcsIfUseful( ICurveComposite* pCompo, bool bCareTempProp = false) const ;
@@ -144,7 +145,7 @@ class Operation : public IUserObj
const DBLVECTOR& vAx2, const Vector3d& vtTool2,
double& dMaxZ) const ;
bool GetRotationAtZmax( void) const ;
bool ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;
bool ForcedZmax( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd, const BBox3d& b3Raws) const ;
int GetUserNotesZmax( void) const ;
bool GetZHomeDown( void) const ;
bool TestCollisionAvoid( const DBLVECTOR& vAxStart, const DBLVECTOR& vAxEnd) const ;