From bcdcc46deb13b26d50616a3484d90136a88ca47f Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 7 Jan 2020 18:11:14 +0000 Subject: [PATCH] EgtExecutor 2.2a2 : - a funzioni Exe/Lua CreateSurfTmBox e CreateSurfTmBBox aggiunto parametro bRegular per regolarizzazione mesh --- EXE_GdbCreateSurf.cpp | 8 ++++---- EgtExecutor.rc | Bin 16176 -> 16176 bytes LUA_GdbCreateSurf.cpp | 20 ++++++++++++++------ 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/EXE_GdbCreateSurf.cpp b/EXE_GdbCreateSurf.cpp index 1325f0c..bccff45 100644 --- a/EXE_GdbCreateSurf.cpp +++ b/EXE_GdbCreateSurf.cpp @@ -584,7 +584,7 @@ ExeCreateSurfTmConvexHullInBBox( int nParentId, int nId, const BBox3d& b3Box, in //------------------------------------------------------------------------------- int -ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, int nRefType) +ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, bool bRegular, int nRefType) { // bounding box orientato come gli assi del riferimento IGeomDB* pGeomDB = GetCurrGeomDB() ; @@ -610,7 +610,7 @@ ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, int nRefType) Frame3d frBox ; bOk = bOk && frBox.Set( ptIniL, ptDirL, ptCrossL) ; // creo il box nel suo riferimento intrinseco - PtrOwner pSTM( GetSurfTriMeshBox( dWidth, dLen, dHeight)) ; + PtrOwner pSTM( GetSurfTriMeshBox( dWidth, dLen, dHeight, bRegular)) ; bOk = bOk && ! IsNull( pSTM) ; // porto il box nel riferimento locale bOk = bOk && pSTM->ToGlob( frBox) ; @@ -633,7 +633,7 @@ ExeCreateSurfTmBBox( int nParentId, const BBox3d& b3Box, int nRefType) //------------------------------------------------------------------------------- int ExeCreateSurfTmBox( int nParentId, const Point3d& ptIni, const Point3d& ptCross, - const Point3d& ptDir, double dHeight, int nRefType) + const Point3d& ptDir, double dHeight, bool bRegular, int nRefType) { IGeomDB* pGeomDB = GetCurrGeomDB() ; VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL) @@ -660,7 +660,7 @@ ExeCreateSurfTmBox( int nParentId, const Point3d& ptIni, const Point3d& ptCross, double dWidth = ptCrossI.x ; double dLen = ptCrossI.y ; // creo il box nel suo riferimento intrinseco - PtrOwner pSTM( GetSurfTriMeshBox( abs( dWidth), dLen, dHeight)) ; + PtrOwner pSTM( GetSurfTriMeshBox( abs( dWidth), dLen, dHeight, bRegular)) ; bOk = bOk && ! IsNull( pSTM) ; // eventuale traslazione per larghezza negativa if ( bOk && dWidth < 0) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index f367abb250caf56ccdac41cc6f04d24fa4fde82e..9ad66587c77a9bb7591fc4a11642ec105761d08a 100644 GIT binary patch delta 79 zcmdl`x1nysFE&P_&A-`PnSqoe*K!sx?>N)s4T4pSMw1=6k~jAW*?>e(i-FY$N+HxV MD8kglDP58Q0C_7LTL1t6 delta 79 zcmdl`x1nysFE&QQ&A-`PnSqoe*K!sx?>N)s4T4pShLat+k~jAW*?>e(i-FY$N+HxV MD8kglDP58Q0C(RTQvd(} diff --git a/LUA_GdbCreateSurf.cpp b/LUA_GdbCreateSurf.cpp index 0cf7cdd..6331cd1 100644 --- a/LUA_GdbCreateSurf.cpp +++ b/LUA_GdbCreateSurf.cpp @@ -224,16 +224,20 @@ LuaCreateSurfTmConvexHullInBBox( lua_State* L) static int LuaCreateSurfTmBBox( lua_State* L) { - // 2 o 3 parametri : ParentId, BBox3d [, nRefType] + // 2 o 3 o 4 parametri : ParentId, BBox3d [, bRegular] [, nRefType] int nParentId ; LuaCheckParam( L, 1, nParentId) BBox3d b3Box ; LuaCheckParam( L, 2, b3Box) + bool bRegular = false ; int nRefType = RTY_DEFAULT ; - LuaGetParam( L, 3, nRefType) ; + if ( LuaGetParam( L, 3, bRegular)) + LuaGetParam( L, 4, nRefType) ; + else + LuaGetParam( L, 3, nRefType) ; LuaClearStack( L) ; // creo STM bounding box - int nId = ExeCreateSurfTmBBox( nParentId, b3Box, nRefType) ; + int nId = ExeCreateSurfTmBBox( nParentId, b3Box, bRegular, nRefType) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetParam( L, nId) ; @@ -246,7 +250,7 @@ LuaCreateSurfTmBBox( lua_State* L) static int LuaCreateSurfTmBox( lua_State* L) { - // 5 o 6 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, nRefType] + // 5 o 6 o 7 parametri : ParentId, PtIni, PtCross, PtDir, dHeight [, nRefType] int nParentId ; LuaCheckParam( L, 1, nParentId) Point3d ptIni ; @@ -257,11 +261,15 @@ LuaCreateSurfTmBox( lua_State* L) LuaCheckParam( L, 4, ptDir) double dHeight ; LuaCheckParam( L, 5, dHeight) + bool bRegular = false ; int nRefType = RTY_DEFAULT ; - LuaGetParam( L, 6, nRefType) ; + if ( LuaGetParam( L, 6, bRegular)) + LuaGetParam( L, 7, nRefType) ; + else + LuaGetParam( L, 6, nRefType) ; LuaClearStack( L) ; // creo STM parallelepipedo - int nId = ExeCreateSurfTmBox( nParentId, ptIni, ptCross, ptDir, dHeight, nRefType) ; + int nId = ExeCreateSurfTmBox( nParentId, ptIni, ptCross, ptDir, dHeight, bRegular, nRefType) ; // restituisco il risultato if ( nId != GDB_ID_NULL) LuaSetParam( L, nId) ;