From a4a27a6d4489ab7b4ad7767be07212b8a40138fa Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Wed, 17 Jun 2026 09:21:12 +0200 Subject: [PATCH] EgtExecutor : - in ExePocketing aggiunta gestione lati OPEN (aperti) e OPEN2 (aperti da non oltrepassare). --- EXE_Const.h | 4 ++++ EXE_GdbGetPocketing.cpp | 23 ++++++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/EXE_Const.h b/EXE_Const.h index 51f6c89..9faaab9 100644 --- a/EXE_Const.h +++ b/EXE_Const.h @@ -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" ; diff --git a/EXE_GdbGetPocketing.cpp b/EXE_GdbGetPocketing.cpp index e6e83d4..81b004a 100644 --- a/EXE_GdbGetPocketing.cpp +++ b/EXE_GdbGetPocketing.cpp @@ -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 pMySfr ; const ISurfFlatRegion* pSfr = GetSurfFlatRegion( pGeomDB->GetGeoObj( nId)) ; + PtrOwner 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 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()) ;