EgtMachKernel 2.2b6 :

- migliorie a svuotature con lati aperti e cambio posizione fresa su lato aperto (ora in centro).
This commit is contained in:
Dario Sassi
2020-02-28 09:07:09 +00:00
parent 9736b336ec
commit c5f0bc1034
2 changed files with 27 additions and 10 deletions
BIN
View File
Binary file not shown.
+27 -10
View File
@@ -1424,6 +1424,10 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId)
if ( plPlane.GetVersN() * vtExtr * dArea < 0)
pCompo->Invert() ;
// unisco le parti allineate (tranne inizio-fine se chiusa)
if ( ! pCompo->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL, false, true))
return false ;
// se ci sono lati aperti
bool bMidOpen = false ;
Point3d ptMidOpen ;
@@ -1438,10 +1442,6 @@ Pocketing::ProcessPath( int nPathId, int nPvId, int nClId)
}
}
// unisco le parti allineate (tranne inizio-fine se chiusa)
if ( ! pCompo->MergeCurves( 10 * EPS_SMALL, 10 * EPS_ANG_SMALL, false))
return false ;
// sposto l'inizio a metà del tratto più lungo ( o aperto più lungo)
if ( bMidOpen) {
double dPar ; int nFlag ;
@@ -3764,20 +3764,37 @@ Pocketing::GetMidOfLongestOpenSide( const ICurveComposite* pCompo, Point3d& ptMi
double dMaxLen = m_TParams.m_dDiam + 2 * GetOffsR() - EPS_SMALL ;
// ciclo sulle singole curve
bool bFound = false ;
const ICurve* pPrevCrv = pCompo->GetLastCurve() ;
double dLenPrev = 0 ;
if ( pPrevCrv != nullptr && pPrevCrv->GetTempProp() == 1)
pPrevCrv->GetLength( dLenPrev) ;
const ICurve* pCrv = pCompo->GetFirstCurve() ;
while ( pCrv != nullptr) {
// analizzo la curva successiva
const ICurve* pNextCrv = pCompo->GetNextCurve() ;
bool bNextOk = ( pNextCrv != nullptr) ;
if ( ! bNextOk)
pNextCrv = pCompo->GetFirstCurve() ;
double dLenNext = 0 ;
if ( pNextCrv != nullptr && pNextCrv->GetTempProp() == 1)
pNextCrv->GetLength( dLenNext) ;
// verifico la curva corrente
if ( pCrv->GetTempProp() == 1) {
double dLen ;
if ( pCrv->GetLength( dLen) && dLen > dMaxLen) {
dMaxLen = dLen ;
double dLen = 0 ;
if ( pCrv->GetLength( dLen) && dLen + dLenPrev + dLenNext > dMaxLen) {
dMaxLen = dLen + dLenPrev + dLenNext ;
pCrv->GetMidPoint( ptMid) ;
// vettore ortogonale verso l'esterno (ruotato -90deg rispetto a estrusione9
// vettore ortogonale verso l'esterno (ruotato -90deg rispetto a estrusione)
pCrv->GetMidDir( vtMidOrt) ;
vtMidOrt.Rotate( vtExtr, 0, -1) ;
bFound = true ;
}
dLenPrev = dLen ;
}
pCrv = pCompo->GetNextCurve() ;
else
dLenPrev = 0 ;
// vado alla successiva
pCrv = ( bNextOk ? pNextCrv : nullptr) ;
}
return bFound ;
@@ -3796,7 +3813,7 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo)
// sposto l'inizio a metà del tratto più lungo
AdjustContourStart( pCompo) ;
// raggio di riferimento per offset
double dRad = 0.25 * m_TParams.m_dDiam + GetOffsR() ;
double dRad = 0.5 * m_TParams.m_dDiam + GetOffsR() ;
// estraggo tutte le curve in un vettore
ICURVEPOVECTOR vpCrvs ;
vpCrvs.reserve( pCompo->GetCurveCount()) ;