EgtGeomKernel :

- in CalcPocketing piccola modifica a casi forzati dei trapezi.
This commit is contained in:
Riccardo Elitropi
2026-03-30 16:52:46 +02:00
parent dee744725c
commit 7385709bb4
+14 -1
View File
@@ -2691,14 +2691,27 @@ IsForcedStepTrapezoid( const ICurveComposite* pCrvTrap, const PocketParams& Pock
break ;
// se ho tre lati chiusi
case 3 : {
// diventa forzato se il lato aperto non è grande
// diventa forzato se il lato aperto non ha una componente perpendicolare grande rispetto al chiuso precedente e successivo
double dLenOpen = 0. ;
for ( int i = 0 ; i < 4 ; ++ i) {
if ( vnProps[i] == TEMP_PROP_OPEN_EDGE) {
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 apsetto 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 ;
}
}