Merge commit '8af2794f87927e4ca715f795beb877ccea72311b' into Sgrossature

This commit is contained in:
Riccardo Elitropi
2024-07-08 10:21:17 +02:00
+14 -15
View File
@@ -86,7 +86,7 @@ using namespace std ;
static string KEY_SURF_POCK = "SurfPock_" ;
static string KEY_SURF_LIMIT = "SurfLimit_" ;
static const bool ENABLE_DEBUG = false ;
#define ENABLE_DEBUG 1
static string _DEBUG_GROUP_TERRACE = "Terraces" ;
static string _DEBUG_GROUP_FEED = "Feeds" ;
@@ -292,7 +292,7 @@ SurfRoughing::SurfRoughing( void)
m_nStatus = MCH_ST_TO_VERIFY ;
m_nPaths = 0 ;
m_dMaxHelixRad = INFINITO ;
m_dSubStepToler = 2000 * EPS_SMALL ;
m_dSubStepToler = 2.0 / 2 ;
}
//----------------------------------------------------------------------------
@@ -1472,6 +1472,10 @@ SurfRoughing::ProcessPath( int nPathId, int nTempId, int nPvId, int nClId)
// se regione risultante non vuota
if ( pSfr->IsValid() && pSfr->GetChunkCount() > 0) {
#if ENABLE_DEBUG
DrawLoopsSurf( pSfr, true, Color( 1., 1., 1., .1), it->bSubStep, it->nInd) ;
#endif
// se si tratta di un SottoStep, rimuovo tutti i chunk troppo snelli
if ( it->bSubStep) {
if ( ! RemoveChunksUnderTolerance( pSfr)) {
@@ -1763,10 +1767,6 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co
if ( ! bIsSubStep)
++ nBasicStep ;
if ( ENABLE_DEBUG) {
DrawLoopsSurf( pSfrPock, true, Color( 1., 1., 1., .1), bIsSubStep, nCurrStep) ;
}
ICRVCOMPOPOVECTOR vpCrvs ; // percorso di svuotatura
// se si tratta di uno step base, allora lavoro l'intera superficie
if ( ! CalcPocketing( pSfrPock, m_TParams.m_dDiam / 2, 0., m_Params.m_dSideStep, m_Params.m_dSideAngle,
@@ -1789,9 +1789,9 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co
// ciclo sui percorsi
for ( int k = 0 ; k < int( vpCrvs.size()) ; ++ k) {
if ( ENABLE_DEBUG) {
#if ENABLE_DEBUG
DrawFeed( vpCrvs[k], nCurrStep) ;
}
#endif
// controllo se il percorso ha un ingresso presso un lato aperto
bool bOutStart = ( vpCrvs[k]->GetCurveCount() > 0 && vpCrvs[k]->GetCurve( 0)->GetTempProp( 0) == 2) ;
@@ -1853,17 +1853,16 @@ SurfRoughing::AddPocket( const INTINTVECTOR& vPocket, const Vector3d& vtTool, co
}
// altrimenti, approccio di collegamento
else {
// cambio posizione punto per fare elica o similari solo sulla parte con materiale
if ( ( GetLeadInType() == POCKET_LI_ZIGZAG ||
GetLeadInType() == POCKET_LI_HELIX ||
GetLeadInType() == POCKET_LI_GLIDE) && ! bIsSubStep) {
ptP1 -= ( nBasicStep * dStep) * vtTool ;
}
if ( ! AddLinkApproach( ptP1, vtTool, dSafeZ, dStElev, dAppr)) {
m_pMchMgr->SetLastError( 3012, "Error in SurfRoughing : Link not computable") ;
return false ;
}
if ( ! bIsSubStep) {
ptP1 -= ( nBasicStep * dStep) * vtTool ;
SetFeed( GetTipFeed()) ;
SetFlag( 0) ;
if ( AddLinearMove( ptP1) == GDB_ID_NULL)
return false ;
}
}
// aggiungo attacco
SetFeed( GetStartFeed()) ;