EgtExecutor 2.2a2 :
- a funzioni Exe/Lua CreateSurfTmBox e CreateSurfTmBBox aggiunto parametro bRegular per regolarizzazione mesh
This commit is contained in:
@@ -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<ISurfTriMesh> pSTM( GetSurfTriMeshBox( dWidth, dLen, dHeight)) ;
|
||||
PtrOwner<ISurfTriMesh> 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<ISurfTriMesh> pSTM( GetSurfTriMeshBox( abs( dWidth), dLen, dHeight)) ;
|
||||
PtrOwner<ISurfTriMesh> pSTM( GetSurfTriMeshBox( abs( dWidth), dLen, dHeight, bRegular)) ;
|
||||
bOk = bOk && ! IsNull( pSTM) ;
|
||||
// eventuale traslazione per larghezza negativa
|
||||
if ( bOk && dWidth < 0)
|
||||
|
||||
Binary file not shown.
+14
-6
@@ -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) ;
|
||||
|
||||
Reference in New Issue
Block a user