EgtInterface 1.6c2 :
- esplosione curva di Bezier ora dà composita di archi e rette - aggiunte funzioni per creazione circonferenze e archi con tangenze.
This commit is contained in:
+99
-1
@@ -188,6 +188,36 @@ LuaCreateCurveCircleCPN( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateCurveCircleCPNEx( lua_State* L)
|
||||
{
|
||||
// 6 o 7 parametri : ParentId, PtCen, PtOn, sSepO, nIdO, VtN [, sRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptCen ;
|
||||
LuaCheckParam( L, 2, ptCen)
|
||||
Point3d ptOn ;
|
||||
LuaCheckParam( L, 3, ptOn)
|
||||
string sSepO ;
|
||||
LuaCheckParam( L, 4, sSepO)
|
||||
int nIdO ;
|
||||
LuaCheckParam( L, 5, nIdO)
|
||||
Vector3d vtN ;
|
||||
LuaCheckParam( L, 6, vtN)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetRefType( L, 7, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo l'arco
|
||||
int nId = EgtCreateCurveCircleCPNEx( nParentId, ptCen.v, ptOn.v, StringToSep( sSepO), nIdO, vtN.v, nRefType) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetReturn( L, nId) ;
|
||||
else
|
||||
LuaSetReturn( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateCurveCircle3P( lua_State* L)
|
||||
@@ -250,7 +280,7 @@ LuaCreateCurveArc( lua_State* L)
|
||||
static int
|
||||
LuaCreateCurveArcC2PN( lua_State* L)
|
||||
{
|
||||
// 5 o 6 parametri : ParentId, PtCen, PtStart, PtNearEnd, VtNorm [, sRefType]
|
||||
// 5 o 6 parametri : ParentId, PtCen, PtStart, PtNearEnd, VtNorm [, sRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptCen ;
|
||||
@@ -274,6 +304,38 @@ LuaCreateCurveArcC2PN( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateCurveArcC2PNEx( lua_State* L)
|
||||
{
|
||||
// 7 o 8 parametri : ParentId, PtCen, PtStart, sSepS, nIdS, PtNearEnd, VtNorm [, sRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptCen ;
|
||||
LuaCheckParam( L, 2, ptCen)
|
||||
Point3d ptStart ;
|
||||
LuaCheckParam( L, 3, ptStart)
|
||||
string sSepS ;
|
||||
LuaCheckParam( L, 4, sSepS)
|
||||
int nIdS ;
|
||||
LuaCheckParam( L, 5, nIdS)
|
||||
Point3d ptNearEnd ;
|
||||
LuaCheckParam( L, 6, ptNearEnd)
|
||||
Vector3d vtNorm ;
|
||||
LuaCheckParam( L, 7, vtNorm)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetRefType( L, 8, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo l'arco
|
||||
int nId = EgtCreateCurveArcC2PNEx( nParentId, ptCen.v, ptStart.v, StringToSep( sSepS), nIdS, ptNearEnd.v, vtNorm.v, nRefType) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetReturn( L, nId) ;
|
||||
else
|
||||
LuaSetReturn( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateCurveArc3P( lua_State* L)
|
||||
@@ -328,6 +390,39 @@ LuaCreateCurveArc2PVN( lua_State* L)
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateCurveArc2PVNEx( lua_State* L)
|
||||
{
|
||||
// 7 o 8 parametri : ParentId, PtStart, PtEnd, sSepE, nIdE, VtDirS, VtNorm [, sRefType]
|
||||
int nParentId ;
|
||||
LuaCheckParam( L, 1, nParentId)
|
||||
Point3d ptStart ;
|
||||
LuaCheckParam( L, 2, ptStart)
|
||||
Point3d ptEnd ;
|
||||
LuaCheckParam( L, 3, ptEnd)
|
||||
string sSepE ;
|
||||
LuaCheckParam( L, 4, sSepE)
|
||||
int nIdE ;
|
||||
LuaCheckParam( L, 5, nIdE)
|
||||
Vector3d vtDirS ;
|
||||
LuaCheckParam( L, 4, vtDirS)
|
||||
Vector3d vtNorm ;
|
||||
LuaCheckParam( L, 5, vtNorm)
|
||||
int nRefType = RTY_DEFAULT ;
|
||||
LuaGetRefType( L, 6, nRefType) ;
|
||||
LuaClearStack( L) ;
|
||||
// creo l'arco
|
||||
int nId = EgtCreateCurveArc2PVNEx( nParentId, ptStart.v, ptEnd.v, StringToSep( sSepE), nIdE,
|
||||
vtDirS.v, vtNorm.v, nRefType) ;
|
||||
// restituisco il risultato
|
||||
if ( nId != GDB_ID_NULL)
|
||||
LuaSetReturn( L, nId) ;
|
||||
else
|
||||
LuaSetReturn( L) ;
|
||||
return 1 ;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------------
|
||||
static int
|
||||
LuaCreateCurveBezier( lua_State* L)
|
||||
@@ -652,11 +747,14 @@ LuaInstallGdbCreateCurve( lua_State* L)
|
||||
lua_register( L, "EgtLineMinPointCurve", LuaCreateCurveLineMinPointCurve) ;
|
||||
lua_register( L, "EgtCircle", LuaCreateCurveCircle) ;
|
||||
lua_register( L, "EgtCircleCPN", LuaCreateCurveCircleCPN) ;
|
||||
lua_register( L, "EgtCircleCPNEx", LuaCreateCurveCircleCPNEx) ;
|
||||
lua_register( L, "EgtCircle3P", LuaCreateCurveCircle3P) ;
|
||||
lua_register( L, "EgtArc", LuaCreateCurveArc) ;
|
||||
lua_register( L, "EgtArcC2PN", LuaCreateCurveArcC2PN) ;
|
||||
lua_register( L, "EgtArcC2PNEx", LuaCreateCurveArcC2PNEx) ;
|
||||
lua_register( L, "EgtArc3P", LuaCreateCurveArc3P) ;
|
||||
lua_register( L, "EgtArc2PVN", LuaCreateCurveArc2PVN) ;
|
||||
lua_register( L, "EgtArc2PVNEx", LuaCreateCurveArc2PVNEx) ;
|
||||
lua_register( L, "EgtCurveBezier", LuaCreateCurveBezier) ;
|
||||
lua_register( L, "EgtCurveBezierRat", LuaCreateCurveBezierRational) ;
|
||||
lua_register( L, "EgtCurveBezierFromArc", LuaCreateCurveBezierFromArc) ;
|
||||
|
||||
Reference in New Issue
Block a user