mirror of
https://github.com/mcneel/opennurbs.git
synced 2026-04-02 09:26:59 +08:00
Update source to v6.14.19098.19271
This commit is contained in:
@@ -913,15 +913,34 @@ static bool GetTestPlane( const ON_Curve& curve, ON_Plane& plane )
|
||||
}
|
||||
|
||||
Q = P+X;
|
||||
double best_dot = 1.0;
|
||||
ON_3dPoint best_Y = ON_3dPoint::Origin;
|
||||
|
||||
for ( i = 2; i <= 16; i += 2 )
|
||||
{
|
||||
for ( j = 1; j < i; j += 2 )
|
||||
{
|
||||
R = curve.PointAt( d.ParameterAt( ((double)j)/((double)i) ) );
|
||||
if ( plane.CreateFromFrame( P, X, R-P ) )
|
||||
return true;
|
||||
ON_3dVector Y = R - P;
|
||||
if (!Y.Unitize())
|
||||
continue;
|
||||
if (! X.IsParallelTo (Y)){
|
||||
if ( plane.CreateFromFrame( P, X, Y ) )
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
double dot = fabs(X*Y);
|
||||
if (dot < best_dot){
|
||||
best_Y = Y;
|
||||
best_dot = dot;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (best_dot < 1.0){
|
||||
if ( plane.CreateFromFrame( P, X, best_Y ) )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user