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) ;
+5 -5
View File
@@ -1723,23 +1723,23 @@ SurfBezier::ReorderPntVector( const POLYLINEVECTOR& vPL, bool bTriangulatedIn3D,
nInd = 0 ;
Point3d ptPoly ; pl.GetFirstPoint( ptPoly) ;
bool bFound = false ;
if( AreSamePointStepExact( pt, ptPoly)){
if( AreSamePointExact( pt, ptPoly)){
nPoints = pl.GetPointNbr() ;
nPoly = poly ;
bFound = true ;
pl.GetNextPoint( ptPoly) ;
if( ! AreSamePointStepExact( vPnt[p+1], ptPoly))
if( ! AreSamePointExact( vPnt[p+1], ptPoly))
bInverted = true ;
break ;
}
while ( pl.GetNextPoint( ptPoly) && ! bFound) {
++ nInd ;
if( AreSamePointStepExact( pt, ptPoly)) {
if( AreSamePointExact( pt, ptPoly)) {
nPoints = pl.GetPointNbr() ;
nPoly = poly ;
bFound = true ;
pl.GetNextPoint( ptPoly) ;
if( ! AreSamePointStepExact( vPnt[p+1], ptPoly))
if( ! AreSamePointExact( vPnt[p+1], ptPoly))
bInverted = true ;
break ;
}
@@ -1817,7 +1817,7 @@ SurfBezier::ReorderPntEnhancedVector( const POLYLINEVECTOR& vPL, bool bTriangula
if( vbPntChecked[t])
continue ;
Point3d ptToCheck = vPnt[t] ;
if ( AreSamePointStepExact( pt, ptToCheck)) {
if ( AreSamePointExact( pt, ptToCheck)) {
vbPntChecked[t] = true ;
vPntOrd.push_back( vPntPolyToOrd[p]) ;
}