EgtGeomKernel :
- in ChainCurves::Init si può passare la dimensione della cella - corretta GetSurfTriMeshBox nel caso Regular - chiamate asincrone in VolZmap per taglio spilloni delle tre matrici.
This commit is contained in:
+53
-19
@@ -20,6 +20,8 @@
|
||||
#include "GeoConst.h"
|
||||
#include "/EgtDev/Include/EgtNumUtils.h"
|
||||
#include "/EgtDev/Include/EGkStringUtils3d.h"
|
||||
#include "/EgtDev/Include/EgtPerfCounter.h"
|
||||
#include <future>
|
||||
|
||||
using namespace std ;
|
||||
|
||||
@@ -527,11 +529,27 @@ VolZmap::MillingStep( const Point3d& ptPs, const Vector3d& vtDs, const Vector3d&
|
||||
vtALe.ToLoc( m_MapFrame) ;
|
||||
vtALe.Normalize() ;
|
||||
|
||||
//static PerformanceCounter Counter ;
|
||||
//{
|
||||
//string sOut = "Draw=" + ToString( Counter.Stop(), 3) ;
|
||||
//LOG_INFO( GetEGkLogger(), sOut.c_str())
|
||||
//Counter.Start() ;
|
||||
//}
|
||||
|
||||
// Se pura traslazione
|
||||
bool bOk ;
|
||||
if ( AreSameVectorApprox( vtDLs, vtDLe))
|
||||
return MillingTranslationStep( ptPLs, ptPLe, vtDLs, vtALs) ;
|
||||
bOk = MillingTranslationStep( ptPLs, ptPLe, vtDLs, vtALs) ;
|
||||
else
|
||||
return MillingGeneralMotionStep( ptPLs, vtDLs, vtALs, ptPLe, vtDLe, vtALe) ;
|
||||
bOk = MillingGeneralMotionStep( ptPLs, vtDLs, vtALs, ptPLe, vtDLe, vtALe) ;
|
||||
|
||||
//{
|
||||
//string sOut = "Calc=" + ToString( Counter.Stop(), 3) ;
|
||||
//LOG_INFO( GetEGkLogger(), sOut.c_str())
|
||||
//Counter.Start() ;
|
||||
//}
|
||||
|
||||
return bOk ;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
@@ -569,14 +587,26 @@ VolZmap::MillingGeneralMotionStep( const Point3d& ptPs, const Vector3d& vtDs, co
|
||||
bool
|
||||
VolZmap::MillingTranslationStep( const Point3d& ptPs, const Point3d& ptPe, const Vector3d& vtD, const Vector3d& vtA)
|
||||
{
|
||||
Point3d ptLs[3] ;
|
||||
Point3d ptLe[3] ;
|
||||
Vector3d vtLs[3] ;
|
||||
Vector3d vtALs[3] ;
|
||||
Point3d ptLs[N_MAPS] ;
|
||||
Point3d ptLe[N_MAPS] ;
|
||||
Vector3d vtLs[N_MAPS] ;
|
||||
Vector3d vtALs[N_MAPS] ;
|
||||
InitializePointsAndVectors( ptPs, ptPe, vtD, vtA, ptLs, ptLe, vtLs, vtALs) ;
|
||||
// Ciclo sulle mappe
|
||||
vector< future<bool>> vRes ;
|
||||
vRes.resize( m_nMapNum) ;
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
SelectMotion( i, ptLs[i], ptLe[i], vtLs[i], vtALs[i]) ;
|
||||
vRes[i] = async( launch::async, &VolZmap::SelectMotion, this, i, ptLs[i], ptLe[i], vtLs[i], vtALs[i]) ;
|
||||
}
|
||||
bool bOk = true ;
|
||||
int nTerminated = 0 ;
|
||||
while ( nTerminated < m_nMapNum) {
|
||||
for ( int i = 0 ; i < m_nMapNum ; ++ i) {
|
||||
if ( vRes[i].valid() && vRes[i].wait_for(chrono::microseconds{ 1}) == future_status::ready) {
|
||||
bOk = vRes[i].get() && bOk ;
|
||||
++ nTerminated ;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true ;
|
||||
}
|
||||
@@ -1684,7 +1714,8 @@ VolZmap::GenTool_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
|
||||
frNormFrame.Set( ORIG, X_AX, - Z_AX, Y_AX) ;
|
||||
// Ciclo sulle curve
|
||||
const CurveComposite& ToolProfile = m_Tool.GetApproxOutline() ;
|
||||
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
|
||||
int i = - 1 ;
|
||||
const ICurve* pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
double dHeight = 0 ;
|
||||
@@ -1751,7 +1782,7 @@ VolZmap::GenTool_ZDrilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
|
||||
ptF = ptI + vtMove ;
|
||||
|
||||
// Passo alla curva successiva del profilo
|
||||
pCurve = ToolProfile.GetNextCurve() ;
|
||||
pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
@@ -1773,7 +1804,8 @@ VolZmap::GenTool_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
|
||||
frNormFrame.Set( ORIG, X_AX, -Z_AX, Y_AX) ;
|
||||
// Ciclo sulle curve del profilo utensile
|
||||
const CurveComposite& ToolProfile = m_Tool.GetApproxOutline() ;
|
||||
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
|
||||
int i = - 1 ;
|
||||
const ICurve* pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
double dHeight = 0 ;
|
||||
@@ -1840,7 +1872,7 @@ VolZmap::GenTool_ZMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
|
||||
ptF = ptI + vtMove ;
|
||||
|
||||
// Passo alla curva successiva del profilo
|
||||
pCurve = ToolProfile.GetNextCurve() ;
|
||||
pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
}
|
||||
|
||||
return true ;
|
||||
@@ -2897,8 +2929,9 @@ VolZmap::GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
|
||||
frNormFrame.Set( ORIG, X_AX, -Z_AX, Y_AX) ;
|
||||
// Ciclo sulle curve del profilo
|
||||
const CurveComposite& ToolProfile = m_Tool.GetApproxOutline() ;
|
||||
int i = - 1 ;
|
||||
const ICurve* pPrevCurve = nullptr ;
|
||||
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
|
||||
const ICurve* pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
double dHeight = 0 ;
|
||||
@@ -2931,7 +2964,7 @@ VolZmap::GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
|
||||
}
|
||||
// Verifiche curva successiva per eventuale tappo sotto
|
||||
bool bTapB = false ;
|
||||
const ICurve* pNextCurve = ToolProfile.GetNextCurve() ;
|
||||
const ICurve* pNextCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
if ( pNextCurve != nullptr && pNextCurve->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pOthLine = GetCurveLine( pNextCurve) ;
|
||||
Point3d ptOthStart = pOthLine->GetStart() ;
|
||||
@@ -2966,7 +2999,7 @@ VolZmap::GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
|
||||
else {
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = ToolProfile.GetNextCurve() ;
|
||||
pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2987,7 +3020,7 @@ VolZmap::GenTool_Drilling( int nGrid, const Point3d& ptS, const Point3d& ptE, co
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = ToolProfile.GetNextCurve() ;
|
||||
pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
}
|
||||
|
||||
// Determino le posizioni iniziale e finale del componente successivo
|
||||
@@ -3014,8 +3047,9 @@ VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, con
|
||||
frNormFrame.Set( ORIG, X_AX, -Z_AX, Y_AX) ;
|
||||
// Ciclo sulle curve del profilo
|
||||
const CurveComposite& ToolProfile = m_Tool.GetApproxOutline() ;
|
||||
int i = - 1 ;
|
||||
const ICurve* pPrevCurve = nullptr ;
|
||||
const ICurve* pCurve = ToolProfile.GetFirstCurve() ;
|
||||
const ICurve* pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
while ( pCurve != nullptr) {
|
||||
|
||||
double dHeight = 0 ;
|
||||
@@ -3048,7 +3082,7 @@ VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, con
|
||||
}
|
||||
// verifiche curva successiva per eventuale tappo sotto
|
||||
bool bTapB = false ;
|
||||
const ICurve* pNextCurve = ToolProfile.GetNextCurve() ;
|
||||
const ICurve* pNextCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
if ( pNextCurve != nullptr && pNextCurve->GetType() == CRV_LINE) {
|
||||
const ICurveLine* pOthLine = GetCurveLine( pNextCurve) ;
|
||||
Point3d ptOthStart = pOthLine->GetStart() ;
|
||||
@@ -3083,7 +3117,7 @@ VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, con
|
||||
else {
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = ToolProfile.GetNextCurve() ;
|
||||
pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3104,7 +3138,7 @@ VolZmap::GenTool_Milling( int nGrid, const Point3d& ptS, const Point3d& ptE, con
|
||||
dHeight = abs( ptStart.y - ptEnd.y) ;
|
||||
// Passo alla curva successiva
|
||||
pPrevCurve = pCurve ;
|
||||
pCurve = ToolProfile.GetNextCurve() ;
|
||||
pCurve = ToolProfile.GetCurve( ++ i) ;
|
||||
}
|
||||
|
||||
// Determino le posizioni iniziale e finale del componente successivo
|
||||
|
||||
Reference in New Issue
Block a user