Compare commits

...

6 Commits

Author SHA1 Message Date
Dario Sassi 2da612140e EgtExecutor :
- aggiunte funzioni exe/lua AddRawPartGen (per definire un nuovo grezzo a partire da una curva con spessore o da una superficie).
2026-05-15 11:43:08 +02:00
Riccardo Elitropi 5d6f9c5d1d EgtExecutor :
- in ExePocketing aggiunto flag per CalcPocketing per ToolCompensation (Default=false).
2026-05-14 15:31:35 +02:00
Dario Sassi 83ee155b8a EgtExecutor :
- modifiche a EgtSurfTmSwept per avere RMF anche con curve piane e garantendo la retrocompatibilità.
2026-05-14 13:04:07 +02:00
SaraP 3ff02fe0fe EgtExecutor :
- nelle funzioni exe e lua ChainCurvesInGroup e ReorderCurvesInGroup aggiunta tolleranza come parametro opzionale.
2026-05-12 15:09:11 +02:00
Dario Sassi 52cb174832 EgtExecutor 3.1e2 :
- ricompilazione con cambio versione.
2026-05-12 09:48:45 +02:00
Riccardo Elitropi d3a6f99ba5 EgtExecutor :
- in CalcPocketing aggiunto flag per Conventional Milling ( default=true) per ExePocketing.
2026-05-11 10:07:37 +02:00
8 changed files with 77 additions and 21 deletions
+2 -2
View File
@@ -59,8 +59,8 @@ ExePocketing( int nId, double dRad, double dStep, double dAngle, int nType, bool
// eseguo Pocketing // eseguo Pocketing
ICRVCOMPOPOVECTOR vCrvCompoRes ; ICRVCOMPOPOVECTOR vCrvCompoRes ;
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 5., nType, bSmooth, true, false, false, false, true, P_INVALID, nullptr, false, bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 5., nType, bSmooth, true, false, false, true, false, true, P_INVALID, nullptr, false,
dStep, 0, INFINITO, 0, 0, INFINITO, false, 0., 0., vCrvCompoRes) ; dStep, 0, INFINITO, 0, 0, INFINITO, false, 0., 0., false, vCrvCompoRes) ;
nFirstId = GDB_ID_NULL ; nFirstId = GDB_ID_NULL ;
nCrvCount = int( vCrvCompoRes.size()) ; nCrvCount = int( vCrvCompoRes.size()) ;
if ( bOk && nCrvCount > 0) { if ( bOk && nCrvCount > 0) {
+5 -6
View File
@@ -2358,7 +2358,7 @@ ExeCurveCompoSetTempParam( int nId, int nCrv, double dParam, int nParamInd)
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
static bool static bool
MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, int nRefType) MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, int nRefType, double dToler)
{ {
IGeomDB* pGeomDB = GetCurrGeomDB() ; IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false) VERIFY_GEOMDB( pGeomDB, false)
@@ -2368,7 +2368,6 @@ MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, in
if ( ! pGeomDB->GetGroupGlobFrame( nGroupId, frGrp)) if ( ! pGeomDB->GetGroupGlobFrame( nGroupId, frGrp))
return false ; return false ;
// preparo i dati per il concatenamento // preparo i dati per il concatenamento
double dToler = 10 * EPS_SMALL ;
ChainCurves chainC ; ChainCurves chainC ;
chainC.Init( bAllowInvert, dToler, pGeomDB->GetGroupObjs( nGroupId)) ; chainC.Init( bAllowInvert, dToler, pGeomDB->GetGroupObjs( nGroupId)) ;
int nId = pGeomDB->GetFirstInGroup( nGroupId) ; int nId = pGeomDB->GetFirstInGroup( nGroupId) ;
@@ -2412,9 +2411,9 @@ MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, in
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
bool bool
ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType) ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType, double dToler)
{ {
bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, true, nRefType) ; bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, true, nRefType, dToler) ;
ExeSetModified() ; ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente // se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) { if ( IsCmdLog()) {
@@ -2429,9 +2428,9 @@ ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType)
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
bool bool
ExeReorderCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType) ExeReorderCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType, double dToler)
{ {
bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, false, nRefType) ; bool bOk = MyChainCurvesInGroup( nGroupId, ptNear, false, nRefType, dToler) ;
ExeSetModified() ; ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente // se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) { if ( IsCmdLog()) {
+24 -3
View File
@@ -524,17 +524,38 @@ ExeAddRawPart( Point3d ptOrig, double dLength, double dWidth, double dHeight, Co
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
int int
ExeAddRawPartWithPart( int nPartId, int nCrvId, double dOverMat, Color cCol) ExeAddRawPartGen( int nCrvSrfId, double dOverMat, Color cCol)
{ {
IMachMgr* pMachMgr = GetCurrMachMgr() ; IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL) VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
// inserisco grezzo con pezzo nella macchinata corrente // inserisco grezzo con pezzo nella macchinata corrente
int nId = pMachMgr->AddRawPartWithPart( nPartId, nCrvId, dOverMat, cCol) ; int nId = pMachMgr->AddRawPart( nCrvSrfId, dOverMat, cCol) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
string sLua = "EgtAddRawPartGen(" + ToString( nCrvSrfId) + "," +
ToString( dOverMat) + ",{" +
ToString( cCol) + "})" +
" -- Id=" + ToString( nId) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// restituisco il risultato
return nId ;
}
//-----------------------------------------------------------------------------
int
ExeAddRawPartWithPart( int nPartId, int nCrvSrfId, double dOverMat, Color cCol)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, GDB_ID_NULL)
// inserisco grezzo con pezzo nella macchinata corrente
int nId = pMachMgr->AddRawPartWithPart( nPartId, nCrvSrfId, dOverMat, cCol) ;
ExeSetModified() ; ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente // se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) { if ( IsCmdLog()) {
string sLua = "EgtAddRawPartWithPart(" + ToString( nPartId) + "," + string sLua = "EgtAddRawPartWithPart(" + ToString( nPartId) + "," +
ToString( nCrvId) + "," + ToString( nCrvSrfId) + "," +
ToString( dOverMat) + ",{" + ToString( dOverMat) + ",{" +
ToString( cCol) + "})" + ToString( cCol) + "})" +
" -- Id=" + ToString( nId) ; " -- Id=" + ToString( nId) ;
BIN
View File
Binary file not shown.
+8
View File
@@ -38,6 +38,8 @@ AdjustId( int nId, int nCtx)
Vector3d Vector3d
GetVectorLocal( IGeomDB* pGeomDB, const Vector3d& vtV, int nRefType, const Frame3d& frLoc) GetVectorLocal( IGeomDB* pGeomDB, const Vector3d& vtV, int nRefType, const Frame3d& frLoc)
{ {
if ( ! vtV.IsValid())
return vtV ;
Vector3d vtVL( vtV) ; Vector3d vtVL( vtV) ;
if ( nRefType == RTY_GLOB) if ( nRefType == RTY_GLOB)
vtVL.ToLoc( frLoc) ; vtVL.ToLoc( frLoc) ;
@@ -50,6 +52,8 @@ GetVectorLocal( IGeomDB* pGeomDB, const Vector3d& vtV, int nRefType, const Frame
Vector3d Vector3d
GetVectorInRef( IGeomDB* pGeomDB, const Vector3d& vtV, const Frame3d& frLoc, int nRefType) GetVectorInRef( IGeomDB* pGeomDB, const Vector3d& vtV, const Frame3d& frLoc, int nRefType)
{ {
if ( ! vtV.IsValid())
return vtV ;
Vector3d vtVL( vtV) ; Vector3d vtVL( vtV) ;
if ( nRefType == RTY_GLOB) if ( nRefType == RTY_GLOB)
vtVL.ToGlob( frLoc) ; vtVL.ToGlob( frLoc) ;
@@ -62,6 +66,8 @@ GetVectorInRef( IGeomDB* pGeomDB, const Vector3d& vtV, const Frame3d& frLoc, int
Point3d Point3d
GetPointLocal( IGeomDB* pGeomDB, const Point3d& ptP, int nRefType, const Frame3d& frLoc) GetPointLocal( IGeomDB* pGeomDB, const Point3d& ptP, int nRefType, const Frame3d& frLoc)
{ {
if ( ! ptP.IsValid())
return ptP ;
Point3d ptPL( ptP) ; Point3d ptPL( ptP) ;
if ( nRefType == RTY_GLOB) if ( nRefType == RTY_GLOB)
ptPL.ToLoc( frLoc) ; ptPL.ToLoc( frLoc) ;
@@ -74,6 +80,8 @@ GetPointLocal( IGeomDB* pGeomDB, const Point3d& ptP, int nRefType, const Frame3d
Point3d Point3d
GetPointInRef( IGeomDB* pGeomDB, const Point3d& ptP, const Frame3d& frLoc, int nRefType) GetPointInRef( IGeomDB* pGeomDB, const Point3d& ptP, const Frame3d& frLoc, int nRefType)
{ {
if ( ! ptP.IsValid())
return ptP ;
Point3d ptPL( ptP) ; Point3d ptPL( ptP) ;
if ( nRefType == RTY_GLOB) if ( nRefType == RTY_GLOB)
ptPL.ToGlob( frLoc) ; ptPL.ToGlob( frLoc) ;
+1 -1
View File
@@ -805,7 +805,7 @@ LuaCreateSurfTmSwept( lua_State* L)
int nGuideId ; int nGuideId ;
LuaCheckParam( L, 3, nGuideId) LuaCheckParam( L, 3, nGuideId)
int nPar = 4 ; int nPar = 4 ;
Vector3d vtAx = V_NULL ; Vector3d vtAx = V_INVALID ;
if ( LuaGetParam( L, nPar, vtAx)) if ( LuaGetParam( L, nPar, vtAx))
++ nPar ; ++ nPar ;
bool bCapEnds ; bool bCapEnds ;
+13 -9
View File
@@ -409,7 +409,7 @@ LuaTrimExtendCurveByLen( lua_State* L)
int nRefType = RTY_DEFAULT ; int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 4, nRefType) ; LuaGetParam( L, 4, nRefType) ;
LuaClearStack( L) ; LuaClearStack( L) ;
// taglio o allungo la curva nell'estremo più vicino al punto // taglio o allungo la curva nell'estremo più vicino al punto
bool bOk = ExeTrimExtendCurveByLen( nId, dLen, ptNear, nRefType) ; bool bOk = ExeTrimExtendCurveByLen( nId, dLen, ptNear, nRefType) ;
LuaSetParam( L, bOk) ; LuaSetParam( L, bOk) ;
return 1 ; return 1 ;
@@ -943,7 +943,7 @@ LuaCurveCompoSetTempProp( lua_State* L)
int nPropInd = 0 ; int nPropInd = 0 ;
LuaGetParam( L, 4, nPropInd) ; LuaGetParam( L, 4, nPropInd) ;
LuaClearStack( L) ; LuaClearStack( L) ;
// imposto sulla curva della composita la proprietà temporanea // imposto sulla curva della composita la proprietà temporanea
bool bOk = ExeCurveCompoSetTempProp( nId, nCrv, nProp, nPropInd) ; bool bOk = ExeCurveCompoSetTempProp( nId, nCrv, nProp, nPropInd) ;
LuaSetParam( L, bOk) ; LuaSetParam( L, bOk) ;
return 1 ; return 1 ;
@@ -973,16 +973,18 @@ LuaCurveCompoSetTempParam( lua_State* L)
static int static int
LuaChainCurvesInGroup( lua_State* L) LuaChainCurvesInGroup( lua_State* L)
{ {
// 2 o 3 parametri : nGroupId, ptNear [, nRefType] // 2, 3 o 4 parametri : nGroupId, ptNear [, nRefType] [, dToler]
int nGroupId ; int nGroupId ;
LuaCheckParam( L, 1, nGroupId) LuaCheckParam( L, 1, nGroupId)
Point3d ptNear ; Point3d ptNear ;
LuaCheckParam( L, 2, ptNear) LuaCheckParam( L, 2, ptNear)
int nRefType = RTY_DEFAULT ; int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 3, nRefType) ; LuaGetParam( L, 3, nRefType) ;
double dToler = 10 * EPS_SMALL ;
LuaGetParam( L, 4, dToler) ;
LuaClearStack( L) ; LuaClearStack( L) ;
// concateno le curve nel gruppo (senza fonderle in una curva composita) // concateno le curve nel gruppo (senza fonderle in una curva composita)
bool bOk = ExeChainCurvesInGroup( nGroupId, ptNear, nRefType) ; bool bOk = ExeChainCurvesInGroup( nGroupId, ptNear, nRefType, dToler) ;
LuaSetParam( L, bOk) ; LuaSetParam( L, bOk) ;
return 1 ; return 1 ;
} }
@@ -991,16 +993,18 @@ LuaChainCurvesInGroup( lua_State* L)
static int static int
LuaReorderCurvesInGroup( lua_State* L) LuaReorderCurvesInGroup( lua_State* L)
{ {
// 2 o 3 parametri : nGroupId, ptNear [, nRefType] // 2, 3 o 4 parametri : nGroupId, ptNear [, nRefType] [, dToler]
int nGroupId ; int nGroupId ;
LuaCheckParam( L, 1, nGroupId) LuaCheckParam( L, 1, nGroupId)
Point3d ptNear ; Point3d ptNear ;
LuaCheckParam( L, 2, ptNear) LuaCheckParam( L, 2, ptNear)
int nRefType = RTY_DEFAULT ; int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 3, nRefType) ; LuaGetParam( L, 3, nRefType) ;
double dToler = 10 * EPS_SMALL ;
LuaGetParam( L, 4, dToler) ;
LuaClearStack( L) ; LuaClearStack( L) ;
// riordino le curve nel gruppo (senza fonderle in una curva composita) // riordino le curve nel gruppo (senza fonderle in una curva composita)
bool bOk = ExeReorderCurvesInGroup( nGroupId, ptNear, nRefType) ; bool bOk = ExeReorderCurvesInGroup( nGroupId, ptNear, nRefType, dToler) ;
LuaSetParam( L, bOk) ; LuaSetParam( L, bOk) ;
return 1 ; return 1 ;
} }
@@ -1021,7 +1025,7 @@ LuaProjectCurveOnSurf( lua_State* L)
if ( LuaGetParam( L, 4, dLinTol)) if ( LuaGetParam( L, 4, dLinTol))
LuaGetParam( L, 5, dMaxSegmLen) ; LuaGetParam( L, 5, dMaxSegmLen) ;
LuaClearStack( L) ; LuaClearStack( L) ;
// proietto la curva su una o più superfici a minima distanza // proietto la curva su una o più superfici a minima distanza
bool bOk = ExeProjectCurveOnSurf( nCurveId, vSurfId, nDestGrpId, dLinTol, dMaxSegmLen) ; bool bOk = ExeProjectCurveOnSurf( nCurveId, vSurfId, nDestGrpId, dLinTol, dMaxSegmLen) ;
LuaSetParam( L, bOk) ; LuaSetParam( L, bOk) ;
return 1 ; return 1 ;
@@ -1051,7 +1055,7 @@ LuaProjectCurveOnSurfDir( lua_State* L)
LuaGetParam( L, 8, bFromVsTo)) LuaGetParam( L, 8, bFromVsTo))
LuaGetParam( L, 9, nRefType) ; LuaGetParam( L, 9, nRefType) ;
LuaClearStack( L) ; LuaClearStack( L) ;
// proietto la curva su una o più superfici secondo la direzione data // proietto la curva su una o più superfici secondo la direzione data
bool bOk = ExeProjectCurveOnSurfDir( nCurveId, vSurfId, vtDir, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromProj, bFromVsTo, nRefType) ; bool bOk = ExeProjectCurveOnSurfDir( nCurveId, vSurfId, vtDir, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromProj, bFromVsTo, nRefType) ;
LuaSetParam( L, bOk) ; LuaSetParam( L, bOk) ;
return 1 ; return 1 ;
@@ -1079,7 +1083,7 @@ LuaProjectCurveOnSurfExt( lua_State* L)
LuaGetParam( L, 7, bDirFromGuide)) LuaGetParam( L, 7, bDirFromGuide))
LuaGetParam( L, 8, bFromVsTo) ; LuaGetParam( L, 8, bFromVsTo) ;
LuaClearStack( L) ; LuaClearStack( L) ;
// proietto la curva su una o più superfici secondo la direzione verso la guida // proietto la curva su una o più superfici secondo la direzione verso la guida
bool bOk = ExeProjectCurveOnSurfExt( nCurveId, vSurfId, nGuideId, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromGuide, bFromVsTo) ; bool bOk = ExeProjectCurveOnSurfExt( nCurveId, vSurfId, nGuideId, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromGuide, bFromVsTo) ;
LuaSetParam( L, bOk) ; LuaSetParam( L, bOk) ;
return 1 ; return 1 ;
+24
View File
@@ -504,6 +504,7 @@ LuaGetNextRawPart( lua_State* L)
LuaSetParam( L) ; LuaSetParam( L) ;
return 1 ; return 1 ;
} }
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
static int static int
LuaAddRawPart( lua_State* L) LuaAddRawPart( lua_State* L)
@@ -530,6 +531,28 @@ LuaAddRawPart( lua_State* L)
return 1 ; return 1 ;
} }
//-------------------------------------------------------------------------------
static int
LuaAddRawPartGen( lua_State* L)
{
// 3 parametri : nCrvSrfId, dOverMat, Color
int nCrvSrfId ;
LuaCheckParam( L, 1, nCrvSrfId)
double dOverMat ;
LuaCheckParam( L, 2, dOverMat)
Color cCol ;
LuaCheckParam( L, 3, cCol)
LuaClearStack( L) ;
// inserisco il grezzo nella macchinata corrente
int nInd = ExeAddRawPartGen( nCrvSrfId, dOverMat, cCol) ;
// restituisco il risultato
if ( nInd != GDB_ID_NULL)
LuaSetParam( L, nInd) ;
else
LuaSetParam( L) ;
return 1 ;
}
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
static int static int
LuaAddRawPartWithPart( lua_State* L) LuaAddRawPartWithPart( lua_State* L)
@@ -4584,6 +4607,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstRawPart", LuaGetFirstRawPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetFirstRawPart", LuaGetFirstRawPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetNextRawPart", LuaGetNextRawPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtGetNextRawPart", LuaGetNextRawPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddRawPart", LuaAddRawPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAddRawPart", LuaAddRawPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddRawPartGen", LuaAddRawPartGen) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtAddRawPartWithPart", LuaAddRawPartWithPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtAddRawPartWithPart", LuaAddRawPartWithPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyRawPart", LuaModifyRawPart) ; bOk = bOk && luaMgr.RegisterFunction( "EgtModifyRawPart", LuaModifyRawPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtModifyRawPartSize", LuaModifyRawPartSize) ; bOk = bOk && luaMgr.RegisterFunction( "EgtModifyRawPartSize", LuaModifyRawPartSize) ;