EgtExecutor :

- in ExePocketing aggiunta gestione lati OPEN (aperti) e OPEN2 (aperti da non oltrepassare).
This commit is contained in:
Dario Sassi
2026-06-17 09:21:12 +02:00
parent 58a86feccc
commit a4a27a6d44
2 changed files with 24 additions and 3 deletions
+4
View File
@@ -28,6 +28,10 @@ const double ANG_TOL_MAX_DEG = 60 ;
// Curve originali di composite o curva originale di area danneggiata
const std::string CRV_ORIG = "ORIG" ;
// Per lati aperti di contorni per pocketing
const std::string PCK_KEY_OPEN = "OPEN" ;
const std::string PCK_KEY_OPEN2 = "OPEN2" ;
// Per FlatParts (Nesting)
const std::string NST_PARTREG_LAYER = "Region" ;
const std::string NST_PARTREG_ORIG_LAYER = "Region.orig" ;
+20 -3
View File
@@ -14,6 +14,7 @@
//--------------------------- Include ----------------------------------------
#include "stdafx.h"
#include "EXE.h"
#include "EXE_Const.h"
#include "EXE_Macro.h"
#include "/EgtDev/Include/EXeExecutor.h"
#include "/EgtDev/Include/EGkSfrCreate.h"
@@ -31,16 +32,32 @@ ExePocketing( int nId, double dRad, double dStep, double dAngle, int nType, bool
VERIFY_GEOMDB( pGeomDB, false) ;
// recupero la FlatRegion da svuotare
PtrOwner<ISurfFlatRegion> pMySfr ;
const ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ;
PtrOwner<ISurfFlatRegion> pMySfr ;
// altrimenti verifico se curva chiusa e piana
if ( pSfr == nullptr) {
// verifico se è una curva chiusa e piana che permette di definire una regione
const ICurve* pCrv = GetCurve( pGeomDB->GetGeoObj( nId)) ;
Plane3d plPlane ;
if ( pCrv == nullptr || ! pCrv->IsFlat( plPlane, true, 10 * EPS_SMALL))
return false ;
// ne faccio una copia
PtrOwner<ICurveComposite> pCompo( ConvertCurveToComposite( pCrv->Clone())) ;
for ( int i = 0 ; i < pCompo->GetCurveCount() ; ++ i)
pCompo->SetCurveTempProp( i, 0) ;
// recupero eventuali info sui lati aperti
INTVECTOR vOpen ;
if ( pGeomDB->GetInfo( nId, PCK_KEY_OPEN, vOpen)) {
for ( int i : vOpen)
pCompo->SetCurveTempProp( i, 1) ;
}
else if ( pGeomDB->GetInfo( nId, PCK_KEY_OPEN2, vOpen)) {
for ( int i : vOpen)
pCompo->SetCurveTempProp( i, 2) ;
}
// creo la flat region
SurfFlatRegionByContours SfrCntr ;
SfrCntr.AddCurve( pCrv->Clone()) ;
SfrCntr.AddCurve( Release( pCompo)) ;
pMySfr.Set( SfrCntr.GetSurf()) ;
if ( IsNull( pMySfr))
return false ;
@@ -59,7 +76,7 @@ ExePocketing( int nId, double dRad, double dStep, double dAngle, int nType, bool
// eseguo Pocketing
ICRVCOMPOPOVECTOR vCrvCompoRes ;
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 5., nType, bSmooth, true, false, false, true, false, true, P_INVALID, nullptr, false,
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 0, nType, bSmooth, true, false, false, true, false, true, P_INVALID, nullptr, false,
dStep, 0, INFINITO, 0, 0, INFINITO, false, 0., 0., false, vCrvCompoRes) ;
nFirstId = GDB_ID_NULL ;
nCrvCount = int( vCrvCompoRes.size()) ;