EgtGeomKernel :

- aggiunto codice per debug.
This commit is contained in:
Daniele Bariletti
2025-09-29 16:00:34 +02:00
parent ab538f4bf7
commit dfc3c29439
+49 -2
View File
@@ -22,10 +22,11 @@
#include "/EgtDev/Include/EGkIntervals.h"
#include "/EgtDev/Include/EGkStringUtils3d.h"
#include "/EgtDev/Include/EgtNumUtils.h"
//#include "/EgtDev/Include/EgtPerfCounter.h"
#include "/EgtDev/Include/EgtPerfCounter.h"
#include "/EgtDev/Include/EGkSurfBezier.h"
#include "/EgtDev/Include/ENkPolynomialRoots.h"
#include "/EgtDev/Include/EGkIntersLineBox.h"
#include "/EgtDev/Include/EGkGeoObjSave.h"
#include "SurfBezier.h"
#include <future>
#include <numeric>
@@ -1357,6 +1358,8 @@ IntersLineBezierSurfSet( const Point3d& ptLineStart, const Vector3d& vtLineDir,
fill( vbAlreadyCalc.begin(), vbAlreadyCalc.end(), false) ;
bool bCalcAll = false ;
INTVECTOR vSurfCalcInt ;
Reiterate :
// interseco con le bezier
@@ -1414,6 +1417,11 @@ Reiterate :
// verifico che lo spillone faccia interferenza con il box della superficie
if ( bCalcInters) {
//debug
vSurfCalcInt.push_back( s) ;
//debug
// se la linea è parallela all'asse X o Y allora ruoto tutto di 45 gradi rispetto a Z
Vector3d a3, a2, a1, a0, b3, b2, b1, b0 ;
if ( ! bNeedToRot) {
@@ -1548,11 +1556,20 @@ Reiterate :
return true ;
}
#if true
#define TEST
#endif
//----------------------------------------------------------------------------
bool
VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, const Vector3d& vtLs, const Vector3d& vtLe,
double dHeight, double dMaxRad, double dMinRad, int nToolNum, int n5AxisType)
{
static int nStepWithCalc = 0;
static int nStepCounter = 0;
static bool bStepAlreadyCounted = false;
// tolgo il volume spazzato dal tool durante il movimento
// Verifica sull'interferenza con lo Zmap
int nStartI, nStartJ, nEndI, nEndJ ;
@@ -1944,6 +1961,10 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
}
}
//debug
vector<IGeoObj*> vGeo;
//debug
// inizializzo le superfici bilineari e i parametri per le intersezioni
for ( int z = 0 ; z < int( vvPtCtrl.size()) ; ++z) {
vSurfBez[nSurfInd].sBez.Init( nDegU, nDegV, nSpanU, nSpanV, bRat) ;
@@ -2010,9 +2031,27 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
vSurfBez[nSurfInd].bbSurfY.Add( vPtCtrlLoc) ;
}
#ifdef TEST
if (nGrid == 0)
vGeo.push_back(vSurfBez[nSurfInd].sBez.Clone()) ;
#endif
++ nSurfInd ;
}
#ifdef TEST
if (nGrid == 0) {
bStepAlreadyCounted = false;
++nStepCounter;
}
if (false) {
vector<Color> vCol( nTotSurf) ;
fill( vCol.begin(), vCol.end(), Color( 255,128,0)) ;
SaveGeoObj( vGeo, vCol, "D:/Temp/VirtualMilling/5axisAdvanced/finalApprox.nge") ;
}
#endif
// scorro tutti gli spilloni interessati
int j = 0 ;
int nLastForwardJ = -1 ;
@@ -2052,6 +2091,14 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
if ( vDexel.size() != 0) {
IntersLineBezierSurfSet( r, q, vSurfBez, vInters, vSurfInters, vtLs, vInterv) ;
//debug
if (vInters.size() > 1 && !bStepAlreadyCounted) {
bStepAlreadyCounted = true;
++nStepWithCalc;
}
//debug
if ( vInters.size() > 2) {
SortGroupInters( vInters, vStartEnds, Z_AX) ;
if ( bForward && vStartEnds.size() > 1) {
@@ -2425,7 +2472,7 @@ VolZmap::MillingGeneralMotionStep( const Point3d& ptPs, const Vector3d& vtDs, co
InitializePointsAndVectors( ptSti, ptEni, vtDSi, vtDEi, ptLs, ptLe, vtLs, vtLe) ;
// Standard è multithread
constexpr bool MULTITHREAD = true ;
constexpr bool MULTITHREAD = false ;
if ( MULTITHREAD) {
// Ciclo sulle mappe
vector<future<bool>> vRes( m_nMapNum) ;