From f4c97979f0830f824d212b0a6c19da8d51bae2fe Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Tue, 11 Aug 2026 10:30:46 +0200 Subject: [PATCH] EgtMachKernel 3.1h1 : - modifiche a lavorazione con lama di superficie nel caso Along5a. --- EgtMachKernel.rc | Bin 11774 -> 11774 bytes SawFinishing.cpp | 42 ++++++++++++++++-------------------------- WaterJetting.cpp | 2 +- 3 files changed, 17 insertions(+), 27 deletions(-) diff --git a/EgtMachKernel.rc b/EgtMachKernel.rc index d42cb55944df9e95e8363ec82bfdbab552ec64e2..f1fdc520f47c14e53f021f7127269cac6c5f0ffa 100644 GIT binary patch delta 284 zcmewt{V#gMI%aKGhCGIJh8%`WhGK>c1_cHUhESkLCPN8BDnkm89}HwAf_cT0IklxX ze_&=}X0>3@VKChMUhX2(GetNext( nSectId) ; } - // elimino eventuali sottosquadra + // elimino eventuali sottosquadra ICRVCOMPOPOVECTOR vpNucCrvs ; vpNucCrvs.reserve( vpSects.size()) ; for ( const auto& pSect : vpSects) { PtrOwner pCrvCompo( CreateCurveComposite()) ; @@ -2641,22 +2641,17 @@ SawFinishing::Split5ASection( int nSectGrpId, SECTIONVECTOR& vSections) const if ( ptEnd.x > ptStart.x) vpNucCrvs[i]->Invert() ; - // approssimo per la presenza di archi e classifico i tratti - PolyLine PL ; - vpNucCrvs[i]->ApproxWithLines( LIN_TOL_MID, ANG_TOL_STD_DEG, ICurve::APL_SPECIAL, PL) ; - vpNucCrvs[i]->Clear() ; - vpNucCrvs[i]->FromPolyLine( PL) ; + // classifico i tratti INTVECTOR vnClass ; if ( ! ClassifySection( vpNucCrvs[i], vnClass)) return false ; - // vettore delle parti di sezione validi senza tratti verticiali (e sottosquadra) - ICRVCOMPOPOVECTOR vpNucCrvsNoVert ; vpNucCrvsNoVert.reserve( vnClass.size()) ; + // vettore delle parti di sezione validi senza tratti verticali (e sottosquadra) PtrOwner pCompoTmp( nullptr) ; for ( int j = 0 ; j < ssize( vnClass) ; ++ j) { if ( vnClass[j] == CCL_VERT) { if ( ! IsNull( pCompoTmp) && pCompoTmp->IsValid()) - vpNucCrvsNoVert.emplace_back( ::Release( pCompoTmp)) ; + vSimpleSections.emplace_back( ::Release( pCompoTmp)) ; } else { if ( IsNull( pCompoTmp)) @@ -2667,11 +2662,8 @@ SawFinishing::Split5ASection( int nSectGrpId, SECTIONVECTOR& vSections) const pCompoTmp->AddCurve( pCrv->Clone()) ; } } - erase_if( vpNucCrvsNoVert, []( const PtrOwner& pCompo) { return ( pCompo == nullptr || ! pCompo->IsValid()) ; }) ; - for ( int j = 0 ; j < ssize( vpNucCrvsNoVert) ; ++ j) { - if ( ! vSimpleSections.emplace_back( ::Release( vpNucCrvsNoVert[j]))) - return false ; - } + if ( ! IsNull( pCompoTmp)) + vSimpleSections.emplace_back( ::Release( pCompoTmp)) ; } // dalle sezioni semplici recuperate eseguo l'Offset Radiale complessivo ( evito così interferenze con sezioni differenti) @@ -2688,9 +2680,6 @@ SawFinishing::Split5ASection( int nSectGrpId, SECTIONVECTOR& vSections) const return false ; } } - erase_if( vSections, []( const SectionInfo& SectionInfo) { - return ( SectionInfo.pSection == nullptr || ! SectionInfo.pSection->IsValid()) ; - }) ; // calcolo ordinamento delle curve secondo la X decrescente typedef pair INDASC ; // coppia indice, ascissa @@ -3208,7 +3197,7 @@ SawFinishing::CalcAlongVerticalCuts( ICurve* pSect, int nUmin, int nUmax, const } dElev = max( dElev, dElev2) ; if ( dElev < EPS_SMALL) - dElev = max( max( dRawMaxZ - ptStart.z, dRawMaxZ - ptEnd.z), 0.) ; + dElev = max( { dRawMaxZ - ptStart.z, dRawMaxZ - ptEnd.z, 0.}) ; // la confronto con il massimo affondamento e con la massima lavorazione della lama double dMaxDepth = min( dDepth, m_TParams.m_dMaxMat) ; if ( dElev > dMaxDepth) { @@ -3352,7 +3341,7 @@ SawFinishing::CalcAlongStdCuts( ICurve* pSect, double dUmin, double dUmax, } dElev = max( dElev, dElev2) ; if ( dElev < EPS_SMALL) - dElev = max( max( dRawMaxZ - ptStart.z, dRawMaxZ - ptEnd.z), 0.) ; + dElev = max( { dRawMaxZ - ptStart.z, dRawMaxZ - ptEnd.z, 0.}) ; // la confronto con il massimo affondamento e con la massima lavorazione della lama double dMaxDepth = min( dDepth, m_TParams.m_dMaxMat) ; if ( dElev > dMaxDepth) { @@ -3483,12 +3472,10 @@ SawFinishing::CalcAlong5ACuts( const SECTIONVECTOR& vSections, const Frame3d& fr double dLen ; if ( ! pSubSect->GetLength( dLen)) return false ; - double dL = dLen ; - if ( dL < 10. * EPS_SMALL) + if ( dLen < 10. * EPS_SMALL) return true ; - int nStep = static_cast( ceil( dL / dStep)) ; - dStep = dL / nStep ; - nStep ++ ; + int nStep = static_cast( ceil( dLen / dStep)) ; + dStep = dLen / nStep ; // Ciclo sulle passate double dLastElev ; @@ -3528,7 +3515,10 @@ SawFinishing::CalcAlong5ACuts( const SECTIONVECTOR& vSections, const Frame3d& fr vtTool = vtToolTmp ; } - // verifico posizionando la lama nel punto corrente se devo sposarmi per evitare collisione con la sezione + // punto di passata è sulla metà della sezione lama + ptP += - 0.5 * m_TParams.m_dThick * GetToLoc( vtTool, frSect) ; + + // verifico posizionando la lama nel punto corrente se devo spostarmi per evitare collisione con la sezione double dSectElev = 0. ; bool bOtherColl = false ; if ( ! CalcCAvSect5Ax( pSubSect, vSections, GetToLoc( vtTool, frSect), GetToLoc( vtCorr, frSect), ptP, dSectElev, bOtherColl)) { @@ -3562,7 +3552,7 @@ SawFinishing::CalcAlong5ACuts( const SECTIONVECTOR& vSections, const Frame3d& fr } dElev = max( dElev, dElev2) ; if ( dElev < EPS_SMALL) - dElev = max( max( dRawMaxZ - ptStart.z, dRawMaxZ - ptEnd.z), 0.) ; + dElev = max( { dRawMaxZ - ptStart.z, dRawMaxZ - ptEnd.z, 0.}) ; // la confronto con il massimo affondamento e con la massima lavorazione della lama. Se sotto alla massima Depth allora riporto // l'utensile in verticale e ricalcolo il punto più adatto in z per il tratto lineare double dMaxDepth = min( dDepth, m_TParams.m_dMaxMat) ; diff --git a/WaterJetting.cpp b/WaterJetting.cpp index 747d2fe..5b7aff9 100644 --- a/WaterJetting.cpp +++ b/WaterJetting.cpp @@ -2925,7 +2925,7 @@ double WaterJetting::GetRadiusForStartEndElevation( void) const { const double DELTA_ELEV_RAD = 20.0 ; - double dDeltaRad = DELTA_ELEV_RAD + max( max( m_Params.m_dStartAddLen, m_Params.m_dEndAddLen), 0.0) ; + double dDeltaRad = DELTA_ELEV_RAD + max( { m_Params.m_dStartAddLen, m_Params.m_dEndAddLen, 0.0}) ; return ( 0.5 * m_TParams.m_dTDiam + dDeltaRad) ; }