EgtGeomKernel :

- tolte parti di debug.
This commit is contained in:
Daniele Bariletti
2025-10-06 09:43:15 +02:00
parent 42687457e0
commit a87351778d
+1 -70
View File
@@ -27,7 +27,6 @@
#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>
@@ -1355,8 +1354,6 @@ IntersLineBezierSurfSet( const Point3d& ptLineStart, const Vector3d& vtLineDir,
fill( vbAlreadyCalc.begin(), vbAlreadyCalc.end(), false) ;
bool bCalcAll = false ;
INTVECTOR vSurfCalcInt ;
Reiterate :
// interseco con le bezier
@@ -1401,10 +1398,6 @@ 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) {
@@ -1539,10 +1532,6 @@ 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,
@@ -1579,10 +1568,6 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
vector<SurfBezForInters> vSurfBez( nTotSurf) ;
double dSide = 0 ;
//debug
static PerformanceCounter Counter;
//debug
// punti di riferimento sul tool
// tip del tool
Point3d ptP1T ;
@@ -1692,13 +1677,6 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
vvPtCtrl.emplace_back( PNTVECTOR( { vPntTopStartFront.back(), vPntTopStartFront.front(), vPntTopEndFront.back(), vPntTopEndFront.front() })) ;
}
else {
{//debug
Counter.Start() ;
}//debug
// costruisco tutti gli archi subito
// archi inferiori front
CurveArc cArcTipStartF1, cArcTipEndF1, cArcTipStartF2, cArcTipEndF2 ;
@@ -1912,19 +1890,8 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
PNTVECTOR vPntTopEndBack2 = cBezTopEndB2->GetAllControlPoints() ;
vvPtCtrl.back().insert( vvPtCtrl.back().end(), vPntTopEndBack2.rbegin(), vPntTopEndBack2.rend()) ;
}
{//debug
static double dCreationTime = 0;
dCreationTime += Counter.Stop();
string sOut = "bezier_creation = " + ToString( dCreationTime, 3) ;
LOG_INFO( GetEGkLogger(), sOut.c_str())
}//debug
}
//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) ;
@@ -1977,27 +1944,9 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
vSurfBez[nSurfInd].bbSurfOriented.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 ;
@@ -2015,10 +1964,6 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
} ;
vector<IntervalsToSubtract> vIntervalsToSubtr ;
{//debug
Counter.Start();
}//debug
for ( int i = nStartI ; i <= nEndI ; ++ i) {
nLastForwardJ = -1 ;
j = nStartJ ;
@@ -2042,13 +1987,6 @@ 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) {
@@ -2163,13 +2101,6 @@ VolZmap::Comp_5AxisMilling( int nGrid, const Point3d& ptS, const Point3d& ptE, c
}
}
{//debug
static double dCalcTime = 0;
dCalcTime += Counter.Stop();
string sOut = "inters_calc = " + ToString(dCalcTime, 3);
LOG_INFO(GetEGkLogger(), sOut.c_str())
}//debug
return true ;
}
@@ -2429,7 +2360,7 @@ VolZmap::MillingGeneralMotionStep( const Point3d& ptPs, const Vector3d& vtDs, co
InitializePointsAndVectors( ptSti, ptEni, vtDSi, vtDEi, ptLs, ptLe, vtLs, vtLe) ;
// Standard è multithread
constexpr bool MULTITHREAD = false ;
constexpr bool MULTITHREAD = true ;
if ( MULTITHREAD) {
// Ciclo sulle mappe
vector<future<bool>> vRes( m_nMapNum) ;