EgtExecutor 2.5l5 :

- aggiunta funzione Exe e Lua CAvToolPosBox
- agli import aggiunto log.
This commit is contained in:
Dario Sassi
2024-01-02 15:58:34 +01:00
parent 80a9b3a7bb
commit 1a961a19af
4 changed files with 95 additions and 0 deletions
+23
View File
@@ -22,6 +22,7 @@
#include "/EgtDev/Include/EXeConst.h"
#include "/EgtDev/Include/EGkCurve.h"
#include "/EgtDev/Include/EGkCurveComposite.h"
#include "/EgtDev/Include/EGkStmStandard.h"
#include "/EgtDev/Include/EGkCAvToolSurfTm.h"
#include "/EgtDev/Include/EgtNumUtils.h"
#include "/EgtDev/Include/EgtPointerOwner.h"
@@ -98,6 +99,28 @@ ExeCAvGetToolOutline( int nDestGrpId, bool bApprox)
return nId ;
}
//----------------------------------------------------------------------------
double
ExeCAvToolPosBox( const Point3d& ptP, const Vector3d& vtAx, const BBox3d& b3Box, const Vector3d& vtMove)
{
IGeomDB* pGeomDB = GetCurrGeomDB() ;
VERIFY_GEOMDB( pGeomDB, false)
// creo la superficie TriMesh
PtrOwner<ISurfTriMesh> pStm( GetSurfTriMeshBox( b3Box.GetDimX(), b3Box.GetDimY(), b3Box.GetDimZ())) ;
if ( IsNull( pStm))
return -1 ;
pStm->Translate( b3Box.GetMin() - ORIG) ;
// verifico oggetto per evitare collisioni
if ( IsNull( s_pCAvTlStm))
return -1 ;
// imposto dati
s_pCAvTlStm->SetSurfTm( *pStm) ;
double dMove ;
if ( ! s_pCAvTlStm->TestPosition( ptP, vtAx, vtMove, dMove))
return -1 ;
return dMove ;
}
//----------------------------------------------------------------------------
double
ExeCAvToolPosStm( const Point3d& ptP, const Vector3d& vtAx, int nSurfTmId, const Vector3d& vtMove, int nRefType)
+50
View File
@@ -152,6 +152,11 @@ ExeImportBtl( const string& sFilePath, int nFlag)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImpBtl)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -180,6 +185,11 @@ ExeImportBtlx( const string& sFilePath, int nFlag)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImpBtlx)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -210,6 +220,11 @@ ExeImportCnc( const string& sFilePath, int nFlag)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImpCnc)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -237,6 +252,11 @@ ExeImportCsf( const string& sFilePath)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImpCsf)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -267,6 +287,11 @@ ExeImportDxf( const string& sFilePath, double dScaleFactor)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImpDxf)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -297,6 +322,11 @@ ExeImportPnt( const string& sFilePath, int nFlag)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImpPnt)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -328,6 +358,11 @@ ExeImportStl( const string& sFilePath, double dScaleFactor)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImpStl)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -358,6 +393,11 @@ ExeImport3MF( const string& sFilePath)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImp3MF)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -396,6 +436,11 @@ ExeImport3dm( const string& sFilePath)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
if ( ! IsNull( pImp3dm)) {
string sLog = "Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
@@ -503,6 +548,11 @@ ExeAdvancedImport( const string& sFilePath, double dToler)
" -- Ok=" + ToString( bOk) ;
LOG_INFO( GetCmdLogger(), sLua.c_str()) ;
}
// scrivo il log
{
string sLog = "Advanced Import File " + sFilePath ;
LOG_INFO( GetLogger(), sLog.c_str()) ;
}
// restituisco il risultato
return bOk ;
}
BIN
View File
Binary file not shown.
+22
View File
@@ -118,6 +118,27 @@ LuaCAvGetToolOutline( lua_State* L)
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCAvToolPosBox( lua_State* L)
{
// 4 parametri : ptP, vtAx, b3Box, vtMove
Point3d ptP ;
LuaCheckParam( L, 1, ptP)
Vector3d vtAx ;
LuaCheckParam( L, 2, vtAx)
BBox3d b3Box ;
LuaCheckParam( L, 3, b3Box)
Vector3d vtMove ;
LuaCheckParam( L, 4, vtMove)
LuaClearStack( L) ;
// determino il movimento da dare all'utensile per evitare la collisione con il parallelepipedo
double dMove = ExeCAvToolPosBox( ptP, vtAx, b3Box, vtMove) ;
// restituisco il risultato
LuaSetParam( L, dMove) ;
return 1 ;
}
//-------------------------------------------------------------------------------
static int
LuaCAvToolPosStm( lua_State* L)
@@ -176,6 +197,7 @@ LuaInstallCAvTool( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvSetSawTool", LuaCAvSetSawTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvSetGenTool", LuaCAvSetGenTool) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvGetToolOutline", LuaCAvGetToolOutline) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvToolPosBox", LuaCAvToolPosBox) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvToolPosStm", LuaCAvToolPosStm) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtCAvToolPathStm", LuaCAvToolPathStm) ;
return bOk ;