diff --git a/PocketingNT.cpp b/PocketingNT.cpp index d35a6d3..6e9b304 100644 --- a/PocketingNT.cpp +++ b/PocketingNT.cpp @@ -118,7 +118,8 @@ const string UN_MAXOPTSIZE = "MaxOptSize" ; #define DEBUG_GLIDE 0 // Debug percorsi a Scivolo ( LeadIn/LeadOut) #define DEBUG_MAXDEPTH 0 // Debug per controllo di MaxDepth #define DEBUG_SAFETY_LINK 0 // Debug raccordi tra percorsi di lavorazioni differenti -#if DEBUG_OPEN_EDGE_EXTENSION || DEBUG_OPEN_EDGE_IN_RAW || DEBUG_SFR_STEPS || DEBUG_SFR_RAW || DEBUG_GLIDE || DEBUG_SAFETY_LINK +#define DEBUG_FEED 0 // Debug per Feed +#if DEBUG_OPEN_EDGE_EXTENSION || DEBUG_OPEN_EDGE_IN_RAW || DEBUG_SFR_STEPS || DEBUG_SFR_RAW || DEBUG_GLIDE || DEBUG_SAFETY_LINK || DEBUG_FEED #include "EgtDev/Include/EGkGeoPoint3d.h" #include "EgtDev/Include/EGkFrame3d.h" #endif @@ -3425,6 +3426,10 @@ PocketingNT::CalcPaths( STEPINFOPOVECTOR& vStepInfo) // se non ho ottenuto percorsi, allora passo allo step successivo ( nInd non viene aggiornato!) if ( vCrvPaths.empty()) continue ; + #if DEBUG_FEED + for ( const auto& pCrvCompo : vCrvPaths) + DebugDrawFeed( pCrvCompo) ; + #endif // sistemo gli archi per massimo angolo al centro for ( int j = 0 ; j < int( vCrvPaths.size()) ; ++ j) VerifyArcs( vCrvPaths[j]) ; @@ -5099,4 +5104,28 @@ PocketingNT::DebugDrawOpenEdgesInRaw( const ICRVCOMPOPOVECTOR& vpCrvs, int nlaye int _a = m_pGeomDB->AddGeoObj( GDB_ID_NULL, nlayer, vpCrvs[i]->Clone()) ; m_pGeomDB->SetMaterial( _a, myColor) ; } +} + +//---------------------------------------------------------------------------- +void +PocketingNT::DebugDrawFeed( const ICurveComposite* pCrvCompo) +{ + if ( pCrvCompo == nullptr) + return ; + + int nGrp = m_pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, GLOB_FRM) ; + int nLay = m_pGeomDB->AddGroup( GDB_ID_NULL, nGrp, GLOB_FRM) ; + m_pGeomDB->SetName( nGrp, "Feed") ; + + for ( int nU = 0 ; nU < pCrvCompo->GetCurveCount() ; ++ nU) { + const ICurve* pCrv = pCrvCompo->GetCurve( nU) ; + if ( pCrv == nullptr || ! pCrv->IsValid()) + continue ; + double dMinFeed = GetFeed() * GetSideStep() / m_TParams.m_dDiam ; + double myAngle = 120 * ( ( ( ( pCrv->GetTempParam( 0)) - dMinFeed) / ( GetFeed() - dMinFeed))) ; + int nInd = m_pGeomDB->AddGeoObj( GDB_ID_NULL, nLay, pCrv->Clone()) ; + m_pGeomDB->SetMaterial( nInd, GetColorFromHSV( HSV( myAngle, 1., 1.))) ; + } + + return ; } \ No newline at end of file diff --git a/PocketingNT.h b/PocketingNT.h index 8df55a9..d85c4da 100644 --- a/PocketingNT.h +++ b/PocketingNT.h @@ -167,6 +167,7 @@ class PocketingNT : public Machining void DebugDrawLoop( const ICurveComposite* pCrvCompo, int nLayer, bool bUniform) ; void DebugDrawBox( const BBox3d& BBox, const Frame3d& FrBox, int nlayer) ; void DebugDrawOpenEdgesInRaw( const ICRVCOMPOPOVECTOR& vpCrvsm, int nlayer) ; + void DebugDrawFeed( const ICurveComposite* pCrvPath) ; private : double GetSpeed( void) const