EgtExecutor 1.9i4 :

- funzioni di intersezione raccolte in modulo apposito
- aggiunta funzione Exe e Lua BoxLineInters.
This commit is contained in:
Dario Sassi
2018-10-01 07:28:17 +00:00
parent b393ffe181
commit 984292fed9
16 changed files with 927 additions and 721 deletions
-62
View File
@@ -293,66 +293,6 @@ LuaCopySurfTmFacet( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaGetSurfTmPlaneInters( lua_State* L)
{
// 4 o 5 parametri : Id, ptOn, vtN, nDestGrpId [, nRefType]
int nId ;
LuaCheckParam( L, 1, nId)
Point3d ptOn ;
LuaCheckParam( L, 2, ptOn)
Vector3d vtN ;
LuaCheckParam( L, 3, vtN)
int nDestGrpId ;
LuaGetParam( L, 4, nDestGrpId) ;
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 5, nRefType) ;
LuaClearStack( L) ;
// eseguo l'intersezione
int nPntCount = 0 ;
int nCrvCount = 0 ;
int nSrfCount = 0 ;
int nNewId = ExeGetSurfTmPlaneInters( nId, ptOn, vtN, nDestGrpId, nRefType, &nPntCount, &nCrvCount, &nSrfCount) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nPntCount) ;
LuaSetParam( L, nCrvCount) ;
LuaSetParam( L, nSrfCount) ;
return 4 ;
}
//----------------------------------------------------------------------------
static int
LuaGetSurfTmSurfTmInters( lua_State* L)
{
// 3 parametri : Id1, nId2, nDestGrpId
int nId1 ;
LuaCheckParam( L, 1, nId1)
int nId2 ;
LuaCheckParam( L, 2, nId2)
int nDestGrpId ;
LuaCheckParam( L, 3, nDestGrpId) ;
LuaClearStack( L) ;
// eseguo l'intersezione
int nPntCount = 0 ;
int nCrvCount = 0 ;
int nSrfCount = 0 ;
int nNewId = ExeGetSurfTmSurfTmInters( nId1, nId2, nDestGrpId, &nPntCount, &nCrvCount, &nSrfCount) ;
// restituisco il risultato
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nPntCount) ;
LuaSetParam( L, nCrvCount) ;
LuaSetParam( L, nSrfCount) ;
return 4 ;
}
//----------------------------------------------------------------------------
static int
LuaCutSurfTmPlane( lua_State* L)
@@ -394,8 +334,6 @@ LuaInstallGdbModifySurf( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfTmSilhouette", LuaGetSurfTmSilhouette) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExtractSurfTmFacetLoops", LuaExtractSurfTmFacetLoops) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCopySurfTmFacet", LuaCopySurfTmFacet) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfTmPlaneInters", LuaGetSurfTmPlaneInters) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetSurfTmSurfTmInters", LuaGetSurfTmSurfTmInters) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfTmPlane", LuaCutSurfTmPlane) ;
return bOk ;
}