EgtGeomKernel :

- piccole velocizzazioni per biarchi
- modifiche per unificazioni AreSamePoint***.
This commit is contained in:
Dario Sassi
2024-08-06 14:42:25 +02:00
parent 5e84408685
commit b90289e42b
2 changed files with 10 additions and 8 deletions
+5 -3
View File
@@ -136,14 +136,16 @@ GetBiArc( const Point3d& ptP0, double dDir0Deg, const Point3d& ptP1, double dDir
// determino la massima distanza tra la curva e il biarco
double dSqDist = 0 ;
const double STEP = dTol ; // scelto euristicamente
const double STEP = 10 ;
Point3d ptCurr ;
bool bPnt = PL.GetFirstPoint( ptCurr) ;
Point3d ptPrev = ptCurr ;
while ( bPnt) {
double dLen = Dist( ptCurr, ptPrev) ;
int nStep = ( dLen < STEP ? 2 : 1) * ( int( dLen / STEP) + 1) ;
nStep = min( 10, nStep) ; // scelto euristicamente
int nStep = int( dLen / STEP) + 1 ;
int nMinStep = ( dLen > 50 * dTol ? 3 : ( dLen > 10 * dTol ? 2 : 1)) ;
int nMaxStep = 10 ;
nStep = Clamp( nStep, nMinStep, nMaxStep) ;
for ( int i = 1 ; i <= nStep ; ++ i) {
double dCoeff = double( i) / nStep ;
Point3d ptP = Media( ptPrev, ptCurr, dCoeff) ;