EgtExecutor 2.5h2 :

- aggiunta funzione lua EgtPointCurveDistSide.
This commit is contained in:
Dario Sassi
2023-08-11 11:29:21 +02:00
parent cf2b1742a0
commit eedd2068fa
2 changed files with 33 additions and 0 deletions
BIN
View File
Binary file not shown.
+33
View File
@@ -49,6 +49,38 @@ LuaPointCurveDist( lua_State* L)
return 3 ;
}
//----------------------------------------------------------------------------
static int
LuaPointCurveDistSide( lua_State* L)
{
// 3 o 4 parametri : ptP, nCrvId, vtN [, nRefId]
Point3d ptP ;
LuaCheckParam( L, 1, ptP)
int nId ;
LuaCheckParam( L, 2, nId)
Vector3d vtN ;
LuaCheckParam( L, 3, vtN)
int nRefType = nId ;
LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ;
// calcolo la distanza
int nSide ;
double dDist ;
Point3d ptMin ;
bool bOk = ExePointCurveDistSide( ptP, nId, vtN, nRefType, &dDist, ptMin, &nSide) ;
if ( bOk) {
LuaSetParam( L, dDist) ;
LuaSetParam( L, ptMin) ;
LuaSetParam( L, nSide) ;
}
else {
LuaSetParam( L) ;
LuaSetParam( L) ;
LuaSetParam( L) ;
}
return 3 ;
}
//----------------------------------------------------------------------------
static int
LuaPointSurfTmDist( lua_State* L)
@@ -85,6 +117,7 @@ LuaInstallGeoDist( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtPointCurveDist", LuaPointCurveDist) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtPointCurveDistSide", LuaPointCurveDistSide) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtPointSurfTmDist", LuaPointSurfTmDist) ;
return bOk ;
}