From a6f790c0d395723f256123ce948d4257110ffa35 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 24 Feb 2016 08:20:45 +0000 Subject: [PATCH] EgtExecutor 1.6n8 : - migliorie a nesting. --- EXE_NstPartNesting.cpp | 28 ++++++++++++++++------------ EgtExecutor.rc | Bin 11694 -> 11694 bytes 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/EXE_NstPartNesting.cpp b/EXE_NstPartNesting.cpp index 025f8f9..6a76437 100644 --- a/EXE_NstPartNesting.cpp +++ b/EXE_NstPartNesting.cpp @@ -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 diff --git a/EgtExecutor.rc b/EgtExecutor.rc index c7d029ba082b886aa4c321ef920ab2496714038a..c29d38ffbecd97a1f0183aa469714b14d0c77eea 100644 GIT binary patch delta 97 zcmZ1%y)JsgA2vpd%@@V4Gflq2na5}`Ignd-a{*Tk3sCf++-0W82LxfF21;&>n->Y| cF@rU@0x76sKgP|Iq`|@mn->Y| cF@rU@0x76sKgP|Iq`|@mWB>pF