EgtGeomKernel :
- in CalcPocketing aggiunto calcolo della Feed per percorsi a curva singola.
This commit is contained in:
+29
-12
@@ -125,7 +125,24 @@ AssignMinFeed( ICurveComposite* pCrv, const PocketParams& PockParams)
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
static bool
|
||||
GetFeedForParam( double& dPar, const PocketParams& PockParams, double& dFeed)
|
||||
AssignCustomFeed( ICurveComposite* pCrv, const PocketParams& PockParams, double dFeed)
|
||||
{
|
||||
// controllo dei parametri
|
||||
if ( pCrv == nullptr || ! pCrv->IsValid() || pCrv->GetCurveCount() == 0)
|
||||
return false ;
|
||||
// La Feed deve essere compresa tra la minima e la massima
|
||||
dFeed = Clamp( dFeed, GetMinFeed( PockParams), GetMaxFeed( PockParams)) ;
|
||||
|
||||
// assegno la Feed ad ogni sottocurva di pCrv
|
||||
for ( int u = 0 ; u < pCrv->GetCurveCount() ; ++ u)
|
||||
pCrv->SetCurveTempParam( u, dFeed, 0) ;
|
||||
|
||||
return true ;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
static bool
|
||||
GetFeedForParam( double dPar, const PocketParams& PockParams, double& dFeed)
|
||||
{
|
||||
/*
|
||||
Feed
|
||||
@@ -1692,12 +1709,11 @@ GetPocketCurvesByCloseEdges( const ISurfFlatRegion* pSfrChunk, const PocketParam
|
||||
bAllRemoved = false ;
|
||||
|
||||
// controllo se la superficie si annulla con un controOffset del raggio utensile
|
||||
PtrOwner<ISurfFlatRegion> pSfrCheck( CloneSurfFlatRegion( pSfrChunk)) ;
|
||||
if ( IsNull( pSfrCheck) || ! pSfrCheck->IsValid())
|
||||
return false ;
|
||||
pSfrCheck->Offset( - PockParams.dRad + 200 * EPS_SMALL, ICurve::OFF_FILLET) ;
|
||||
if ( pSfrCheck->IsValid() && pSfrCheck->GetChunkCount() > 0)
|
||||
return true ; // se la superficie non si annulla, allora non ricavo nessuna curva
|
||||
double dMaxOffs ;
|
||||
pSfrChunk->GetMaxOffset( dMaxOffs) ;
|
||||
if ( dMaxOffs > PockParams.dRad + 200 * EPS_SMALL)
|
||||
return true ;
|
||||
|
||||
/*
|
||||
NB. Si poteva calcolare la Fat curve del raggio utensile dell'Offset di tutti i chiusi e vedere
|
||||
se l'unione di queste regioni copriva interamente il Chunk attuale... così facendo rischio di
|
||||
@@ -1909,17 +1925,18 @@ GetPocketCurvesByCloseEdges( const ISurfFlatRegion* pSfrChunk, const PocketParam
|
||||
|
||||
// imposto le Feed per tali curve e aggiungo eventuale entrata da fuori
|
||||
for ( int i = 0 ; i < int( vCrvCompoRes_tmp.size()) ; ++ i) {
|
||||
// per ora è default ( sono passate singole)...
|
||||
/*
|
||||
Idea : Feed proporzionale al minimo Offset per annullare la regione ?
|
||||
-> Massimo parametro sui bisettori di VORONOI (?)
|
||||
-> Massimo parametro sui bisettori di VORONOI
|
||||
*/
|
||||
AssignMinFeed( vCrvCompoRes_tmp[i], PockParams) ;
|
||||
double dFeed ;
|
||||
GetFeedForParam( 2 * dMaxOffs, PockParams, dFeed) ;
|
||||
AssignCustomFeed( vCrvCompoRes_tmp[i], PockParams, dFeed) ;
|
||||
// ricavo punto di inizio e vettore tangente
|
||||
Point3d ptStart ; vCrvCompoRes_tmp[i]->GetStartPoint( ptStart) ;
|
||||
Vector3d vtStart ; vCrvCompoRes_tmp[i]->GetStartDir( vtStart) ;
|
||||
// recupero il punto di caduta dell'utensile
|
||||
Point3d ptFall = ptStart - vtStart * ( PockParams.dRad + PockParams.dOpenMinSafe) ;
|
||||
Point3d ptFall = ptStart - vtStart * ( 2 * PockParams.dRad + PockParams.dOpenMinSafe) ;
|
||||
// controllo che il tool non sia interno alla regione limite
|
||||
if ( pSfrLimit->IsValid()) {
|
||||
PtrOwner<ICurveArc> pCrvToolShape( CreateCurveArc()) ;
|
||||
@@ -1934,7 +1951,7 @@ GetPocketCurvesByCloseEdges( const ISurfFlatRegion* pSfrChunk, const PocketParam
|
||||
}
|
||||
else { // se trovo intersezione, provo a ruotare di 90°
|
||||
vtStart.Rotate( Z_AX, ANG_RIGHT) ; // verso sinistra
|
||||
ptFall = ptStart + vtStart * ( PockParams.dRad + PockParams.dOpenMinSafe) ;
|
||||
ptFall = ptStart + vtStart * ( 2 * PockParams.dRad + PockParams.dOpenMinSafe) ;
|
||||
if ( ! pCrvToolShape->Set( ptFall, Z_AX, PockParams.dRad - 100 * EPS_SMALL))
|
||||
return false ;
|
||||
ccClass.clear() ;
|
||||
|
||||
Reference in New Issue
Block a user