EgtGeomKernel :

- miglioria in AdjustLoops per gestire piccole autointersezioni
- piccola correzione in RemoveCurveSmallParts.
This commit is contained in:
SaraP
2023-11-23 13:04:05 +01:00
parent d6fffd228e
commit 5bd5efafb1
2 changed files with 34 additions and 9 deletions
+4 -4
View File
@@ -158,6 +158,7 @@ RemoveCurveSmallParts( ICurveComposite* pCurve, double dLinTol)
Point3d ptStart ; pFirstCrv->GetStartPoint( ptStart) ;
delete( pCurve->RemoveFirstOrLastCurve( false)) ;
pCurve->ModifyStart( ptStart) ;
-- nCrvCount ;
}
// curva finale
const ICurve* pLastCrv = pCurve->GetLastCurve() ;
@@ -166,16 +167,15 @@ RemoveCurveSmallParts( ICurveComposite* pCurve, double dLinTol)
Point3d ptEnd ; pLastCrv->GetStartPoint( ptEnd) ;
delete( pCurve->RemoveFirstOrLastCurve( true)) ;
pCurve->ModifyEnd( ptEnd) ;
-- nCrvCount ;
}
}
}
// ciclo sulle curve elementari della composita
int nStart = pCurve->IsClosed() ? 0 : 1 ;
int nEnd = pCurve->IsClosed() ? nCrvCount : nCrvCount - 1 ;
for ( int i = nStart ; i < nEnd ; ++ i) {
// recupero tre curve consecutive
const ICurve* pPrevCrv = pCurve->GetCurve( ( i > 0 ? i - 1 : nCrvCount - 1)) ;
// recupero la curva corrente
const ICurve* pCurrCrv = pCurve->GetCurve( i) ;
const ICurve* pNextCrv = pCurve->GetCurve( ( i < nCrvCount - 1 ? i + 1 : 0)) ;
// se la curva corrente è troppo corta
double dLen ; pCurrCrv->GetLength( dLen) ;
if ( dLen < dLinTol) {