EgtExecutor 1.6o1 :

- in nesting aggiunta verifica interferenza con atgli inclinati.
This commit is contained in:
Dario Sassi
2016-03-12 18:21:54 +00:00
parent 2e254607d5
commit 4dfc24345f
6 changed files with 486 additions and 16 deletions
+44
View File
@@ -40,6 +40,7 @@ ExeVerifyMachining( int nMchId, int& nResult)
// Recupero il box e le regioni della lavorazione
BBox3d b3Mch ;
INTVECTOR vMchRReg, vMchLiReg, vMchLoReg ;
INTVECTOR vMchDwnRReg, vMchDwnLiReg, vMchDwnLoReg ;
// recupero gruppo preview lavorazioni nella lavorazione
int nPVGrp = pGeomDB->GetFirstNameInGroup( nMchId, MCH_PV) ;
if ( nPVGrp == GDB_ID_NULL)
@@ -53,33 +54,42 @@ ExeVerifyMachining( int nMchId, int& nResult)
while ( nClId != GDB_ID_NULL) {
// tagli ridotti
int nCrId = pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_RRCUT) ;
int nDwnCrId = pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_DOWN_RRCUT) ;
while ( nCrId != GDB_ID_NULL) {
BBox3d b3Reg ;
if ( ! pGeomDB->GetGlobalBBox( nCrId, b3Reg, BBF_MCH_MY_FLAG))
return false ;
b3Mch.Add( b3Reg) ;
vMchRReg.emplace_back( nCrId) ;
vMchDwnRReg.emplace_back( nDwnCrId) ;
nCrId = pGeomDB->GetNextName( nCrId, MCH_PV_RRCUT) ;
nDwnCrId = pGeomDB->GetNextName( nDwnCrId, MCH_PV_DOWN_RRCUT) ;
}
// ingressi
int nLiId = pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_RLICUT) ;
int nDwnLiId = pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_DOWN_RLICUT) ;
while ( nLiId != GDB_ID_NULL) {
BBox3d b3Reg ;
if ( ! pGeomDB->GetGlobalBBox( nLiId, b3Reg, BBF_MCH_MY_FLAG))
return false ;
b3Mch.Add( b3Reg) ;
vMchLiReg.emplace_back( nLiId) ;
vMchDwnLiReg.emplace_back( nDwnLiId) ;
nLiId = pGeomDB->GetNextName( nLiId, MCH_PV_RLICUT) ;
nDwnLiId = pGeomDB->GetNextName( nDwnLiId, MCH_PV_DOWN_RLICUT) ;
}
// uscite
int nLoId = pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_RLOCUT) ;
int nDwnLoId = pGeomDB->GetFirstNameInGroup( nClId, MCH_PV_DOWN_RLOCUT) ;
while ( nLoId != GDB_ID_NULL) {
BBox3d b3Reg ;
if ( ! pGeomDB->GetGlobalBBox( nLoId, b3Reg, BBF_MCH_MY_FLAG))
return false ;
b3Mch.Add( b3Reg) ;
vMchLoReg.emplace_back( nLoId) ;
vMchDwnLoReg.emplace_back( nDwnLoId) ;
nLoId = pGeomDB->GetNextName( nLoId, MCH_PV_RLOCUT) ;
nDwnLoId = pGeomDB->GetNextName( nDwnLoId, MCH_PV_DOWN_RLOCUT) ;
}
// passo al successivo percorso utensile
nClId = pGeomDB->GetNextGroup( nClId) ;
@@ -96,6 +106,7 @@ ExeVerifyMachining( int nMchId, int& nResult)
// Determino le regioni di tutti gli altri pezzi compresi nella regione della lavorazione
INTVECTOR vOthReg ;
INTVECTOR vOthDwnReg ;
int nRawId = ExeGetFirstRawPart() ;
while ( nRawId != GDB_ID_NULL) {
// se il grezzo appartiene alla fase di lavorazione
@@ -113,6 +124,9 @@ ExeVerifyMachining( int nMchId, int& nResult)
vOthReg.emplace_back( nRegId) ;
else
return false ;
// recupero eventuale regione sotto del pezzo
int nDwnRegId = GetFlatPartDownRegion( pGeomDB, nId) ;
vOthDwnReg.emplace_back( nDwnRegId) ;
}
}
nId = ExeGetNextPartInRawPart( nId) ;
@@ -130,6 +144,16 @@ ExeVerifyMachining( int nMchId, int& nResult)
nResult |= FMI_LI ;
}
}
for ( size_t i = 0 ; i < vMchDwnLiReg.size() ; ++ i) {
for ( size_t j = 0 ; j < vOthDwnReg.size() ; ++ j) {
if ( vMchDwnLiReg[i] != GDB_ID_NULL || vOthDwnReg[j] != GDB_ID_NULL) {
int nMchRegId = ( ( vMchDwnLiReg[i] != GDB_ID_NULL) ? vMchDwnLiReg[i] : vMchLiReg[i]) ;
int nOthRegId = ( ( vOthDwnReg[j] != GDB_ID_NULL) ? vOthDwnReg[j] : vOthReg[j]) ;
if ( ExeSurfFrChunkSimpleClassify( nMchRegId, 0, nOthRegId, 0) != REGC_OUT)
nResult |= FMI_LI ;
}
}
}
// confronto la regione ridotta della lavorazione con le regioni degli altri pezzi
for ( int nMchRegId : vMchRReg) {
for ( int nOthRegId : vOthReg) {
@@ -137,6 +161,16 @@ ExeVerifyMachining( int nMchId, int& nResult)
nResult |= FMI_RM ;
}
}
for ( size_t i = 0 ; i < vMchDwnRReg.size() ; ++ i) {
for ( size_t j = 0 ; j < vOthDwnReg.size() ; ++ j) {
if ( vMchDwnRReg[i] != GDB_ID_NULL || vOthDwnReg[j] != GDB_ID_NULL) {
int nMchRegId = ( ( vMchDwnRReg[i] != GDB_ID_NULL) ? vMchDwnRReg[i] : vMchRReg[i]) ;
int nOthRegId = ( ( vOthDwnReg[j] != GDB_ID_NULL) ? vOthDwnReg[j] : vOthReg[j]) ;
if ( ExeSurfFrChunkSimpleClassify( nMchRegId, 0, nOthRegId, 0) != REGC_OUT)
nResult |= FMI_LO ;
}
}
}
// confronto la regione di uscita della lavorazione con le regioni degli altri pezzi
for ( int nMchRegId : vMchLoReg) {
for ( int nOthRegId : vOthReg) {
@@ -144,6 +178,16 @@ ExeVerifyMachining( int nMchId, int& nResult)
nResult |= FMI_LO ;
}
}
for ( size_t i = 0 ; i < vMchDwnLoReg.size() ; ++ i) {
for ( size_t j = 0 ; j < vOthDwnReg.size() ; ++ j) {
if ( vMchDwnLoReg[i] != GDB_ID_NULL || vOthDwnReg[j] != GDB_ID_NULL) {
int nMchRegId = ( ( vMchDwnLoReg[i] != GDB_ID_NULL) ? vMchDwnLoReg[i] : vMchLoReg[i]) ;
int nOthRegId = ( ( vOthDwnReg[j] != GDB_ID_NULL) ? vOthDwnReg[j] : vOthReg[j]) ;
if ( ExeSurfFrChunkSimpleClassify( nMchRegId, 0, nOthRegId, 0) != REGC_OUT)
nResult |= FMI_LO ;
}
}
}
return true ;
}