Compare commits

...

19 Commits

Author SHA1 Message Date
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
Dario Sassi e31fcee338 EgtExecutor 3.1e1 :
- ricompilazione con cambio versione.
2026-05-07 12:23:40 +02:00
Daniele Bariletti 4746474864 EgtExecutor :
- aggiunto argomento alla RegolarizeSurfaceLocally.
2026-05-07 11:29:44 +02:00
Daniele Bariletti 7cefd64b2a EgtExecutor :
- modificata funzione per la regolarize.
2026-04-22 16:42:46 +02:00
Daniele Bariletti 8a51d5e3a5 Merge branch 'Trimming' 2026-04-21 15:09:38 +02:00
Daniele Bariletti d32fdc5417 EgtExecutor :
- aggiunte funzioni per regolarizzare i bordi di una surf di trimming.
2026-04-21 15:06:24 +02:00
Daniele Bariletti ccaaa5bd22 Merge branch 'master' into Trimming 2026-04-20 09:27:37 +02:00
Dario Sassi 00e6d24f2e EgtExecutor 3.1d3 :
- piccoli aggiustamenti.
2026-04-19 10:55:49 +02:00
Daniele Bariletti 2d4d4ddf03 EgtExecutor .
- aggiunto controllo.
2026-04-17 13:23:56 +02:00
Dario Sassi cfcb844923 EgtExecutor 3.1d2 :
- nelle funzioni exe e lua di proiezione di curve su superfici aggiunto paramtetro bFromVsTo.
2026-04-15 08:56:43 +02:00
Dario Sassi e9f368a85f EgtExecutor 3.1d1 :
- aggiunta funzione Exe/lua Redraw
- aggiunte funzioni Exe/lua SurfTmGetSmoothAng e VolZmapGetShowEdges.
2026-04-08 19:30:11 +02:00
Riccardo Elitropi 1abcac8aa4 EgtExecutor :
- In ExePocketing aggiunti parametri per lucidatura.
2026-03-31 19:02:17 +02:00
Daniele Bariletti a9b5d9627a Merge branch 'master' of https://gitlab.steamware.net/egaltech/EgtExecutor 2026-03-31 15:02:04 +02:00
Daniele Bariletti 41790f7d57 EgtExecutor :
- aggiunto controllo.
2026-03-31 15:01:56 +02:00
Riccardo Elitropi c33cbe7b9f EgtExecutor 3.1c6 :
- In Nesting aggiunto controllo e gestione di collisioni con i loop interni delle regioni piane
- in nesting aggiunte funzioni per interferenza tra regioni piane
- aggiunto controllo per allineamento e riposizionamento nel caso di lavorazioni con Waterjet.
2026-03-31 14:24:05 +02:00
Riccardo Elitropi 35455e011e Merge commit '1d9ecd9b7874511eb24965b857a7d7b21dc9b8b3' 2026-03-31 14:21:08 +02:00
Riccardo Elitropi 0e8f8d0502 EgtExecutor :
- prima versione per Trimming.
2025-12-22 17:07:44 +01:00
16 changed files with 228 additions and 58 deletions
+1 -1
View File
@@ -760,7 +760,7 @@ ExeShowCurveBezierControlPoints( int nCrvId, int nDestGrpId, int* pnCount)
VERIFY_GEOMDB( pGeomDB, false)
// recupero la curva di Bezier
IGeoObj* pGeoObj = pGeomDB->GetGeoObj( nCrvId) ;
if ( pGeoObj->GetType() != CRV_BEZIER && pGeoObj->GetType() != CRV_COMPO)
if ( pGeoObj == nullptr || ( pGeoObj->GetType() != CRV_BEZIER && pGeoObj->GetType() != CRV_COMPO))
return GDB_ID_NULL ;
// recupero il riferimento della curva
Frame3d frCrv ;
+2 -1
View File
@@ -59,7 +59,8 @@ ExePocketing( int nId, double dRad, double dStep, double dAngle, int nType, bool
// eseguo Pocketing
ICRVCOMPOPOVECTOR vCrvCompoRes ;
bool bOk = CalcPocketing( pSfr, dRad, 0, dStep, dAngle, 5., nType, bSmooth, true, false, false, false, true, P_INVALID, nullptr, false, dStep, INFINITO, 0, vCrvCompoRes) ;
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) ;
nFirstId = GDB_ID_NULL ;
nCrvCount = int( vCrvCompoRes.size()) ;
if ( bOk && nCrvCount > 0) {
+1 -1
View File
@@ -1906,7 +1906,7 @@ ExeShowSurfBezierControlPoints( int nSrfId, int nDestGrpId, int* pnCount)
VERIFY_GEOMDB( pGeomDB, GDB_ID_NULL)
// recupero la superficie di bezier
IGeoObj* pGeoObj = pGeomDB->GetGeoObj( nSrfId) ;
if ( pGeoObj->GetType() != SRF_BEZIER)
if ( pGeoObj == nullptr || pGeoObj->GetType() != SRF_BEZIER)
return GDB_ID_NULL ;
// recupero il riferimento della superficie
Frame3d frSurf ;
+18 -17
View File
@@ -2358,7 +2358,7 @@ ExeCurveCompoSetTempParam( int nId, int nCrv, double dParam, int nParamInd)
//-------------------------------------------------------------------------------
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() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -2368,7 +2368,6 @@ MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, in
if ( ! pGeomDB->GetGroupGlobFrame( nGroupId, frGrp))
return false ;
// preparo i dati per il concatenamento
double dToler = 10 * EPS_SMALL ;
ChainCurves chainC ;
chainC.Init( bAllowInvert, dToler, pGeomDB->GetGroupObjs( nGroupId)) ;
int nId = pGeomDB->GetFirstInGroup( nGroupId) ;
@@ -2412,9 +2411,9 @@ MyChainCurvesInGroup( int nGroupId, const Point3d& ptNear, bool bAllowInvert, in
//-------------------------------------------------------------------------------
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() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
@@ -2429,9 +2428,9 @@ ExeChainCurvesInGroup( int nGroupId, const Point3d& ptNear, int nRefType)
//-------------------------------------------------------------------------------
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() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
@@ -2545,7 +2544,7 @@ ExeProjectCurveOnSurf( int nCurveId, const INTVECTOR& vnSurfId, int nDestGrpId,
//-------------------------------------------------------------------------------
static bool
MyProjectCurveOnSurfDir( int nCurveId, const INTVECTOR& vnSurfId, const Vector3d& vtProj, int nDestGrpId,
double dLinTol, double dMaxSegmLen, bool bDirFromProj, int nRefType)
double dLinTol, double dMaxSegmLen, bool bDirFromProj, bool bFromVsTo, int nRefType)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -2587,7 +2586,7 @@ MyProjectCurveOnSurfDir( int nCurveId, const INTVECTOR& vnSurfId, const Vector3d
bool bSharpEdges = ( ! bDirFromProj) ;
// eseguo la proiezione
PNT5AXVECTOR vPt5ax ;
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, vtProjL, dLinTol, dMaxSegmLen, bSharpEdges, vPt5ax))
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, vtProjL, dLinTol, dMaxSegmLen, bSharpEdges, bFromVsTo, vPt5ax))
return false ;
// inserisco la composita nel gruppo destinazione
PtrOwner<ICurveComposite> pCompo ;
@@ -2626,9 +2625,9 @@ MyProjectCurveOnSurfDir( int nCurveId, const INTVECTOR& vnSurfId, const Vector3d
//-------------------------------------------------------------------------------
bool
ExeProjectCurveOnSurfDir( int nCurveId, const INTVECTOR& vnSurfId, const Vector3d& vtProj, int nDestGrpId,
double dLinTol, double dMaxSegmLen, bool bDirFromProj, int nRefType)
double dLinTol, double dMaxSegmLen, bool bDirFromProj, bool bFromVsTo, int nRefType)
{
bool bOk = MyProjectCurveOnSurfDir( nCurveId, vnSurfId, vtProj, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromProj, nRefType) ;
bool bOk = MyProjectCurveOnSurfDir( nCurveId, vnSurfId, vtProj, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromProj, bFromVsTo, nRefType) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
@@ -2639,6 +2638,7 @@ ExeProjectCurveOnSurfDir( int nCurveId, const INTVECTOR& vnSurfId, const Vector3
ToString( dLinTol) + "," +
ToString( dMaxSegmLen) + "," +
( bDirFromProj ? "true" : "false") + "," +
( bFromVsTo ? "true" : "false") + "," +
RefTypeToString( nRefType) + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
@@ -2649,7 +2649,7 @@ ExeProjectCurveOnSurfDir( int nCurveId, const INTVECTOR& vnSurfId, const Vector3
//-------------------------------------------------------------------------------
static bool
MyProjectCurveOnSurfExt( int nCurveId, const INTVECTOR& vnSurfId, int nGuideId, int nDestGrpId,
double dLinTol, double dMaxSegmLen, bool bDirFromGuide)
double dLinTol, double dMaxSegmLen, bool bDirFromGuide, bool bFromVsTo)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
@@ -2710,14 +2710,14 @@ MyProjectCurveOnSurfExt( int nCurveId, const INTVECTOR& vnSurfId, int nGuideId,
if ( pGdeLoc == nullptr)
return false ;
pGdeLoc->LocToLoc( frGde, frSurf) ;
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, *pGdeLoc, dLinTol, dMaxSegmLen, bSharpEdges, vPt5ax))
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, *pGdeLoc, dLinTol, dMaxSegmLen, bSharpEdges, bFromVsTo, vPt5ax))
return false ;
}
else if ( pGdeCrv != nullptr) {
CurveLocal GdeLoc( pGdeCrv, frGde, frSurf) ;
if ( GdeLoc.Get() == nullptr)
return false ;
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, *GdeLoc.Get(), dLinTol, dMaxSegmLen, bSharpEdges, vPt5ax))
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, *GdeLoc.Get(), dLinTol, dMaxSegmLen, bSharpEdges, bFromVsTo, vPt5ax))
return false ;
}
else { // pGdeStm != nullptr
@@ -2725,7 +2725,7 @@ MyProjectCurveOnSurfExt( int nCurveId, const INTVECTOR& vnSurfId, int nGuideId,
const ISurf* pGdeLoc = GetSurf( GdeLoc.Get()) ;
if ( pGdeLoc == nullptr)
return false ;
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, *pGdeLoc, dLinTol, dMaxSegmLen, bSharpEdges, vPt5ax))
if ( ! ProjectCurveOnSurf( *CrvLoc.Get(), vpSurf, *pGdeLoc, dLinTol, dMaxSegmLen, bSharpEdges, bFromVsTo, vPt5ax))
return false ;
}
// inserisco la composita nel gruppo destinazione
@@ -2765,9 +2765,9 @@ MyProjectCurveOnSurfExt( int nCurveId, const INTVECTOR& vnSurfId, int nGuideId,
//-------------------------------------------------------------------------------
bool
ExeProjectCurveOnSurfExt( int nCurveId, const INTVECTOR& vnSurfId, int nGuideId, int nDestGrpId,
double dLinTol, double dMaxSegmLen, bool bDirFromGuide)
double dLinTol, double dMaxSegmLen, bool bDirFromGuide, bool bFromVsTo)
{
bool bOk = MyProjectCurveOnSurfExt( nCurveId, vnSurfId, nGuideId, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromGuide) ;
bool bOk = MyProjectCurveOnSurfExt( nCurveId, vnSurfId, nGuideId, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromGuide, bFromVsTo) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
if ( IsCmdLog()) {
@@ -2777,7 +2777,8 @@ ExeProjectCurveOnSurfExt( int nCurveId, const INTVECTOR& vnSurfId, int nGuideId,
ToString( nDestGrpId) + "," +
ToString( dLinTol) + "," +
ToString( dMaxSegmLen) + "," +
( bDirFromGuide ? "true" : "false") + ")" +
( bDirFromGuide ? "true" : "false") + "," +
( bFromVsTo ? "true" : "false") + ")" +
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
+22 -1
View File
@@ -1185,7 +1185,10 @@ ExeSurfTmGetShowEdges( int nId, bool& bShow)
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pStm != nullptr) ;
// recupero lo stato di visualizzazione degli spigoli vivi
bShow = ( bOk && pStm->GetShowEdges()) ;
if ( bOk)
bShow = pStm->GetShowEdges() ;
else
bShow = false ;
return bOk ;
}
@@ -1199,6 +1202,7 @@ ExeSurfTmSetSmoothAng( int nId, double dAngDeg)
ISurfTriMesh* pSrfTm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
if ( pSrfTm == nullptr)
return false ;
// imposto l'angolo discriminante degli spigoli vivi
pSrfTm->SetSmoothAngle( dAngDeg) ;
ExeSetModified() ;
// se richiesto, salvo il comando Lua equivalente
@@ -1210,6 +1214,23 @@ ExeSurfTmSetSmoothAng( int nId, double dAngDeg)
return true ;
}
//----------------------------------------------------------------------------
bool
ExeSurfTmGetSmoothAng( int nId, double& dAngDeg)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la superficie trimesh
ISurfTriMesh* pStm = GetSurfTriMesh( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pStm != nullptr) ;
// recupero l'angolo discriminante degli spigoli vivi
if ( bOk)
dAngDeg = pStm->GetSmoothAngle() ;
else
dAngDeg = 0 ;
return bOk ;
}
//----------------------------------------------------------------------------
static double
GetStmOffsPrec( double dOffs, double dLinTol)
+17
View File
@@ -142,6 +142,23 @@ ExeVolZmapSetShowEdges( int nId, bool bShow)
return bOk ;
}
//----------------------------------------------------------------------------
bool
ExeVolZmapGetShowEdges( int nId, bool& bShow)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero lo Zmap
IVolZmap* pVZM = GetVolZmap( pGeomDB->GetGeoObj( nId)) ;
bool bOk = ( pVZM != nullptr) ;
// leggo lo stato di visualizzazione degli spigoli vivi
if ( bOk)
bShow = pVZM->GetShowEdges() ;
else
bShow = false ;
return bOk ;
}
//-------------------------------------------------------------------------------
bool
ExeRemoveVolZmapPart( int nId, int nPart)
+5 -5
View File
@@ -3142,12 +3142,12 @@ ExeGetClEntAxesVal( int nEntId, DBLVECTOR& vAxes)
//-----------------------------------------------------------------------------
bool
ExeGetClEntTDir( int nEntId, Vector3d& vTDir)
ExeGetClEntTDir( int nEntId, Vector3d& vtTDir)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false) ;
// recupero vTDir
return pMachMgr->GetClEntTDir( nEntId, vTDir) ;
// recupero TDir
return pMachMgr->GetClEntTDir( nEntId, vtTDir) ;
}
//-----------------------------------------------------------------------------
@@ -3162,12 +3162,12 @@ ExeGetClEntCDir( int nEntId, Vector3d& vtCDir)
//-----------------------------------------------------------------------------
bool
ExeGetClEntADir( int nEntId, Vector3d& vADir)
ExeGetClEntADir( int nEntId, Vector3d& vtADir)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false) ;
// recupero ADir
return pMachMgr->GetClEntADir( nEntId, vADir) ;
return pMachMgr->GetClEntADir( nEntId, vtADir) ;
}
//-----------------------------------------------------------------------------
+15
View File
@@ -267,6 +267,21 @@ ExeDraw( void)
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeRedraw( void)
{
// se interfaccia disabilitata, esco subito
if ( ! ExeGetEnableUI())
return true ;
IEGrScene* pScene = GetCurrScene() ;
VERIFY_SCENE( pScene, false)
// forzo ridisegno
pScene->RedrawWindow() ;
return true ;
}
//-----------------------------------------------------------------------------
bool
ExeSelect( int nWinX, int nWinY, int nSelW, int nSelH, int* pnSel)
+30
View File
@@ -866,3 +866,33 @@ ExeTrimmingGetSurfBzSyncPoints( int nParentId, int nEdge1Id, int nEdge2Id, doubl
return bOk ;
}
// ---------------------------------------------------------------------------
int
ExeRegolarizeSurfaceLocally( int nParentId, int nSurfId, int nSyncStartId, int nSyncEndId, double dLinTol, int nType)
{
bool bOk = true ;
// Verifica database geometrico
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// recupero la superficie
ISurfBezier* pSurfBez = GetSurfBezier( GetSurf( pGeomDB->GetGeoObj( nSurfId))) ;
// recupero le due isocurve
const ICurve* pSyncStart = GetCurveLine( GetCurve( pGeomDB->GetGeoObj( nSyncStartId))) ;
const ICurve* pSyncEnd = GetCurveLine( GetCurve( pGeomDB->GetGeoObj( nSyncEndId))) ;
Point3d ptS1 ; pSyncStart->GetStartPoint( ptS1) ;
Point3d ptE1 ; pSyncStart->GetEndPoint( ptE1) ;
BIPOINT bpIsoStart( ptS1, ptE1) ;
Point3d ptS2 ; pSyncEnd->GetStartPoint( ptS2) ;
Point3d ptE2 ; pSyncEnd->GetEndPoint( ptE2) ;
BIPOINT bpIsoEnd( ptS2, ptE2) ;
PtrOwner<ISurfBezier> pNewSurf( RegolarizeBordersLocally( pSurfBez, bpIsoStart, bpIsoEnd, dLinTol, nType)) ;
if ( IsNull( pNewSurf))
return GDB_ID_NULL ;
int nId = pGeomDB->AddGeoObj( GDB_ID_NULL, nParentId, Release( pNewSurf)) ;
return nId ;
}
BIN
View File
Binary file not shown.
+25 -17
View File
@@ -409,7 +409,7 @@ LuaTrimExtendCurveByLen( lua_State* L)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 4, nRefType) ;
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) ;
LuaSetParam( L, bOk) ;
return 1 ;
@@ -943,7 +943,7 @@ LuaCurveCompoSetTempProp( lua_State* L)
int nPropInd = 0 ;
LuaGetParam( L, 4, nPropInd) ;
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) ;
LuaSetParam( L, bOk) ;
return 1 ;
@@ -973,16 +973,18 @@ LuaCurveCompoSetTempParam( lua_State* L)
static int
LuaChainCurvesInGroup( lua_State* L)
{
// 2 o 3 parametri : nGroupId, ptNear [, nRefType]
// 2, 3 o 4 parametri : nGroupId, ptNear [, nRefType] [, dToler]
int nGroupId ;
LuaCheckParam( L, 1, nGroupId)
Point3d ptNear ;
LuaCheckParam( L, 2, ptNear)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 3, nRefType) ;
double dToler = 10 * EPS_SMALL ;
LuaGetParam( L, 4, dToler) ;
LuaClearStack( L) ;
// 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) ;
return 1 ;
}
@@ -991,16 +993,18 @@ LuaChainCurvesInGroup( lua_State* L)
static int
LuaReorderCurvesInGroup( lua_State* L)
{
// 2 o 3 parametri : nGroupId, ptNear [, nRefType]
// 2, 3 o 4 parametri : nGroupId, ptNear [, nRefType] [, dToler]
int nGroupId ;
LuaCheckParam( L, 1, nGroupId)
Point3d ptNear ;
LuaCheckParam( L, 2, ptNear)
int nRefType = RTY_DEFAULT ;
LuaGetParam( L, 3, nRefType) ;
double dToler = 10 * EPS_SMALL ;
LuaGetParam( L, 4, dToler) ;
LuaClearStack( L) ;
// 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) ;
return 1 ;
}
@@ -1021,7 +1025,7 @@ LuaProjectCurveOnSurf( lua_State* L)
if ( LuaGetParam( L, 4, dLinTol))
LuaGetParam( L, 5, dMaxSegmLen) ;
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) ;
LuaSetParam( L, bOk) ;
return 1 ;
@@ -1031,7 +1035,7 @@ LuaProjectCurveOnSurf( lua_State* L)
static int
LuaProjectCurveOnSurfDir( lua_State* L)
{
// 4, 5, 6, 7 o 8 parametri : nCurveId, vSurfId, vtDir, nDestGrpId [, dLinTol [, dMaxSegmLen] [, bDirFromProj] [, nRefType]]
// 4, 5, 6, 7 o 8 parametri : nCurveId, vSurfId, vtDir, nDestGrpId [, dLinTol [, dMaxSegmLen] [, bDirFromProj] [,bFromVsTo] [, nRefType]]
int nCurveId ;
LuaCheckParam( L, 1, nCurveId)
INTVECTOR vSurfId ;
@@ -1043,14 +1047,16 @@ LuaProjectCurveOnSurfDir( lua_State* L)
double dLinTol = 0.01 ;
double dMaxSegmLen = INFINITO ;
bool bDirFromProj = false ;
bool bFromVsTo = true ;
int nRefType = RTY_DEFAULT ;
if ( LuaGetParam( L, 5, dLinTol) &&
LuaGetParam( L, 6, dMaxSegmLen) &&
LuaGetParam( L, 7, bDirFromProj))
LuaGetParam( L, 8, nRefType) ;
LuaGetParam( L, 7, bDirFromProj) &&
LuaGetParam( L, 8, bFromVsTo))
LuaGetParam( L, 9, nRefType) ;
LuaClearStack( L) ;
// proietto la curva su una o più superfici secondo la direzione data
bool bOk = ExeProjectCurveOnSurfDir( nCurveId, vSurfId, vtDir, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromProj, nRefType) ;
// proietto la curva su una o più superfici secondo la direzione data
bool bOk = ExeProjectCurveOnSurfDir( nCurveId, vSurfId, vtDir, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromProj, bFromVsTo, nRefType) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
@@ -1059,7 +1065,7 @@ LuaProjectCurveOnSurfDir( lua_State* L)
static int
LuaProjectCurveOnSurfExt( lua_State* L)
{
// 4, 5, 6 o 7 parametri : nCurveId, vSurfId, nGuideId, nDestGrpId [, dLinTol [, dMaxSegmLen] [, bDirFromGuide]]
// 4, 5, 6 o 7 parametri : nCurveId, vSurfId, nGuideId, nDestGrpId [, dLinTol [, dMaxSegmLen] [, bDirFromGuide] [,bFromVsTo]]
int nCurveId ;
LuaCheckParam( L, 1, nCurveId)
INTVECTOR vSurfId ;
@@ -1071,12 +1077,14 @@ LuaProjectCurveOnSurfExt( lua_State* L)
double dLinTol = 0.01 ;
double dMaxSegmLen = INFINITO ;
bool bDirFromGuide = false ;
bool bFromVsTo = true ;
if ( LuaGetParam( L, 5, dLinTol) &&
LuaGetParam( L, 6, dMaxSegmLen))
LuaGetParam( L, 7, bDirFromGuide) ;
LuaGetParam( L, 6, dMaxSegmLen) &&
LuaGetParam( L, 7, bDirFromGuide))
LuaGetParam( L, 8, bFromVsTo) ;
LuaClearStack( L) ;
// proietto la curva su una o più superfici secondo la direzione verso la guida
bool bOk = ExeProjectCurveOnSurfExt( nCurveId, vSurfId, nGuideId, nDestGrpId, dLinTol, dMaxSegmLen, bDirFromGuide) ;
// 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) ;
LuaSetParam( L, bOk) ;
return 1 ;
}
+21 -2
View File
@@ -565,7 +565,7 @@ LuaSurfTmGetShowEdges( lua_State* L)
static int
LuaSurfTmSetSmoothAng( lua_State* L)
{
// 2 parametri : nId, nCutterId
// 2 parametri : nId, dAngDeg
int nId ;
LuaCheckParam( L, 1, nId)
double dAngDeg ;
@@ -577,6 +577,24 @@ LuaSurfTmSetSmoothAng( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSurfTmGetSmoothAng( lua_State* L)
{
// 1 parametro : nId
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// recupero lo smooth angle della superficie
double dAngDeg ;
bool bOk = ExeSurfTmGetSmoothAng( nId, dAngDeg) ;
if ( bOk)
LuaSetParam( L, dAngDeg) ;
else
LuaSetParam( L) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSurfTmOffset( lua_State* L)
@@ -664,7 +682,7 @@ LuaSurfBzTrim( lua_State* L)
bool
LuaInstallGdbModifySurf( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bool bOk = true ;
bOk = bOk && luaMgr.RegisterFunction( "EgtInvertSurf", LuaInvertSurf) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtExplodeSurf", LuaExplodeSurf) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtApproxSurf", LuaApproxSurf) ;
@@ -694,6 +712,7 @@ LuaInstallGdbModifySurf( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSetShowEdges", LuaSurfTmSetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetShowEdges", LuaSurfTmGetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmSetSmoothAng", LuaSurfTmSetSmoothAng) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmGetSmoothAng", LuaSurfTmGetSmoothAng) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmOffset", LuaSurfTmOffset) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSurfTmThickeningOffset", LuaSurfTmThickeningOffset) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCutSurfBzPlane", LuaCutSurfBzPlane) ;
+20
View File
@@ -73,6 +73,25 @@ LuaVolZmapSetShowEdges( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaVolZmapGetShowEdges( lua_State* L)
{
// 1 parametro : Id
int nId ;
LuaCheckParam( L, 1, nId)
LuaClearStack( L) ;
// imposto flag visualizzazione spigoli vivi
bool bShow ;
bool bOk = ExeVolZmapGetShowEdges( nId, bShow) ;
// restituisco il risultato
if ( bOk)
LuaSetParam( L, bShow) ;
else
LuaSetParam( L) ;
return 1 ;
}
//----------------------------------------------------------------------------
static int
LuaRemoveVolZmapPart( lua_State* L)
@@ -465,6 +484,7 @@ LuaInstallGdbModifyVol( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtExplodeVolume", LuaExplodeVolume) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapChangeResolution", LuaVolZmapChangeResolution) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetShowEdges", LuaVolZmapSetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapGetShowEdges", LuaVolZmapGetShowEdges) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRemoveVolZmapPart", LuaRemoveVolZmapPart) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetStdTool", LuaVolZmapSetStdTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtVolZmapSetAdvTool", LuaVolZmapSetAdvTool) ;
+12 -12
View File
@@ -3317,11 +3317,11 @@ LuaGetClEntTDir( lua_State* L)
int nEntId ;
LuaGetParam( L, 1, nEntId) ;
LuaClearStack( L) ;
// recupero vTDir
Vector3d vTDir ;
bool bOk = ExeGetClEntTDir( nEntId, vTDir) ;
// recupero TDir
Vector3d vtTDir ;
bool bOk = ExeGetClEntTDir( nEntId, vtTDir) ;
if ( bOk)
LuaSetParam( L, vTDir) ;
LuaSetParam( L, vtTDir) ;
else
LuaSetParam( L) ;
return 1 ;
@@ -3335,11 +3335,11 @@ LuaGetClEntCDir( lua_State* L)
int nEntId ;
LuaGetParam( L, 1, nEntId) ;
LuaClearStack( L) ;
// recupero vCDir
Vector3d vCDir ;
bool bOk = ExeGetClEntCDir( nEntId, vCDir) ;
// recupero CDir
Vector3d vtCDir ;
bool bOk = ExeGetClEntCDir( nEntId, vtCDir) ;
if ( bOk)
LuaSetParam( L, vCDir) ;
LuaSetParam( L, vtCDir) ;
else
LuaSetParam( L) ;
return 1 ;
@@ -3353,11 +3353,11 @@ LuaGetClEntADir( lua_State* L)
int nEntId ;
LuaGetParam( L, 1, nEntId) ;
LuaClearStack( L) ;
// recupero vADir
Vector3d vADir ;
bool bOk = ExeGetClEntADir( nEntId, vADir) ;
// recupero ADir
Vector3d vtADir ;
bool bOk = ExeGetClEntADir( nEntId, vtADir) ;
if ( bOk)
LuaSetParam( L, vADir) ;
LuaSetParam( L, vtADir) ;
else
LuaSetParam( L) ;
return 1 ;
+15 -1
View File
@@ -73,6 +73,19 @@ LuaDraw( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaRedraw( lua_State* L)
{
// nessun parametro
LuaClearStack( L) ;
// forzo ridisegno
bool bOk = ExeRedraw() ;
// restituisco il risultato
LuaSetParam( L, bOk) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaSetShowMode( lua_State* L)
@@ -378,10 +391,11 @@ LuaSetShowSurfBezierTol( lua_State* L)
bool
LuaInstallScene( LuaMgr& luaMgr)
{
bool bOk = ( &luaMgr != nullptr) ;
bool bOk = true ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetBackground", LuaSetBackground) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetBackground", LuaGetBackground) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtDraw", LuaDraw) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtRedraw", LuaRedraw) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowMode", LuaSetShowMode) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowCurveDirection", LuaSetShowCurveDirection) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtSetShowTriaAdv", LuaSetShowTriaAdv) ;
+24
View File
@@ -283,6 +283,28 @@ LuaTrimmingGetSurfBzSyncPoints( lua_State* L)
return 3 ;
}
//-------------------------------------------------------------------------------
static int
LuaRegolarizeSurfaceLocally( lua_State* L)
{
int nParentId = GDB_ID_NULL ;
LuaCheckParam( L, 1, nParentId)
int nSurfId = GDB_ID_NULL ;
LuaCheckParam( L, 2, nSurfId)
int nSyncStartId ;
LuaCheckParam( L, 3, nSyncStartId)
int nSyncEndId ;
LuaCheckParam( L, 4, nSyncEndId)
double dLinTol ;
LuaCheckParam( L, 5, dLinTol)
int nType = 0 ;
LuaCheckParam( L, 6, nType)
int nId = ExeRegolarizeSurfaceLocally( nParentId, nSurfId, nSyncStartId, nSyncEndId, dLinTol, nType) ;
LuaSetParam( L, nId) ;
return 1 ;
}
//-------------------------------------------------------------------------------
bool
LuaInstallTrimming( LuaMgr& luaMgr)
@@ -302,5 +324,7 @@ LuaInstallTrimming( LuaMgr& luaMgr)
// --- Recupero linee di sincronizzazione
bOk = bOk && luaMgr.RegisterFunction( "EgtTrimmingInterpolateSyncLines", LuaTrimmingInterpolateSyncLines) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtTrimmingGetSurfBzSyncPoints", LuaTrimmingGetSurfBzSyncPoints) ;
// --- Modifica della superficie
bOk = bOk && luaMgr.RegisterFunction( "EgtRegolarizeSurfaceLocally", LuaRegolarizeSurfaceLocally) ;
return bOk ;
}