EgtExecutor :
- spostate le funzioni di offset. - aggiunta la funzione di offset 3d delle curve.
This commit is contained in:
@@ -56,51 +56,6 @@ LuaOffsetCurve( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaOffsetCurveAdv( lua_State* L)
|
||||
{
|
||||
// 2 o 3 o 4 parametri : Id, dDist [, nType] [, dLinTol]
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
double dDist ;
|
||||
LuaCheckParam( L, 2, dDist)
|
||||
int nType = ICurve::OFF_FILLET ;
|
||||
LuaGetParam( L, 3, nType) ;
|
||||
double dLinTol = 10 * EPS_SMALL ;
|
||||
LuaGetParam( L, 4, dLinTol) ;
|
||||
LuaClearStack( L) ;
|
||||
// offset della curva
|
||||
int nCount ;
|
||||
int nNewId = ExeOffsetCurveAdv( nId, dDist, nType, &nCount, dLinTol) ;
|
||||
if ( nCount >= 0) {
|
||||
LuaSetParam( L, nNewId) ;
|
||||
LuaSetParam( L, nCount) ;
|
||||
}
|
||||
else {
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L, nCount) ;
|
||||
}
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCurveMedialAxis( lua_State* L)
|
||||
{
|
||||
// 1 parametro : Id
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
LuaClearStack( L) ;
|
||||
// calcolo del Medial Axis della curva
|
||||
int nNewId = ExeCurveMedialAxis( nId) ;
|
||||
if ( nNewId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nNewId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaApproxCurve( lua_State* L)
|
||||
@@ -1089,82 +1044,6 @@ LuaProjectCurveOnSurfExt( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCurveGetVoronoi( lua_State* L)
|
||||
{
|
||||
// 2 o 3 parametri : Id/s, nDestGrpId [, nBound]
|
||||
INTVECTOR vIds ;
|
||||
LuaCheckParam( L, 1, vIds)
|
||||
int nDestGrpId ;
|
||||
LuaCheckParam( L, 2, nDestGrpId)
|
||||
int nBound = 3 ; // VORONOI_STD_BOUND
|
||||
LuaGetParam( L, 3, nBound) ;
|
||||
LuaClearStack( L) ;
|
||||
// eseguo
|
||||
int nCount = 0 ;
|
||||
int nNewId = ExeCurveGetVoronoi( vIds, nDestGrpId, nBound, &nCount) ;
|
||||
if ( nNewId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nNewId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L, nCount) ;
|
||||
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCurveMedialAxisAdv( lua_State* L)
|
||||
{
|
||||
// 2 o 3 parametri : Id/s, nDestGrpId [, nSide]
|
||||
INTVECTOR vIds ;
|
||||
LuaCheckParam( L, 1, vIds)
|
||||
int nDestGrpId ;
|
||||
LuaCheckParam( L, 2, nDestGrpId)
|
||||
int nSide = 1 ; // WMAT_LEFT
|
||||
LuaGetParam( L, 3, nSide) ;
|
||||
LuaClearStack( L) ;
|
||||
// eseguo
|
||||
int nCount = 0 ;
|
||||
int nNewId = ExeCurveGetMedialAxis( vIds, nDestGrpId, nSide, &nCount) ;
|
||||
if ( nNewId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nNewId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L, nCount) ;
|
||||
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCurveGetFatCurve( lua_State* L)
|
||||
{
|
||||
// 4 o 5 parametri : Id, nDestGrpId, dRad, bSquare [, bSquareMids]
|
||||
int nId ;
|
||||
LuaCheckParam( L, 1, nId)
|
||||
int nDestGrpId ;
|
||||
LuaCheckParam( L, 2, nDestGrpId)
|
||||
double dRad ;
|
||||
LuaCheckParam( L, 3, dRad)
|
||||
bool bSquareEnds ;
|
||||
LuaCheckParam( L, 4, bSquareEnds)
|
||||
bool bSquareMids = bSquareEnds ;
|
||||
LuaGetParam( L, 5, bSquareMids) ;
|
||||
LuaClearStack( L) ;
|
||||
// eseguo
|
||||
int nCount = 0 ;
|
||||
int nNewId = ExeCurveGetFatCurve( nId, nDestGrpId, dRad, bSquareEnds, bSquareMids, &nCount) ;
|
||||
if ( nNewId != GDB_ID_NULL)
|
||||
LuaSetParam( L, nNewId) ;
|
||||
else
|
||||
LuaSetParam( L) ;
|
||||
LuaSetParam( L, nCount) ;
|
||||
|
||||
return 2 ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCurveBezierIncreaseDegree( lua_State* L)
|
||||
@@ -1236,8 +1115,6 @@ LuaInstallGdbModifyCurve( LuaMgr& luaMgr)
|
||||
bool bOk = ( &luaMgr != nullptr) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtInvertCurve", LuaInvertCurve) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtOffsetCurve", LuaOffsetCurve) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtOffsetCurveAdv", LuaOffsetCurveAdv) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveMedialAxis", LuaCurveMedialAxis) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtApproxCurve", LuaApproxCurve) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnPlane", LuaProjectCurveOnPlane) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtChangeClosedCurveStart", LuaChangeClosedCurveStart) ;
|
||||
@@ -1290,9 +1167,6 @@ LuaInstallGdbModifyCurve( LuaMgr& luaMgr)
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnSurf", LuaProjectCurveOnSurf) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnSurfDir", LuaProjectCurveOnSurfDir) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtProjectCurveOnSurfExt", LuaProjectCurveOnSurfExt) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveGetVoronoi", LuaCurveGetVoronoi) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveMedialAxisAdv", LuaCurveMedialAxisAdv) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveGetFatCurve", LuaCurveGetFatCurve) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezierIncreaseDeg", LuaCurveBezierIncreaseDegree) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezierDecreaseDeg", LuaCurveBezierDecreaseDegree) ;
|
||||
bOk = bOk && luaMgr.RegisterFunction( "EgtCurveBezierApproxToNonRat", LuaCurveBezierApproxToNonRat) ;
|
||||
|
||||
Reference in New Issue
Block a user