EgtExecutor 2.4l2 :

- aggiunte funzioni Exe e Lua CurveCompoLength.
This commit is contained in:
DarioS
2022-12-12 14:42:45 +01:00
parent 617023edb6
commit 2ba94e5dc1
3 changed files with 38 additions and 0 deletions
+18
View File
@@ -548,6 +548,24 @@ ExeArcNormVersor( int nId, int nRefId, Vector3d& vtNorm)
return TransformVector( pGeomDB, nId, nRefId, vtNorm) ;
}
//----------------------------------------------------------------------------
bool
ExeCurveCompoLength( int nId, int nSimpCrv, double& dLen)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la curva composita
const ICurveComposite* pCompoCrv = GetCurveComposite( pGeomDB->GetGeoObj( nId)) ;
if ( pCompoCrv == nullptr)
return false ;
// recupero la curva semplice di indice richiesto
const ICurve* pSimpCrv = pCompoCrv->GetCurve( nSimpCrv) ;
if ( pSimpCrv == nullptr)
return false ;
// recupero la sua lunghezza
return pSimpCrv->GetLength( dLen) ;
}
//----------------------------------------------------------------------------
bool
ExeCurveCompoCenter( int nId, int nSimpCrv, int nRefId, Point3d& ptCen)
BIN
View File
Binary file not shown.
+20
View File
@@ -432,6 +432,25 @@ LuaArcNormVersor( lua_State* L)
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveCompoLength( lua_State* L)
{
// 2 parametri : Id, nCrv
int nId ;
LuaCheckParam( L, 1, nId)
int nCrv ;
LuaCheckParam( L, 2, nCrv)
LuaClearStack( L) ;
// recupero il centro della curva semplice indicizzata
double dLen ;
if ( ExeCurveCompoLength( nId, nCrv, dLen))
LuaSetParam( L, dLen) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaCurveCompoCenter( lua_State* L)
@@ -538,6 +557,7 @@ LuaInstallGdbGetCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtArcAngCenter", LuaArcAngCenter) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArcDeltaN", LuaArcDeltaN) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtArcNormVersor", LuaArcNormVersor) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoLength", LuaCurveCompoLength) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoCenter", LuaCurveCompoCenter) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoRadius", LuaCurveCompoRadius) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveCompoAngCenter", LuaCurveCompoAngCenter) ;