EgtInterface 1.6b1 :

- gestione estrusione con facce di chiusura
- gestione rivoluzione con facce di chiusura
- razionalizzazione passaggio a locale.
This commit is contained in:
Dario Sassi
2015-02-02 08:18:35 +00:00
parent 0c41c8c631
commit 4e1dddee86
18 changed files with 531 additions and 731 deletions
+41 -5
View File
@@ -50,22 +50,57 @@ LuaCreateSurfTriMeshByContour( lua_State* L)
static int
LuaCreateSurfTriMeshByExtrusion( lua_State* L)
{
// 3 o 4 o 5 parametri : ParentId, CrvId, vtExtr [, dTol] [, sRefType]
// 4 o 5 o 6 parametri : ParentId, CrvId, vtExtr, bCapEnds [, dTol] [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
LuaCheckParam( L, 2, nCrvId)
Vector3d vtExtr ;
LuaCheckParam( L, 3, vtExtr)
bool bCapEnds ;
LuaCheckParam( L, 4, bCapEnds)
double dLinTol = 0.1 ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 4, dLinTol))
LuaGetRefType( L, 5, nRefType) ;
if ( LuaGetParam( L, 5, dLinTol))
LuaGetRefType( L, 6, nRefType) ;
else
LuaGetRefType( L, 4, nRefType) ;
LuaGetRefType( L, 5, nRefType) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = EgtCreateSurfTriMeshByExtrusion( nParentId, nCrvId, vtExtr.v, dLinTol, nRefType) ;
int nId = EgtCreateSurfTriMeshByExtrusion( nParentId, nCrvId, vtExtr.v,
( bCapEnds ? TRUE : FALSE), dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
else
LuaSetReturn( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCreateSurfTriMeshByRevolve( lua_State* L)
{
// 5 o 6 o 7 parametri : ParentId, CrvId, ptAx, vtAx, bCapEnds [, dTol] [, sRefType]
int nParentId ;
LuaCheckParam( L, 1, nParentId)
int nCrvId ;
LuaCheckParam( L, 2, nCrvId)
Point3d ptAx ;
LuaCheckParam( L, 3, ptAx)
Vector3d vtAx ;
LuaCheckParam( L, 4, vtAx)
bool bCapEnds ;
LuaCheckParam( L, 5, bCapEnds)
double dLinTol = 0.1 ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 6, dLinTol))
LuaGetRefType( L, 7, nRefType) ;
else
LuaGetRefType( L, 6, nRefType) ;
LuaClearStack( L) ;
// creo STM riempiendo un contorno piano
int nId = EgtCreateSurfTriMeshByRevolve( nParentId, nCrvId, ptAx.v, vtAx.v, bCapEnds, dLinTol, nRefType) ;
// restituisco il risultato
if ( nId != GDB_ID_NULL)
LuaSetReturn( L, nId) ;
@@ -140,6 +175,7 @@ LuaInstallGdbCreateSurf( lua_State* L)
try {
lua_register( L, "EgtSurfTmByContour", LuaCreateSurfTriMeshByContour) ;
lua_register( L, "EgtSurfTmByExtrusion", LuaCreateSurfTriMeshByExtrusion) ;
lua_register( L, "EgtSurfTmByRevolve", LuaCreateSurfTriMeshByRevolve) ;
lua_register( L, "EgtSurfTmByScrewing", LuaCreateSurfTriMeshByScrewing) ;
lua_register( L, "EgtSurfTmRuled", LuaCreateSurfTriMeshRuled) ;
}