AlMeasure
 
 
 

Support for measurement of distances between objects.

Synopsis

#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);

Description

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)

Description

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.

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)

Return Values

< 0 - one or both of the AlSurfaces were not valid

=> 0 - the distance between the two closest points

double AlMeasure::minDist( AlSurface* surface1, AlCurve* curve2, double* u1, double* v1, double P1[], double* t2, double P2[], int interval)

Description

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.

Arguments

< surface1 - the AlSurface

< curve2 - the AlCurve

> 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)

Return Values

< 0 - either surface1 or curve2 was not valid

=> 0 - the distance between the two closest points

double AlMeasure::minDist( AlSurface* surface1, double P2[3], double* u1, double* v1, double P1[])

Description

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.

Arguments

< surface1 - the AlSurface

< P2[3] - x,y,z values of the point

> u1, v1 - u,v values of the closest point on surface1 to P2

> P1[3] - x,y,z values of the closest point on surface1 to P2

Return Values

< 0 - surface1 was not a valid AlSurface

=> 0 - the distance between the two closest points.

double AlMeasure::minDist( AlCurve* curve1, AlCurve* curve2, double* t1, double P1[], double* t2, double P2[], int interval)

Description

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.

Arguments

< curve1 - the first AlCurve

< curve2 - the second AlCurve

> 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)

Return Values

< 0 - one or both of the AlCurve’s were not valid

=> 0 - the distance between the two closest points

double AlMeasure::minDist( AlCurve* curve1, double P2[3], double* t1, double P1[])

Description

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.

Arguments

< curve1 - the AlCurve

< P2[3] - x,y,z values of the point

> t1 - t value of the closest point on curve1 to P2

> P1[3] - x,y,z values of the closest point on curve1 to P2

Return Values

< 0 - curve1 is not a valid AlCurve

=> 0 - the distance between the two closest points.