Compare commits

...

5 Commits

Author SHA1 Message Date
Riccardo Elitropi bf14ab1332 EgtGeomKernel :
Modifiche a CalcPocketing
- rimozione variabili statiche
- aggiunti casi ottimizzati Spiral
- estensione superfici sui lati aperti.
2024-05-31 13:10:15 +02:00
Dario Sassi 01bf44cf1e EgtGeomKernel :
- correzione a chiusura composita formata da un solo arco (il nuovo angolo giro al centro deve avere lo steso segno del precedente).
2024-05-30 16:45:38 +02:00
Dario Sassi b5d879cd3d EgtGeomKernel :
- in creazione regioni aggiunta chiusura loops di sicurezza dopo aggiustamenti
- in curve composite corretta chiusura per caso di un solo arco.
2024-05-30 11:20:45 +02:00
Dario Sassi 2b3c285190 EgtGeomKernel :
- modifiche stilistiche.
2024-05-30 08:45:43 +02:00
Dario Sassi 99bb83211c EgtGeomKernel 2.6e6 :
- a TestPath di CAvToolSurfTm passato un parametro in più per indicare la frazione di progress al completamento dell'operazione.
2024-05-29 18:57:12 +02:00
6 changed files with 3302 additions and 351 deletions
+2
View File
@@ -317,6 +317,8 @@ AdjustLoops( ICurve* pCurve, ICURVEPLIST& CrvLst, bool bNeedSameProp)
pCrvCo->RemoveSmallDefects( 2 * LIN_TOL_MIN, ANG_TOL_STD_DEG, true) ;
// unisco eventuali tratti allineati
pCrvCo->MergeCurves( LIN_TOL_MIN, ANG_TOL_STD_DEG, true, bNeedSameProp) ;
// richiudo i loop per sicurezza
pCrvCo->Close() ;
}
}
+9 -8
View File
@@ -120,7 +120,7 @@ CAvToolSurfTm::TestPosition( const Point3d& ptT, const Vector3d& vtDir, const Ve
//----------------------------------------------------------------------------
bool
CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d& vtMove, double dLinTol)
CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d& vtMove, double dLinTol, double dProgCoeff)
{
// Se utensile non definito, errore
if ( m_Tool.GetType() == Tool::UNDEF)
@@ -146,8 +146,9 @@ CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d&
bool bOk = true ;
// Se un solo thread o pochi punti
if ( nThreadMax <= 1 || m_nTotPnt < 500) {
bOk = TestSubPath( -1, lPntM, vtDir, dLinTol) ;
ProcessEvents( 100, 0) ;
m_nCurrPnt = 0 ;
bOk = TestSubPath( -1, lPntM, vtDir, dLinTol, dProgCoeff) ;
ProcessEvents( int( 100 * dProgCoeff), 0) ;
}
// altrimenti
else {
@@ -167,7 +168,7 @@ CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d&
m_bBreak = false ;
future<bool> vRes[MAX_PARTS] ;
for ( int i = 0 ; i < nPartCnt ; ++ i)
vRes[i] = async( launch::async, &CAvToolSurfTm::TestSubPath, this, i, ref( vlPntM[i]), cref( vtDir), dLinTol) ;
vRes[i] = async( launch::async, &CAvToolSurfTm::TestSubPath, this, i, ref( vlPntM[i]), cref( vtDir), dLinTol, dProgCoeff) ;
// attendo i risultati
int nFin = 0 ;
int nNextPE = 0 ;
@@ -179,7 +180,7 @@ CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d&
}
}
if ( m_nCurrPnt > nNextPE) {
int nRes = ProcessEvents( int( m_nCurrPnt * 100. / m_nTotPnt), 10) ;
int nRes = ProcessEvents( int( m_nCurrPnt * 100. / m_nTotPnt * dProgCoeff), 10) ;
nNextPE += STEP_PE ;
if ( nRes == 1)
m_bBreak = true ;
@@ -191,7 +192,7 @@ CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d&
lPntM.pop_back() ;
lPntM.splice( lPntM.end(), vlPntM[i]) ;
}
ProcessEvents( 100, 0) ;
ProcessEvents( int( 100 * dProgCoeff), 0) ;
}
// pulisco HashGrid 2d
m_HGrids.Clear() ;
@@ -200,7 +201,7 @@ CAvToolSurfTm::TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d&
//----------------------------------------------------------------------------
bool
CAvToolSurfTm::TestSubPath( int nId, PNTULIST& lPntM, const Vector3d& vtDir, double dLinTol)
CAvToolSurfTm::TestSubPath( int nId, PNTULIST& lPntM, const Vector3d& vtDir, double dLinTol, double dProgCoeff)
{
// Se lista vuota, non devo fare alcunché
if ( lPntM.empty())
@@ -229,7 +230,7 @@ CAvToolSurfTm::TestSubPath( int nId, PNTULIST& lPntM, const Vector3d& vtDir, dou
if ( nId == -1) {
// gestione eventi (ogni STEP_PE punti)
if (( m_nCurrPnt % STEP_PE) == 0) {
int nRes = ProcessEvents( int( m_nCurrPnt * 100. / m_nTotPnt), 0) ;
int nRes = ProcessEvents( int( m_nCurrPnt * 100. / m_nTotPnt * dProgCoeff), 0) ;
if ( nRes == 1)
return false ;
}
+2 -2
View File
@@ -37,13 +37,13 @@ class CAvToolSurfTm : public ICAvToolSurfTm
const ICurveComposite& GetToolOutline( bool bApprox = false) const override
{ return ( bApprox ? m_Tool.GetApproxOutline() : m_Tool.GetOutline()) ;}
bool TestPosition( const Point3d& ptT, const Vector3d& vtDir, const Vector3d& vtMove, double& dTotDist) override ;
bool TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d& vtMove, double dLinTol) override ;
bool TestPath( PNTULIST& lPntM, const Vector3d& vtDir, const Vector3d& vtMove, double dLinTol, double dProgCoeff = 1) override ;
public :
CAvToolSurfTm( void) ;
private :
bool TestSubPath( int nId, PNTULIST& lPntM, const Vector3d& vtDir, double dLinTol) ;
bool TestSubPath( int nId, PNTULIST& lPntM, const Vector3d& vtDir, double dLinTol, double dProgCoeff) ;
double MyTestPosition( Point3d& ptT, const Vector3d& vtDir) ;
double MyTestPositionHG( Point3d& ptT, const Vector3d& vtDir) ;
bool MyTestMidPointHG( PNTULIST& lPntM, const PNTULIST::iterator& itPntMPrev, const PNTULIST::iterator& itPntMCurr,
+3277 -337
View File
File diff suppressed because it is too large Load Diff
+12 -4
View File
@@ -291,9 +291,15 @@ CurveComposite::Close( void)
return true ;
// se molto vicini li modifico
if ( AreSamePointEpsilon( ptStart, ptEnd, 10 * EPS_SMALL)) {
// se un solo arco
if ( m_CrvSmplS.size() == 1 && m_CrvSmplS.front()->GetType() == CRV_ARC) {
CurveArc* pArc = GetBasicCurveArc( m_CrvSmplS.front()) ;
return pArc->ChangeAngCenter( pArc->GetAngCenter() > 0 ? ANG_FULL : -ANG_FULL) ;
}
// caso generale
Point3d ptMid = Media( ptStart, ptEnd) ;
if ( ! ModifyStart( ptMid) ||
! ModifyEnd( ptMid))
if ( ! m_CrvSmplS.front()->ModifyStart( ptMid) ||
! m_CrvSmplS.back()->ModifyEnd( ptMid))
return false ;
}
// altrimenti aggiungo la linea di chiusura
@@ -879,8 +885,10 @@ CurveComposite::TestClosure( void)
// se distanza superiore al limite ridotto forzo i punti a coincidere
if ( ! AreSamePointEpsilon( ptStart, ptEnd, EPS_CONNECT)) {
// se un solo arco
if ( m_CrvSmplS.size() == 1 && m_CrvSmplS.front()->GetType() == CRV_ARC)
return GetBasicCurveArc( m_CrvSmplS.front())->ChangeAngCenter( ANG_FULL) ;
if ( m_CrvSmplS.size() == 1 && m_CrvSmplS.front()->GetType() == CRV_ARC) {
CurveArc* pArc = GetBasicCurveArc( m_CrvSmplS.front()) ;
return pArc->ChangeAngCenter( pArc->GetAngCenter() > 0 ? ANG_FULL : -ANG_FULL) ;
}
// caso generale
Point3d ptM = Media( ptStart, ptEnd) ;
return ( m_CrvSmplS.front()->ModifyStart( ptM) &&
BIN
View File
Binary file not shown.