EgtGeomKernel :
- in CalcPocketing correzione sull'ordine degli Offset per i casi Spiral.
This commit is contained in:
+10
-9
@@ -6845,9 +6845,9 @@ OrderSpiralOffset( const ICRVCOMPOPOVECTOR& vOffsFirstCurve, const PocketParams&
|
||||
|
||||
// se nessuna curva trovata valida, ne scelgo una da un indice dei bordi originali
|
||||
if ( ! bFound) {
|
||||
int nI = -1, nJ = -1 ;
|
||||
// recupero tutti gli indici non già inseriti
|
||||
double dMinDist = INFINITO ;
|
||||
int nNewRefInd = -1 ;
|
||||
for ( int j = 0 ; j < ssize( matOffsInfo[0]) ; ++ j) {
|
||||
if ( matOffsInfo[0][j].bUsed)
|
||||
continue ;
|
||||
@@ -6859,7 +6859,8 @@ OrderSpiralOffset( const ICRVCOMPOPOVECTOR& vOffsFirstCurve, const PocketParams&
|
||||
return false ;
|
||||
if ( dMyDist < dMinDist) {
|
||||
dMinDist = dMyDist ;
|
||||
nNewRefInd = j ;
|
||||
nI = 0 ;
|
||||
nJ = j ;
|
||||
pCompoCurr = pMyCompo ;
|
||||
bAtSmooth = bMyAtSmooth ;
|
||||
// cambio il suo punto iniziale nel punto più vicino tovato
|
||||
@@ -6870,9 +6871,8 @@ OrderSpiralOffset( const ICRVCOMPOPOVECTOR& vOffsFirstCurve, const PocketParams&
|
||||
}
|
||||
}
|
||||
// se vuoto
|
||||
if ( nNewRefInd == -1) {
|
||||
if ( nJ == -1) {
|
||||
// cerco tra le curve valide, quella più vicina
|
||||
INTINT CellMinDist = make_pair( -1, -1) ;
|
||||
double dMinDist = INFINITO ;
|
||||
for ( int i = 0 ; i < ssize( matOffsInfo) ; ++ i) {
|
||||
for ( int j = 0 ; j < ssize( matOffsInfo[i]) ; ++ j) {
|
||||
@@ -6885,7 +6885,8 @@ OrderSpiralOffset( const ICRVCOMPOPOVECTOR& vOffsFirstCurve, const PocketParams&
|
||||
return false ;
|
||||
if ( dMyDist < dMinDist) {
|
||||
dMinDist = dMyDist ;
|
||||
CellMinDist = make_pair( i, j) ;
|
||||
nI = i ;
|
||||
nJ = j ;
|
||||
bAtSmooth = bMyAtSmooth ;
|
||||
// cambio il suo punto iniziale nel punto più vicino tovato
|
||||
double dUS ;
|
||||
@@ -6897,18 +6898,18 @@ OrderSpiralOffset( const ICRVCOMPOPOVECTOR& vOffsFirstCurve, const PocketParams&
|
||||
}
|
||||
}
|
||||
}
|
||||
if ( CellMinDist.first == -1 || CellMinDist.second == -1)
|
||||
if ( nI == -1 || nJ == -1)
|
||||
return false ;
|
||||
}
|
||||
vIndRef.push_back( nNewRefInd) ; // Aggiorno gli indici dei loop originali
|
||||
vIndRef.push_back( nJ) ; // Aggiorno gli indici dei loop originali
|
||||
#if 0
|
||||
matOffs.resize( matOffs.size() + 1) ;
|
||||
matOffs.back().push_back( pCompoCurr) ;
|
||||
#endif
|
||||
vecOffs.emplace_back( CloneCurveComposite( pCompoCurr)) ;
|
||||
matOffsInfo[0][nNewRefInd].bUsed = true ;
|
||||
matOffsInfo[nI][nJ].bUsed = true ;
|
||||
bFound = true ; // Offset trovato
|
||||
nIter = 0 ; // Aggiornamento Iterazione
|
||||
nIter = nI ; // Aggiornamento Iterazione
|
||||
}
|
||||
|
||||
// verifica dei parametri utilizzati
|
||||
|
||||
Reference in New Issue
Block a user