EgtMachKernel :

- In finiture Optimal aggiunto parametro da note "SplitAngle"
This commit is contained in:
Riccardo Elitropi
2025-03-05 08:42:41 +01:00
parent ba3330edca
commit fef634f7e8
+8 -6
View File
@@ -4098,9 +4098,11 @@ SurfFinishing::GetOptimalSfr( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR&
// versore utensile e di movimento longitudinali in frame locale
Vector3d vtAxL = GetToLoc( vtTool, frSurf) ;
Vector3d vtMoveL = vtAxL ;
// angolo di scelta per divisione dei triangoli
double dSplitAngle = 45. ;
GetValInNotes( m_Params.m_sUserNotes, "SplitAngle", dSplitAngle) ;
// costanti
const double CLIPPING_ANGLE = m_Params.m_dSideAngle ; // Angolo di clipping tra Spiral e ZConst
const double TOL_SAMPLE = 2. ; // Tolleranza di campionamento per collisioni
const double EXTRA_XY = 2.5 * TOL_SAMPLE ; // Espansione del Box in X e Y per griglia di campionamento
@@ -4162,7 +4164,7 @@ SurfFinishing::GetOptimalSfr( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR&
// per la superficie Spiral e il secondo per la superficie ZConst
VECTORCOLLISIONSFR vCollision( ( nStepX + 1) * ( nStepY + 1)) ;
int nInd = 0 ;
double dCosClipping = cos( CLIPPING_ANGLE * DEGTORAD) ;
double dCosClipping = cos( dSplitAngle * DEGTORAD) ;
for ( auto it = lPntM.begin() ; it != lPntM.end() ; ++ it) {
// inserisco il punto di Test
get<0>( vCollision[nInd].CollisionInfo) = get<0>( *it) ;
@@ -4207,16 +4209,16 @@ SurfFinishing::GetOptimalSfr( ICAvToolSurfTm* pCAvTlStm, const SURFLOCALVECTOR&
int nThreadMax = thread::hardware_concurrency() ;
if ( nThreadMax <= 1) {
// recupero le curve di contorno per la superficie Spiral
if ( ! MarchingSquares( vCollision, true, TOL_SAMPLE / 2., nStepX, nStepY, CLIPPING_ANGLE, vtAxL, vtMoveL, pCAvTlStm, vCrvSpiral))
if ( ! MarchingSquares( vCollision, true, TOL_SAMPLE / 2., nStepX, nStepY, dSplitAngle, vtAxL, vtMoveL, pCAvTlStm, vCrvSpiral))
return false ;
// recupero le curve di contorno per la superficie ZConst
if ( ! MarchingSquares( vCollision, false, TOL_SAMPLE / 2., nStepX, nStepY, CLIPPING_ANGLE, vtAxL, vtMoveL, pCAvTlStm, vCrvZConst))
if ( ! MarchingSquares( vCollision, false, TOL_SAMPLE / 2., nStepX, nStepY, dSplitAngle, vtAxL, vtMoveL, pCAvTlStm, vCrvZConst))
return false ;
}
else {
future<bool> vRes[2] ;
vRes[0] = async( launch::async, &SurfFinishing::MarchingSquares, this, cref( vCollision), true, TOL_SAMPLE / 2., nStepX, nStepY, CLIPPING_ANGLE, cref( vtAxL), cref( vtMoveL), ref( pCAvTlStm), ref( vCrvSpiral)) ;
vRes[1] = async( launch::async, &SurfFinishing::MarchingSquares, this, cref( vCollision), false, TOL_SAMPLE / 2., nStepX, nStepY, CLIPPING_ANGLE, cref( vtAxL), cref( vtMoveL), ref( pCAvTlStm), ref( vCrvZConst)) ;
vRes[0] = async( launch::async, &SurfFinishing::MarchingSquares, this, cref( vCollision), true, TOL_SAMPLE / 2., nStepX, nStepY, dSplitAngle, cref( vtAxL), cref( vtMoveL), ref( pCAvTlStm), ref( vCrvSpiral)) ;
vRes[1] = async( launch::async, &SurfFinishing::MarchingSquares, this, cref( vCollision), false, TOL_SAMPLE / 2., nStepX, nStepY, dSplitAngle, cref( vtAxL), cref( vtMoveL), ref( pCAvTlStm), ref( vCrvZConst)) ;
int nFin = 0 ;
bool bOk = true ;
while ( nFin < 2) {