From 58463321e08f2718fcb47c34035ab834bfc48e17 Mon Sep 17 00:00:00 2001 From: Daniele Bariletti Date: Mon, 20 Jul 2026 13:08:28 +0200 Subject: [PATCH] EgtExecutor : - aggiunto parametro per la creazione di uno ZMap da una trimesh con fessure. --- EXE_GdbCreateVol.cpp | 9 +++++---- LUA_GdbCreateVol.cpp | 20 ++++++++++++++------ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/EXE_GdbCreateVol.cpp b/EXE_GdbCreateVol.cpp index e70e203..d82fea0 100644 --- a/EXE_GdbCreateVol.cpp +++ b/EXE_GdbCreateVol.cpp @@ -179,7 +179,7 @@ ExeCreateVolZmapByRegionExtrusion( int nParentId, int nSfrId, double dDimZ, doub //------------------------------------------------------------------------------- int -ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDex, double dExtraBox) +ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDex, double dExtraBox, bool bForceClosed) { IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) @@ -198,7 +198,7 @@ ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDe bOk = bOk && ! IsNull( pVZM) ; if ( bOk) { int nError = 0 ; - bOk = pVZM->CreateFromTriMesh( *pStm, dPrec, bTriDex, dExtraBox, &nError) ; + bOk = pVZM->CreateFromTriMesh( *pStm, dPrec, bTriDex, dExtraBox, &nError, bForceClosed) ; if ( ! bOk) { if ( nError == 1) ExeOutLog( "EgtVolZmapFromSurfTm too big for a 32-bit system") ; @@ -217,8 +217,9 @@ ExeCreateVolZmapFromSurfTm( int nParentId, int nStmId, double dPrec, bool bTriDe ToString( nStmId) + "," + ToString( dPrec) + "," + ( bTriDex ? "true" : "false") + "," + - ToString( dExtraBox) + ")" + - " -- Id=" + ToString( nNewId) ; + ToString( dExtraBox) + "," + + ( bForceClosed ? "true" : "false") + ")" + + " -- Id=" + ToString( nNewId) ; LOG_INFO( GetCmdLogger(), sLua.c_str()) ; } // restituisco l'identificativo della nuova entità diff --git a/LUA_GdbCreateVol.cpp b/LUA_GdbCreateVol.cpp index 6fe445e..f4d0b45 100644 --- a/LUA_GdbCreateVol.cpp +++ b/LUA_GdbCreateVol.cpp @@ -121,7 +121,7 @@ LuaCreateVolZmapByRegionExtrusion( lua_State* L) static int LuaCreateVolZmapFromSurfTm( lua_State* L) { - // 3 o 4 o 5 parametri : ParentId, StmId, dPrec [, bTriDex] [, dExtraBox] + // 3 o 4 o 5 o 6 parametri : ParentId, StmId, dPrec [, bTriDex] [, dExtraBox] [, bForceClosed] int nParentId ; LuaCheckParam( L, 1, nParentId) int nStmId ; @@ -130,13 +130,21 @@ LuaCreateVolZmapFromSurfTm( lua_State* L) LuaCheckParam( L, 3, dPrec) bool bTriDex = true ; double dExtraBox = 0 ; - if ( LuaGetParam( L, 4, bTriDex)) - LuaGetParam( L, 5, dExtraBox) ; - else - LuaGetParam( L, 4, dExtraBox) ; + int nPar = 4 ; + if ( LuaGetParam( L, nPar, bTriDex)) { + ++ nPar ; + if ( LuaGetParam( L, nPar, dExtraBox)) ; + ++ nPar ; + } + else { + if ( LuaGetParam( L, nPar, dExtraBox)) ; + ++ nPar ; + } + bool bForceClosed = false ; + LuaGetParam( L, nPar, bForceClosed) ; LuaClearStack( L) ; // creo VZM da superficie trimesh - int nId = ExeCreateVolZmapFromSurfTm( nParentId, nStmId, dPrec, bTriDex, dExtraBox) ; + int nId = ExeCreateVolZmapFromSurfTm( nParentId, nStmId, dPrec, bTriDex, dExtraBox, bForceClosed) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetParam( L, nId) ;