EgtExecutor 2.4l2 :
- aggiunte funzioni Exe e Lua CurveCompoLength.
This commit is contained in:
@@ -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)
|
||||
|
||||
Binary file not shown.
@@ -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) ;
|
||||
|
||||
Reference in New Issue
Block a user