EgtGeomKernel :
- in CalcPocketing migliorati i controlli per i casi a Trapezio. - in CAvToolTriangle migliorata la creazione del frame Locale in CAvDiskTriangle per direzioni generiche di vDiskAx e vtMove.
This commit is contained in:
+2
-4
@@ -2440,12 +2440,10 @@ CAvDiskTriangle( const Point3d& ptDiskCen, const Vector3d& vtDiskAx, double dDis
|
||||
// Allontanamento dall'interno
|
||||
double dEscapeDist = max( DiskTriaInteriorEscapeDistGenMot( ptDiskCen, vtDiskAx, dDiskRad, trTria, vtMove), 0.) ;
|
||||
// Allontanamento dalla frontiera
|
||||
Vector3d vtMoveOrt = vtMove - vtMove * vtDiskAx * vtDiskAx ;
|
||||
Vector3d vtMoveOrt = OrthoCompo( vtMove, vtDiskAx) ;
|
||||
vtMoveOrt.Normalize() ;
|
||||
Frame3d DiskFrame ;
|
||||
Vector3d vtJ = vtDiskAx ^ vtMoveOrt ;
|
||||
vtJ.Normalize() ;
|
||||
DiskFrame.Set( ptDiskCen, vtMoveOrt, vtJ, vtDiskAx) ;
|
||||
DiskFrame.Set( ptDiskCen, vtDiskAx, vtMoveOrt) ;
|
||||
Triangle3d trTriaLoc = trTria ;
|
||||
Vector3d vtMoveLoc = vtMove ;
|
||||
trTriaLoc.ToLoc( DiskFrame) ;
|
||||
|
||||
+26
-11
@@ -2690,15 +2690,30 @@ IsForcedStepTrapezoid( const ICurveComposite* pCrvTrap, const PocketParams& Pock
|
||||
bForced = true ;
|
||||
// se entrambe le basi sono aperte
|
||||
else if ( vnProps[nBase] == TEMP_PROP_OPEN_EDGE && vnProps[nSecondBase] == TEMP_PROP_OPEN_EDGE) {
|
||||
const ICurve* pCrvOpenBase = pCrvTrap->GetCurve( nBase) ;
|
||||
const ICurve* pCrvOpenSecondBase = pCrvTrap->GetCurve( nSecondBase) ;
|
||||
if ( pCrvOpenBase == nullptr || ! pCrvOpenBase->IsValid() ||
|
||||
pCrvOpenSecondBase == nullptr || ! pCrvOpenSecondBase->IsValid())
|
||||
return false ;
|
||||
double dLenOpenBase ; pCrvOpenBase->GetLength( dLenOpenBase) ;
|
||||
double dLenSecondOpenBase ; pCrvOpenSecondBase->GetLength( dLenSecondOpenBase) ;
|
||||
bForced = ( dLenOpenBase < dDiam + 10. * EPS_SMALL &&
|
||||
dLenSecondOpenBase < dDiam + 10. * EPS_SMALL) ;
|
||||
double dLenOpen = 0. ;
|
||||
for ( int i = 0 ; i < 4 ; ++ i) {
|
||||
if ( i == nBase || i == nSecondBase) {
|
||||
const ICurve* pCrvOpen = pCrvTrap->GetCurve( i) ;
|
||||
if ( pCrvOpen == nullptr || ! pCrvOpen->IsValid())
|
||||
return false ;
|
||||
// essendo nei casi a trapezio, ho solo segmenti
|
||||
pCrvOpen->GetLength( dLenOpen) ;
|
||||
Vector3d vtDir ; pCrvOpen->GetStartDir( vtDir) ;
|
||||
vtDir *= dLenOpen ;
|
||||
const ICurve* pCrvClosePrev = pCrvTrap->GetCurve( ( i == 0 ? 3 : i - 1)) ;
|
||||
if ( pCrvClosePrev == nullptr || ! pCrvClosePrev->IsValid())
|
||||
return false ;
|
||||
const ICurve* pCrvCloseAft = pCrvTrap->GetCurve( ( i == 3 ? 0 : i + 1)) ;
|
||||
if ( pCrvCloseAft == nullptr || ! pCrvCloseAft->IsValid())
|
||||
return false ;
|
||||
// essendo un trapezio queste due direzioni me le aspetto parallele tra loro
|
||||
Vector3d vtDirPrev ; pCrvClosePrev->GetEndDir( vtDirPrev) ;
|
||||
Vector3d vtDirAft ; pCrvCloseAft->GetStartDir( vtDirAft) ;
|
||||
dLenOpen = min( { OrthoCompo( vtDir, vtDirPrev).Len(), OrthoCompo( vtDir, vtDirAft).Len(), dLenOpen}) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
bForced = ( dLenOpen < dDiam + TOL_TRAPEZOID) ;
|
||||
}
|
||||
// se alternate, non forzo
|
||||
else
|
||||
@@ -2724,14 +2739,14 @@ IsForcedStepTrapezoid( const ICurveComposite* pCrvTrap, const PocketParams& Pock
|
||||
const ICurve* pCrvCloseAft = pCrvTrap->GetCurve( ( i == 3 ? 0 : i + 1)) ;
|
||||
if ( pCrvCloseAft == nullptr || ! pCrvCloseAft->IsValid())
|
||||
return false ;
|
||||
// essendo un trapezio queste due direzioni me le apsetto parallele tra loro
|
||||
// essendo un trapezio queste due direzioni me le aspetto parallele tra loro
|
||||
Vector3d vtDirPrev ; pCrvClosePrev->GetEndDir( vtDirPrev) ;
|
||||
Vector3d vtDirAft ; pCrvCloseAft->GetStartDir( vtDirAft) ;
|
||||
dLenOpen = min( { OrthoCompo( vtDir, vtDirPrev).Len(), OrthoCompo( vtDir, vtDirAft).Len(), dLenOpen}) ;
|
||||
break ;
|
||||
}
|
||||
}
|
||||
bForced = ( dLenOpen < dDiam + 10. * EPS_SMALL) ;
|
||||
bForced = ( dLenOpen < dDiam + TOL_TRAPEZOID) ;
|
||||
}
|
||||
break ;
|
||||
// se tutto chiuso, è forzato
|
||||
|
||||
Reference in New Issue
Block a user