From 31a701a0e3236f2b485179f4cbd8d609b1bcd5d5 Mon Sep 17 00:00:00 2001 From: Riccardo Elitropi Date: Wed, 27 May 2026 17:31:06 +0200 Subject: [PATCH] EgtMachKernel : - in Finitura di superficie rimozione parametro Offset radiale per considerazione sulla curva di bordo. --- SurfFinishing.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/SurfFinishing.cpp b/SurfFinishing.cpp index fe93467..f067259 100644 --- a/SurfFinishing.cpp +++ b/SurfFinishing.cpp @@ -1988,7 +1988,7 @@ SurfFinishing::ProcessSfr( int nPathId, int nPvId, int nClId) } // alla regione di contorno applico un Offset stabilito dal parametro di Overlap - if ( ! pSfrCnt->Offset( m_Params.m_dOverlap + GetOffsR(), ICurve::OFF_FILLET)) { + if ( ! pSfrCnt->Offset( m_Params.m_dOverlap, ICurve::OFF_FILLET)) { m_pMchMgr->SetLastError( 3124, "Error in SurfFinishing : region not computable") ; return false ; } @@ -2016,10 +2016,6 @@ SurfFinishing::ProcessSfr( int nPathId, int nPvId, int nClId) // se non valida, non faccio nulla if ( ! pSfrMaxDown->IsValid()) return true ; - // questa regione deve essere lavorata a SideStep - double dSideStepLowerBound = max( 0.5, m_Params.m_dSideStep) ; // per tolleranza di campionamento - if ( ! pSfrMaxDown->Offset( m_TParams.m_dDiam - dSideStepLowerBound + GetOffsR(), ICurve::OFF_FILLET)) - return false ; // la regione la lavorare รจ l'intersezione tra quest'ultima e il contorno pSfrCnt->Intersect( *pSfrMaxDown) ; } @@ -5990,6 +5986,13 @@ SurfFinishing::CalcOptimalZigZagRegion( const ISurfFlatRegion* pSfrCntLoc, const } // Definisco una Zuppa di Triangoli per le facce entro la tolleranza + #if ENABLE_OPTIMAL_DEBUG + int nGrp = m_pGeomDB->AddGroup( GDB_ID_NULL, GDB_ID_ROOT, GLOB_FRM) ; + m_pGeomDB->SetName( nGrp, "SplitAngleSurf") ; + m_pGeomDB->SetStatus( nGrp, GDB_ST_OFF) ; + int nLay = m_pGeomDB->AddGroup( GDB_ID_NULL, nGrp, GLOB_FRM) ; + m_pGeomDB->SetName( nLay, "SplitAngleSurf") ; + #endif StmFromTriangleSoup StmSoup ; StmSoup.Start() ; for ( const ISurfTriMesh* pStm : vpStm) { @@ -5998,13 +6001,24 @@ SurfFinishing::CalcOptimalZigZagRegion( const ISurfFlatRegion* pSfrCntLoc, const // scorro le faccie della superficie e controllo l'angolo presente for ( int nF = 0 ; nF < pStm->GetFacetCount() ; ++ nF) { Vector3d vtFaceN ; pStm->GetFacetNormal( nF, vtFaceN) ; + #if ENABLE_OPTIMAL_DEBUG + int nId = m_pGeomDB->AddGeoObj( GDB_ID_NULL, nLay, pStm->CloneFacet( nF)) ; + #endif if ( vtFaceN * vtToolLoc > COS_SPLIT_ANG) { + #if ENABLE_OPTIMAL_DEBUG + m_pGeomDB->SetMaterial( nId, LIME) ; + #endif INTVECTOR vnTria ; pStm->GetAllTriaInFacet( nF, vnTria) ; for ( const int& nT : vnTria) { Triangle3d Tria ; pStm->GetTriangle( nT, Tria) ; StmSoup.AddTriangle( Tria) ; } } + else { + #if ENABLE_OPTIMAL_DEBUG + m_pGeomDB->SetMaterial( nId, BLACK) ; + #endif + } } } StmSoup.End() ;