EgtMachKernel :

- In Sgrossature, aggiunto controllo per piccoli Chunks.
This commit is contained in:
Riccardo Elitropi
2024-12-30 18:03:14 +01:00
parent 0a56d76535
commit e7c2d10111
2 changed files with 10 additions and 6 deletions
+8 -5
View File
@@ -254,6 +254,7 @@ SurfRoughing::SurfRoughing( void)
m_nPaths = 0 ;
m_dMaxHelixRad = INFINITO ;
m_dSubStepToler = 2.0 / 2 ;
m_dStepToler = 1.0 / 1 ;
m_bDetectPlaneZ = false ;
}
@@ -1599,7 +1600,7 @@ SurfRoughing::ProcessPath( int nPathId, int nPvId, int nClId)
if ( pSfr->IsValid() && pSfr->GetChunkCount() > 0) {
// se si tratta di un SottoStep, rimuovo tutti i chunk troppo snelli
if ( it->bSubStep) {
if ( ! RemoveChunksUnderTolerance( pSfr, it->pSfrRemoved)) {
if ( ! RemoveChunksUnderTolerance( pSfr, m_dSubStepToler, it->pSfrRemoved)) {
m_pMchMgr->SetLastError( 3029, "Error in SurfRoughing : Simplify Chunks for SubSteps failed") ;
return false ;
}
@@ -2876,7 +2877,7 @@ SurfRoughing::SimplyfySfr( ISurfFlatRegion* pSfr) const
//----------------------------------------------------------------------------
bool
SurfRoughing::RemoveChunksUnderTolerance( ISurfFlatRegion* pSfr, ISurfFlatRegion* pSfrToUpdate) const
SurfRoughing::RemoveChunksUnderTolerance( ISurfFlatRegion* pSfr, double dTol, ISurfFlatRegion* pSfrToUpdate) const
{
/*
quando si lavorano dei SubSteps, può capitare che la superfice da rimuovere sia molto snella;
@@ -2894,7 +2895,7 @@ SurfRoughing::RemoveChunksUnderTolerance( ISurfFlatRegion* pSfr, ISurfFlatRegion
// controllo dei parametri
if ( pSfr == nullptr || ! pSfr->IsValid())
return false ;
if ( m_dSubStepToler < EPS_SMALL) // se tolleranza non presente, non faccio nulla
if ( dTol < EPS_SMALL) // se tolleranza non presente, non faccio nulla
return true ;
// scorro tutti i chunk della superficie
@@ -2903,7 +2904,7 @@ SurfRoughing::RemoveChunksUnderTolerance( ISurfFlatRegion* pSfr, ISurfFlatRegion
double dMaxOffs = EPS_SMALL ;
pSfr->GetChunkMaxOffset( nC, dMaxOffs) ;
// rimuovo il Chunk c-esimo se l'Offset massimo è minore della tolleranza
if ( dMaxOffs < m_dSubStepToler) {
if ( dMaxOffs < dTol) {
if ( pSfrToUpdate != nullptr && pSfrToUpdate->IsValid()) {
PtrOwner<ISurfFlatRegion> pSfrChunk( pSfr->CloneChunk( nC)) ;
if ( ! IsNull( pSfrChunk) || pSfrChunk->IsValid()) {
@@ -3058,7 +3059,7 @@ SurfRoughing::CloseOpenEdgesUnderTolerance( ISurfFlatRegion* pSfr, double dToler
}
}
RemoveChunksUnderTolerance( pSfrRegular) ;
RemoveChunksUnderTolerance( pSfrRegular, m_dSubStepToler) ;
// resituisco la superficie
pSfr->CopyFrom( pSfrRegular) ;
return true ;
@@ -3213,6 +3214,8 @@ SurfRoughing::ChooseCloseOrOpenEdge( ISurfFlatRegion* pSfr, const ISurfFlatRegio
}
}
// per sicurezza
RemoveChunksUnderTolerance( pSfr, m_dStepToler) ;
return true ;
}
+2 -1
View File
@@ -129,7 +129,7 @@ class SurfRoughing : public Machining
double GetRightFeed( const Vector3d& vtMove, const Vector3d& vtTool) const ;
double GetRadiusForStartEndElevation( void) const ;
bool ResetCurveAllTempProp( ICurve* pCurve) const ;
bool RemoveChunksUnderTolerance( ISurfFlatRegion* pSfr, ISurfFlatRegion* pSfrToUpdate = nullptr) const ;
bool RemoveChunksUnderTolerance( ISurfFlatRegion* pSfr, double dTol, ISurfFlatRegion* pSfrToUpdate = nullptr) const ;
bool CloseOpenEdgesUnderTolerance( ISurfFlatRegion* pSfr, double dToler) ;
bool ModifySurfForOpenCloseEdges( ISurfFlatRegion* pSfr, const Vector3d& vtTool, const ICurveComposite* pCrvCompo) const ;
bool ChooseCloseOrOpenEdge( ISurfFlatRegion* pSfr, const ISurfFlatRegion* pSfrRef) const ;
@@ -194,6 +194,7 @@ class SurfRoughing : public Machining
int m_nStatus ; // stato di aggiornamento della lavorazione
int m_nPaths ; // numero di percorsi di lavoro generati
double m_dMaxHelixRad ; // raggio massimo attacco ad elica nel caso di cerchi
double m_dStepToler ; // tolleranza di rimozione chunk per Steps
double m_dSubStepToler ; // tolleranza di rimozione chunk per SubSteps
bool m_bDetectPlaneZ ; // flag per calcolo piani in Zloc di Pocketing
} ;