EgtExecutor 2.2d2 :

- aggiustamenti vari per IsFlat, FromPlaneTrimmedWithBox e GetSurfTriMeshPlaneInBox
- aggiunta funzione Exe e Lua TrimFlatCurveWithBox.
This commit is contained in:
Dario Sassi
2020-04-13 09:07:32 +00:00
parent 8824491888
commit 54c8818cc5
6 changed files with 148 additions and 8 deletions
+31 -1
View File
@@ -363,7 +363,7 @@ LuaTrimExtendCurveByLen( lua_State* L)
static int
LuaTrimCurveWithRegion( lua_State* L)
{
// 4 parametro : nCrvId, nRegId, bInVsOut, bOn
// 4 parametri : nCrvId, nRegId, bInVsOut, bOn
int nCrvId ;
LuaCheckParam( L, 1, nCrvId)
int nRegId ;
@@ -384,6 +384,35 @@ LuaTrimCurveWithRegion( lua_State* L)
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaTrimFlatCurveWithBox( lua_State* L)
{
// 5 o 6 parametri : nCrvId, frBox, vtDiag, bInVsOut, bOn [, nRefType]
int nCrvId ;
LuaCheckParam( L, 1, nCrvId)
Frame3d frBox ;
LuaCheckParam( L, 2, frBox)
Vector3d vtDiag ;
LuaCheckParam( L, 3, vtDiag)
bool bInVsOut ;
LuaCheckParam( L, 4, bInVsOut)
bool bOn ;
LuaCheckParam( L, 5, bOn)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 6, nRefType) ;
LuaClearStack( L) ;
// conservo le parti di curva desiderate
int nCount ;
int nNewId = ExeTrimFlatCurveWithBox( nCrvId, frBox, vtDiag, bInVsOut, bOn, nRefType, &nCount) ;
if ( nNewId != GDB_ID_NULL)
LuaSetParam( L, nNewId) ;
else
LuaSetParam( L) ;
LuaSetParam( L, nCount) ;
return 2 ;
}
//----------------------------------------------------------------------------
static int
LuaSplitCurve( lua_State* L)
@@ -799,6 +828,7 @@ LuaInstallGdbModifyCurve( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtExtendCurveEndByLen", LuaExtendCurveEndByLen) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTrimExtendCurveByLen", LuaTrimExtendCurveByLen) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTrimCurveWithRegion", LuaTrimCurveWithRegion) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTrimFlatCurveWithBox", LuaTrimFlatCurveWithBox) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSplitCurve", LuaSplitCurve) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSplitCurveAtPoint", LuaSplitCurveAtPoint) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSplitCurveAtParam", LuaSplitCurveAtParam) ;