EgtExecutor 2.2a2 :

- a funzioni Exe/Lua CreateSurfTmBox e CreateSurfTmBBox aggiunto parametro bRegular per regolarizzazione mesh
This commit is contained in:
Dario Sassi
2020-01-07 18:11:14 +00:00
parent 6131010957
commit bcdcc46deb
3 changed files with 18 additions and 10 deletions
+14 -6
View File
@@ -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) ;