Support for measurement of distances between objects.
#include <AlMeasure.h> class AlMeasure static double minDist( AlSurface*, AlSurface*, double* = NULL, double* = NULL, double[]= NULL, double* = NULL, double* = NULL, double[] = NULL, int = 20, int = 20 ); static double minDist( AlSurface*, AlCurve*, double* = NULL, double* = NULL, double[] = NULL, double* t2=NULL, double[] = NULL, int = 100 ); static double minDist( AlSurface*, double[3], double* = NULL, double* = NULL, double[] = NULL); static double minDist( AlCurve*, AlCurve*, double* = NULL, double[] = NULL, double* = NULL, double[] = NULL, int = 100); static double minDist( AlCurve*, double[3], double* = NULL, double[] = NULL);
The following are a series of overloaded functions named minDist(). These can be used to find the closest points between any two surfaces, curves, and/or points.
The minDist() functions will return a negative value if and only if the objects it is given do not exist.
For the sake of continuity, the order of the two objects to be measured is always highest dimensionality to lowest.
double AlMeasure::minDist( AlSurface* surface1, AlSurface* surface2, double* u1, double* v1, double P1[], double* u2, double* v2, double P2[], int interval_u, int interval_v)
Determines the minimum distance between two AlSurfaces. Extra information about the points on each surface that are closest to each other is available. The accuracy of the search for the minimum distance is modifiable through the interval arguments.
< surface1 - the first AlSurface
< surface2 - the second AlSurface
> u1, v1 - u,v values of the closest point on surface1 to surface2
> P1[3] - x,y,z values of the closest point on surface1 to surface2
> u2, v2 - u,v values of the closest point on surface2 to surface1
> P2[3] - x,y,z values of the closest point on surface2 to surface1
< interval_u - number of intervals into which surface1 will be split in the u direction (defines the accuracy of the search)
< interval_v - number of intervals into which surface1 will be split in the v direction (defines the accuracy of the search)
double AlMeasure::minDist( AlSurface* surface1, AlCurve* curve2, double* u1, double* v1, double P1[], double* t2, double P2[], int interval)
Determines the minimum distance between an AlSurface and an AlCurve. Extra information about the points on each object that are closest to each other is available. The accuracy of the search for the minimum distance is modifiable through the interval argument.
> u1, v1 - u,v values of the closest point on surface1 to curve2
> P1[3] - x,y,z values of the closest point on surface1 to curve2
> t2 - t value of the closest point on curve2 to surface1
> P2[3] - x,y,z values of the closest point on curve2 to surface1
< interval - number of intervals into which curve2 will be split (defines the accuracy of the search)
double AlMeasure::minDist( AlSurface* surface1, double P2[3], double* u1, double* v1, double P1[])
Determines the minimum distance from an AlSurface and a point. Extra information about the point on the surface that is closest to the given point is available.
double AlMeasure::minDist( AlCurve* curve1, AlCurve* curve2, double* t1, double P1[], double* t2, double P2[], int interval)
Determines the minimum distance between two AlCurve’s. Extra information about the points on each curve that are closest to each other is available. The accuracy of the search for the minimum distance is modifiable through the interval argument.
> t1 - t value of the closest point on curve1 to curve2
> P1[3] - x,y,z values of the closest point on curve1 to curve2
> t2 - t value of the closest point on curve2 to curve1
> P2[3] - x,y,z values of the closest point on curve2 to curve1
< interval - number of intervals into which curve1 will be split (defines the accuracy of the search)
double AlMeasure::minDist( AlCurve* curve1, double P2[3], double* t1, double P1[])
Determines the minimum distance between an AlCurve and a point. Extra information about the point on the curve that is closest to the given point is available.