EgtMachKernel 3.1h1 :

- modifiche a lavorazione con lama di superficie nel caso Along5a.
This commit is contained in:
Dario Sassi
2026-08-11 10:30:46 +02:00
parent e58792d4ff
commit f4c97979f0
3 changed files with 17 additions and 27 deletions
BIN
View File
Binary file not shown.
+16 -26
View File
@@ -2617,7 +2617,7 @@ SawFinishing::Split5ASection( int nSectGrpId, SECTIONVECTOR& vSections) const
nSectId = m_pGeomDB->GetNext( nSectId) ;
}
// elimino eventuali sottosquadra
// elimino eventuali sottosquadra
ICRVCOMPOPOVECTOR vpNucCrvs ; vpNucCrvs.reserve( vpSects.size()) ;
for ( const auto& pSect : vpSects) {
PtrOwner<ICurveComposite> 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<ICurveComposite> 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<ICurveComposite>& 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<int,double> 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<int>( ceil( dL / dStep)) ;
dStep = dL / nStep ;
nStep ++ ;
int nStep = static_cast<int>( 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) ;
+1 -1
View File
@@ -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) ;
}