EgtExecutor 1.6n8 :

- migliorie a nesting.
This commit is contained in:
Dario Sassi
2016-02-24 08:20:45 +00:00
parent 39a388e148
commit a6f790c0d3
2 changed files with 16 additions and 12 deletions
+16 -12
View File
@@ -430,6 +430,9 @@ MyPackPartCluster( const INTVECTOR& vTrueIds, bool bReducedCut,
SetPreviewStatus( pGeomDB, vTrueIds, true) ;
SetPreviewStatus( pGeomDB, vOtherIds, true) ;
// verifica
bOk = bOk && ExeVerifyPartCluster( vTrueIds, bReducedCut) ;
// se inserimento di massima riuscito, provo a migliorare
if ( bOk) {
const double BIG_MOVE = 1000 ;
@@ -444,15 +447,10 @@ MyPackPartCluster( const INTVECTOR& vTrueIds, bool bReducedCut,
//----------------------------------------------------------------------------
bool
ExePackPartCluster( const INTVECTOR& vIds, bool bReducedCut,
double dXmin, double dYmin, double dXmax, double dYmax, bool bBottomUp)
ExePackPartClusterInRectangle( const INTVECTOR& vIds, bool bReducedCut, bool bBottomUp)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// Verifiche sui parametri
if ( dXmax < dXmin + EPS_SMALL ||
dYmax < dYmin + EPS_SMALL)
return false ;
// Risolvo identificativi a selezionati
INTVECTOR vTrueIds ;
@@ -464,12 +462,18 @@ ExePackPartCluster( const INTVECTOR& vIds, bool bReducedCut,
// Recupero gruppo dei pezzi
int nGroupId = pGeomDB->GetParentId( vTrueIds[0]) ;
// Se non esiste, creo SurfFlatRegion che delimita la regione valida
// Calcolo il box interno della regione valida
int nBoxId = pGeomDB->GetFirstNameInGroup( nGroupId, NST_SHEET_OUTREG) ;
if ( nBoxId == GDB_ID_NULL)
nBoxId = ExeCreateOutRegion( nGroupId, dXmin, dYmin, dXmax, dYmax, b3Cluster.GetMin().z) ;
if ( nBoxId == GDB_ID_NULL)
BBox3d b3Box ;
if ( ! pGeomDB->GetGlobalBBox( nBoxId, b3Box))
return false ;
b3Box.Expand( - SPESS, - SPESS, 0) ;
if ( b3Box.IsEmpty())
return false ;
double dXmin = b3Box.GetMin().x ;
double dYmin = b3Box.GetMin().y ;
double dXmax = b3Box.GetMax().x ;
double dYmax = b3Box.GetMax().y ;
// se con tagli ridotti
if ( bReducedCut) {
@@ -508,7 +512,7 @@ ExePackPartCluster( const INTVECTOR& vIds, bool bReducedCut, bool bBottomUp)
// Recupero gruppo dei pezzi
int nGroupId = pGeomDB->GetParentId( vTrueIds[0]) ;
// Calcolo il box di ingombro della regione valida
// Calcolo il box di ingombro interno della regione valida
int nBoxId = pGeomDB->GetFirstNameInGroup( nGroupId, NST_SHEET_OUTREG) ;
BBox3d b3Box ;
if ( ! pGeomDB->GetGlobalBBox( nBoxId, b3Box))
@@ -517,7 +521,7 @@ ExePackPartCluster( const INTVECTOR& vIds, bool bReducedCut, bool bBottomUp)
if ( b3Box.IsEmpty())
return false ;
// Flag per calcolo box
// Flag per calcolo box dei pezzi
const int BBF_PART_MY_FLAG = BBF_ONLY_VISIBLE | BBF_IGNORE_TEXT | BBF_IGNORE_DIM ;
// Calcolo il box di ingombro delle regioni dei pezzi