EgtMachKernel :

- Test codice.
This commit is contained in:
Riccardo Elitropi
2023-08-03 13:12:53 +02:00
parent c7070e5f2f
commit ea36a0b8a1
2 changed files with 49 additions and 78 deletions
+48 -77
View File
@@ -2385,8 +2385,8 @@ Pocketing::AddZigZag( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, c
bool bUhAboveRaw = ! m_bAboveHead &&
GetUhPointAboveRaw( ptP1, vtTool, 0, GetRadiusForStartEndElevation(),
m_TParams.m_dLen, false, dSafeZ, vtTool, dStElev) ;
//if ( bAhUnderRaw || bUhAboveRaw)
dStElev = max( dStElev, j * dStep) ;
if ( bAhUnderRaw || bUhAboveRaw)
dStElev = max( dStElev, j * dStep) ;
dStElev -= ( ptP1 - ptStart) * vtExtr ;
// se ottimizzata e attacco nel grezzo
if ( bOptimizedZigZag && !( bOutRawLeadIn || m_bOpenOutRaw)) {
@@ -2404,11 +2404,8 @@ Pocketing::AddZigZag( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, c
dStElev = 0 ;
ptP1 = ptStart ;
}
// se inizio, approccio globale al punto iniziale
if ( bStart) {
//if ( k == 0 && j > 1 && vbChangedPrec[j-1])
// dStElev -= ( j-1) * dStep ;
if ( ! AddApproach( ptP1, vtTool, dSafeZ, dSafeAggrBottZ, dStElev, dAppr, bOutRawLeadIn || m_bOpenOutRaw)) {
m_pMchMgr->SetLastError( 2414, "Error in Pocketing : Approach not computable") ;
return false ;
@@ -2426,6 +2423,7 @@ Pocketing::AddZigZag( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, c
}
}
dStElev = max( dStElev, j * dStep) ;
// aggiungo attacco
SetFeed( GetStartFeed()) ;
//GetCurrPos( ptP1) ; // <----- ????
@@ -2637,8 +2635,8 @@ Pocketing::AddZigZag( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, c
bool bUhAboveRaw = ! m_bAboveHead &&
GetUhPointAboveRaw( ptP1, vtTool, 0, GetRadiusForStartEndElevation(),
m_TParams.m_dLen, false, dSafeZ, vtTool, dStElev) ;
//if ( bAhUnderRaw || bUhAboveRaw)
dStElev = max( dStElev, j * dStep) ;
if ( bAhUnderRaw || bUhAboveRaw)
dStElev = max( dStElev, j * dStep) ;
dStElev -= ( ptP1 - ptStart) * vtExtr ;
// se attacco a zigzag o a spirale o a scivolo, l'elevazione va nell'attacco
if ( GetLeadInType() == POCKET_LI_ZIGZAG ||
@@ -2652,6 +2650,7 @@ Pocketing::AddZigZag( const ISurfFlatRegion* pSrfPock, const Vector3d& vtTool, c
m_pMchMgr->SetLastError( 2418, "Error in Pocketing : Link not computable") ;
return false ;
}
dStElev = max( dStElev, j * dStep) ;
// aggiungo attacco
SetFeed( GetStartFeed()) ;
if ( ! AddLeadIn( ptP1, ptStart, vtStart, vtExtr, pSrfLeanInOut, nullptr, !m_Params.m_bInvert, bSplitArcs, vbMidOut[u] || vbForcedOutStart[u])) {
@@ -6055,7 +6054,7 @@ Pocketing::CutOffsetToClosestPoint( ICRVCOMPOPOVECTOR& vCurves, const Point3d& p
return false ;
// ricavo le due curve ( l'Offset viene spezzato in due sottocurve mediante il punto trovato)
double dUTan, dUS, dUE ;
double dUTan ;
vCurves[nIndex]->GetParamAtPoint( ptCL, dUTan) ;
pCrv1->AddCurve( vCurves[nIndex]->Clone()) ;
if ( ! pCrv1->TrimEndAtParam( dUTan))
@@ -6108,7 +6107,7 @@ Pocketing::CutLinkToClosestPoint( ICURVEPOVECTOR& vCurves, ICRVCOMPOPOVECTOR& vO
return false ;
// ricavo le due curve ( il link viene spezzato in due sottocurve mediante il punto trovato )
double dUS, dUE, dUTan ;
double dUTan ;
vCurves[nIndex]->GetParamAtPoint( ptCL, dUTan) ;
pCrv1->AddCurve( vCurves[nIndex]->Clone()) ;
if ( ! pCrv1->TrimEndAtParam( dUTan))
@@ -8753,6 +8752,7 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO
// stato curve
bool bOpenPrev = bOpenCurr ;
bOpenCurr = ( vpCrvs[i]->GetTempProp() != 0) ;
PtrOwner<ICurve> pCrv_Check( vpCrvs[i]->Clone()) ;
// chiudo eventuale gap
if ( i > 0) {
Point3d ptEnd ; pCompo->GetEndPoint( ptEnd) ;
@@ -8795,6 +8795,8 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO
// ------- controllo degli overlap tra la curva ad amo e la nuova curva di lato aperto ottenuta ------
bool bSucc = false ;
PtrOwner<ICurveComposite> pNewCrv( CreateCurveComposite()) ;
PtrOwner<ICurveComposite> pCrvOffsOri( CreateCurveComposite()) ;
pCrvOffsOri->AddCurve( vpCrvs[i]->Clone()) ;
if ( ! CheckOpenEdgeOverlapParts( pJCrv, vpCrvs[i], true, bSucc, pNewCrv))
return false ;
if ( bSucc)// se "overlap Trovato", modifico la vpCrvs[i]
@@ -8814,7 +8816,7 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO
if ( intCC.GetIntersCount() > 0 && !bInVsOut) {
// cerco la prima intersezione che entra nella curva aperta
for ( int j = 0 ; j < intCC.GetIntersCount() ; ++ j) {
if ( intCC.GetIntCrvCrvInfo( j, aInfo) && aInfo.IciA[0].nPrevTy == ICCT_OUT) {
if ( intCC.GetIntCrvCrvInfo( j, aInfo) && ( bSucc || aInfo.IciA[0].nPrevTy == ICCT_OUT)) {
bFound = true ;
break ;
}
@@ -8827,6 +8829,7 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO
pCompo->AddCurve( ::Release( pJCrv), true, 10 * EPS_SMALL) ;
}
else {
vpCrvs[i].Set( Release( pCrvOffsOri)) ;
pCompo->AddLine( ptStart) ;
pCompo->SetCurveTempProp( pCompo->GetCurveCount() - 1, bInVsOut ? 0 : 1, 0) ; // segmento aggiunto
if ( bInVsOut)
@@ -8868,6 +8871,8 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO
// ------- controllo degli overlap tra la curva ad amo e la nuova curva di lato aperto ottenuta ------
bool bSucc = false ;
PtrOwner<ICurveComposite> pNewCrv( CreateCurveComposite()) ;
PtrOwner<ICurveComposite> pCrvOffsOri( CreateCurveComposite()) ;
pCrvOffsOri->AddCurve( vpCrvs[i]->Clone()) ;
if ( ! CheckOpenEdgeOverlapParts( pJCrv, pLCrv, false, bSucc, pNewCrv))
return false ;
if ( bSucc) { // se "overlap Trovato", modifico la vpCrvs[i]
@@ -8900,6 +8905,7 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO
pCompo->AddCurve( ::Release( pJCrv), true, 10 * EPS_SMALL) ;
}
else {
vpCrvs[i].Set( Release( pCrvOffsOri)) ;
pCompo->AddLine( ptStart) ;
pCompo->SetCurveTempProp( pCompo->GetCurveCount() - 1, bInVsOut ? 0 : 1, 0) ; // segmento come curva aperta
if ( bInVsOut)
@@ -8907,6 +8913,7 @@ Pocketing::AdjustContourWithOpenEdges( ICurveComposite* pCompo, ICRVCOMPOPOVECTO
}
}
else {
vpCrvs[i].Set( Release( pCrv_Check)) ;
pCompo->AddLine( ptStart) ;
pCompo->SetCurveTempProp( pCompo->GetCurveCount() - 1, 1, 0) ; // segmento come curva aperta
if ( bInVsOut)
@@ -8937,11 +8944,6 @@ Pocketing::CheckOpenEdgeOverlapParts( const ICurve* pCrvJ, const ICurve* pCrvOff
bSucc = false ;
pCrvFinal->Clear() ;
//int G = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvJ->Clone()) ;
//m_pGeomDB->SetMaterial( G, GREEN) ;
//int Gg = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvOffBorder->Clone()) ;
//m_pGeomDB->SetMaterial( Gg, BLACK) ;
// converto la curva ad amo in curva composita
PtrOwner<ICurveComposite> pCrvJ_Cut( ConvertCurveToComposite( pCrvJ->Clone())) ;
if ( IsNull( pCrvJ_Cut) || ! pCrvJ_Cut->IsValid() || pCrvJ_Cut->GetCurveCount() == 0)
@@ -9020,9 +9022,6 @@ Pocketing::CheckOpenEdgeOverlapParts( const ICurve* pCrvJ, const ICurve* pCrvOff
for ( int u = 0 ; u < pCrvFinal->GetCurveCount() ; ++ u)
pCrvFinal->SetCurveTempProp( u, 1, 0) ; // sottocurve tutte aperte
//int b = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvFinal->Clone()) ;
//m_pGeomDB->SetMaterial( b, BLUE) ;
return true ;
}
@@ -9055,7 +9054,7 @@ Pocketing::AdustTmpPropLinesForProjection( ICurveComposite* pCompo)
//---------------------------------------------------------------------------
bool
bool
Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, const ICRVCOMPOPOVECTOR& vCrvIsland,
ICurveComposite* pCrvOpenOffs, const Point3d& ptCrvOpenS,
const Point3d& ptCrvOpenE, const double dRad,
@@ -9129,12 +9128,6 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
return false ;
}
//int p = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrInc->Clone()) ;
//m_pGeomDB->SetMaterial( p, PURPLE) ;
//int bb = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvOpen->Clone()) ;
//m_pGeomDB->SetMaterial( bb, WHITE) ;
// -------------- AGGIORNAMENTO DELLA REGIONE DI INFLUENZA --------------
// creo un vettore con la pCompo senza lato aperto e le isole contenute al suo interno
ICRVCOMPOPOVECTOR vCrvToCheck ;
@@ -9162,9 +9155,6 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
if ( IsNull( pCrvCurrPartIn_) || ! pCrvCurrPartIn_->IsValid())
continue ;
//int ppoo = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvCurrPartIn_->Clone()) ;
//m_pGeomDB->SetMaterial( ppoo, ORANGE) ;
// Cerco solo i tratti di curva che sono chiusi
ICURVEPOVECTOR vCrvOpen, vCrvClose ;
if ( ! GetHomogeneousParts( pCrvCurrPartIn_, vCrvOpen, vCrvClose))
@@ -9180,9 +9170,6 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
if ( IsNull( pCrvCurrPartIn_Clone) || ! pCrvCurrPartIn_Clone->IsValid())
continue ;
//int pp = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvCurrPartIn->Clone()) ;
//m_pGeomDB->SetMaterial( pp, YELLOW) ;
// 3) ricavo il punto iniziale e il punto finale, assieme ai vettori tangenti
Point3d ptS1 ; pCrvCurrPartIn->GetStartPoint( ptS1) ;
Point3d ptE1 ; pCrvCurrPartIn->GetEndPoint( ptE1) ;
@@ -9225,17 +9212,12 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
pCrvCurrPartIn->Invert() ; // inversione del tratto interno
pCrvExtBorder->AddCurve( pCrvCurrPartIn->Clone()) ; // aggiunta del tratto interno
//int rrr = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvExtBorder->Clone()) ;
//m_pGeomDB->SetMaterial( rrr, RED) ;
if ( pCrvExtBorder->IsClosed()) {
// 9) Creo la nuova regione da aggiungere a quella di influenza
PtrOwner<ISurfFlatRegion> pSfrExpan( CreateSurfFlatRegion()) ;
if ( IsNull( pSfrExpan))
return false ;
pSfrExpan->AddExtLoop( Release( pCrvExtBorder)) ;
//int green = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrExpan->Clone()) ; //
//m_pGeomDB->SetMaterial( green, GREEN) ; //
if ( pSfrExpan->IsValid()) {
if ( AreOppositeVectorApprox( pSfrExpan->GetNormVersor(), vtExtr))
pSfrExpan->Invert() ;
@@ -9243,17 +9225,11 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
PtrOwner<ISurfFlatRegion> pSfrInc_c( CloneSurfFlatRegion( pSfrInc)) ;
if ( IsNull( pSfrInc_c))
return false ;
//int OOOOOO = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrInc_c->Clone()) ;
//m_pGeomDB->SetMaterial( OOOOOO, BLACK) ;
//int OOOOOOg = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrExpan->Clone()) ;
//m_pGeomDB->SetMaterial( OOOOOOg, WHITE) ;
if ( pSfrInc_c->Subtract( *pSfrExpan)) {
pSfrInc->Clear() ;
for ( int cc = 0 ; cc < pSfrInc_c->GetChunkCount() ; ++ cc) {
CRVCVECTOR ccClass_cc ;
const ISurfFlatRegion* pSfrChunk_cc = pSfrInc_c->CloneChunk( cc) ;
//m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrChunk_cc->Clone()) ;
PtrOwner<ISurfFlatRegion> pSfrChunk_cc( pSfrInc_c->CloneChunk( cc)) ;
if ( pSfrChunk_cc->GetCurveClassification( *pCrvOpen, EPS_SMALL, ccClass_cc)) {
for ( int jj = 0 ; jj < ( int)ccClass_cc.size() ; ++ jj) {
if ( ccClass_cc[jj].nClass == CRVC_IN) {
@@ -9268,8 +9244,6 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
}
}
pSfrInc->Add( *pSfrExpan) ;
//int GRR = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSfrInc->Clone()) ;
//m_pGeomDB->SetMaterial( GRR, GRAY) ;
}
}
}
@@ -9283,13 +9257,6 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
return false ;
}
PtrOwner<ISurfFlatRegion> pSrfInc_toDraw( CloneSurfFlatRegion( pSfrInc)) ;
pSrfInc_toDraw->Translate( vtTrasl) ;
//if ( ! bOk) {
//int brown1 = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSrfInc_toDraw->Clone()) ; //
//m_pGeomDB->SetMaterial( brown1, BROWN) ;
//}
// recupero il Grezzo e sottraggo tutto ciò che sta nella regione
if ( pStmRaw != nullptr) {
bool bIsChanged ;
@@ -9299,30 +9266,14 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
if ( IsNull( pSfrInc) || ! pSfrInc->IsValid() || pSfrInc->GetChunkCount() == 0)
pSfrInc.Set( pSrfInc_Copy) ;
}
}
//if ( bInVsOut) {
//int P = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pStmRaw->Clone()) ; //
//m_pGeomDB->SetMaterial( P, LIME) ;
//}
PtrOwner<ISurfFlatRegion> pSrfInc_toDraw1( CloneSurfFlatRegion( pSfrInc)) ;
pSrfInc_toDraw1->Translate( vtTrasl) ;
//if ( ! bOk) {
//int P = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pStmRaw->Clone()) ; //
//m_pGeomDB->SetMaterial( P, LIME) ;
//int brown = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSrfInc_toDraw1->Clone()) ; //
//m_pGeomDB->SetMaterial( brown, WHITE) ;
//}
if ( IsNull( pSfrInc) || ! pSfrInc->IsValid())
return false ;
// RECUPERO DELLA CURVA DI BORDO ESTERNA DA AGGIUNGERE ALLA SVUOTATURA
PtrOwner<ICurveComposite> pCrvNewBorder( GetCurveComposite( pSfrInc->GetLoop( 0, 0))) ;
if ( IsNull( pCrvNewBorder))
return false ;
//int brown = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrvNewBorder->Clone()) ; //
//m_pGeomDB->SetMaterial( brown, LIME) ;
double dUSTART ;
if ( ! pCrvNewBorder->GetParamAtPoint( ptSTART, dUSTART, 5000 * EPS_SMALL)) {
@@ -9331,7 +9282,7 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
return false ;
}
pCrvNewBorder->ChangeStartPoint( dUSTART) ;
double dUEND ;
double dUEND ;
if ( ! pCrvNewBorder->GetParamAtPoint( ptEND, dUEND, 5000 * EPS_SMALL)) {
int nFlag ;
if ( ! DistPointCurve( ptEND, *pCrvNewBorder).GetParamAtMinDistPoint( 0, dUEND, nFlag))
@@ -9345,9 +9296,6 @@ Pocketing::AdjustPathOutsideRawForOpenEdges( const ICurveComposite* pCompo, cons
for ( int u = 0 ; u < pNewCrv->GetCurveCount() ; ++ u)
pNewCrv->SetCurveTempProp( u, 1, 0) ;
//int Ptttt = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pNewCrv->Clone()) ; //
//m_pGeomDB->SetMaterial( Ptttt, LIME) ;
return true ;
}
@@ -9669,6 +9617,9 @@ bool
Pocketing::AdjustFakeOpenEdges( ICurveComposite* pCrvCompo, const ISurfFlatRegion* pSfrOrig, const ISurfTriMesh* pStmRaw,
const Vector3d vtTrasl, bool bFromProj)
{
//if ( ! bFromProj)
return true ;
// controllo dei parametri
if ( pCrvCompo == nullptr || ! pCrvCompo->IsValid() || pCrvCompo->GetCurveCount() == 0)
return false ;
@@ -9773,6 +9724,11 @@ Pocketing::AdjustFakeOpenEdges( ICurveComposite* pCrvCompo, const ISurfFlatRegio
pSrf_ind0->Invert() ;
pSrf_Proj->Add( *pSrf_ind0) ;
if ( ! bFromProj) {
int ooo = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSrf_Proj->Clone()) ;
m_pGeomDB->SetMaterial( ooo, Color( 0.0, 1.0, 0.0, 0.3)) ;
}
// ===============================================================================================================
// Clono la superificie originaria, portandola allo step corrente
@@ -9780,6 +9736,11 @@ Pocketing::AdjustFakeOpenEdges( ICurveComposite* pCrvCompo, const ISurfFlatRegio
if ( IsNull( pSrfOrig_clone) || ! pSrfOrig_clone->IsValid())
return false ;
pSrfOrig_clone->Translate( vtTrasl) ;
if ( ! bFromProj) {
int oooo = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pSrfOrig_clone->Clone()) ;
m_pGeomDB->SetMaterial( oooo, Color( 0.0, 0.0, 0.0, 0.3)) ;
}
bool bLoopL_isChanged = false ; // flag di indetificazione di un Fake Open Edge
const int MAX_TRY = 10 ; // numero di raffinamenti massimi
@@ -9835,6 +9796,10 @@ Pocketing::AdjustFakeOpenEdges( ICurveComposite* pCrvCompo, const ISurfFlatRegio
PtrOwner<ICurveComposite> pCrv_tOpen_Offs( CloneCurveComposite( pCrvlonger)) ;
if ( IsNull( pCrv_tOpen_Offs) || ! pCrv_tOpen_Offs->IsValid())
return false ;
if ( ! bFromProj) {
int YE = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, pCrv_tOpen_Offs->Clone()) ;
m_pGeomDB->SetMaterial( YE, YELLOW) ;
}
CRVCVECTOR ccClass ;
if ( pSrf_critica->GetCurveClassification( *pCrv_tOpen_Offs, 10 * EPS_SMALL, ccClass)) {
for ( int j = 0 ; j < ( int)ccClass.size() && ! bLoopL_isChanged ; ++ j) {
@@ -9862,6 +9827,12 @@ Pocketing::AdjustFakeOpenEdges( ICurveComposite* pCrvCompo, const ISurfFlatRegio
double dUStart ; // parametro relativo iniziale
double dUEnd ; // parametro relativo finale
PtrOwner<ICurve> CIAO( pCrv_tOpen_Offs->CopyParamRange( ccClass[j].dParS, ccClass[j].dParE)) ;
if ( ! bFromProj) {
int YEs = m_pGeomDB->AddGeoObj( GDB_ID_NULL, GDB_ID_ROOT, CIAO->Clone()) ;
m_pGeomDB->SetMaterial( YEs, Color( 0.95, 0.0, 0.63, 1.0)) ;
}
// ------------------------------ PARAMETRO FINALE -----------------------------------
// se non sono su un raccordo ...
if ( nCrvEnd != -1) {
@@ -9900,14 +9871,14 @@ Pocketing::AdjustFakeOpenEdges( ICurveComposite* pCrvCompo, const ISurfFlatRegio
// se sono su un raccordo ...
else {
int nCrvToAsk = ( int)( max( 0., ccClass[j].dParS - 1)) ;
int nCrvStartReal ;
int nCrvStartReal ;
do {
pCrv_tOpen_Offs->GetCurveTempProp( nCrvToAsk, nCrvStartReal, 0) ;
--nCrvToAsk ;
nCrvStartReal = min( nCrvStartReal, pCrv_tOpen_Offs->GetCurveCount()) - 1 ;
} while ( nCrvStartReal == -1 && nCrvStartReal > 0) ;
if ( nCrvStartReal == -1) // se non trovo -> tratto iniziale in proporzione
nCrvStartReal = ccClass[j].dParS - ( int)ccClass[j].dParS;
nCrvStartReal = ccClass[j].dParS - ( int)ccClass[j].dParS ;
else { // seleziono il pezzo finale del primo tratto trovato ...
const ICurve* pCrv_forLen = pCrv_tOpen_Offs->GetCurve( nCrvStartReal) ;
double dLen = EPS_SMALL ;
@@ -10320,7 +10291,7 @@ Pocketing::IntersSurfWithRaw( ISurfFlatRegion* pSfrPock, const ISurfTriMesh* pSt
if ( IsNull( pSrfCcc_) || ! pSrfCcc_->IsValid())
return false ;
if ( ! pSrfCcc_->Offset( m_dDiam_Prec > 0 ?
- 0.5 * m_dDiam_Prec - m_dOffsetR_Prec : - 0.5 * m_TParams.m_dDiam + GetOffsR(),
- 0.1 * m_dDiam_Prec - m_dOffsetR_Prec : - 0.1 * m_TParams.m_dDiam + GetOffsR(),
ICurve::OFF_FILLET) || pSrfCcc_->GetChunkCount() == 0) {
// se Offset interno sparisce, allora aggiungo il chunk cc_ esimo alla superificie da svuotare
PtrOwner<ISurfFlatRegion> pSrf_Chunck_cc_( pSrf_Pock_orig->CloneChunk( cc_)) ;
+1 -1
View File
@@ -340,7 +340,7 @@ class Pocketing : public Machining
double m_dOpenMinSafe ; // minima distanza di sicurezza di attacco su lato aperto
bool m_bIntersRaw = true ; // flag per intersezione con grezzo
bool m_bProjectRaw = true ; // flag di proiezione del grezzo
double m_dMaxLenRawProj = 100 ; // lunghezza massima per contatto di proiezione
double m_dMaxLenRawProj = 200 ; // lunghezza massima per contatto di proiezione
bool m_bOptOffset = true ; // flag per ottimizzazione numero di Offset necessari
bool m_bOptOffsetCM = false ; // flag per ottimizzazione numero di Offset necessari con centroidi e medial Axis
bool m_bAssignFeed = false ; // flag per controllo della Feed