Brief Index      Full Index      Events Index      I.M. Reference

Compute_Points_Distance_From_Shell


Functions

int Compute_Points_Distance_From_Shell (int test_point_count, const HC_POINT *test_points, double tolerance, int point_count, const HC_POINT *points, int face_list_length, const int *face_list, const char *options, float *results)
int DCompute_Points_Distance_From_Shell (int test_point_count, const HC_DPOINT *test_points, double tolerance, int point_count, const HC_DPOINT *points, int face_list_length, const int *face_list, const char *options, float *results)

Function Documentation

int Compute_Points_Distance_From_Shell ( int  test_point_count,
const HC_POINT *  test_points,
double  tolerance,
int  point_count,
const HC_POINT *  points,
int  face_list_length,
const int *  face_list,
const char *  options,
float *  results 
)

Calculates the closest distance between a given set of points and a shell.

Parameters:
test_point_count - Number of points in the point cloud.
test_points - Vector of x-y-z triplets defining the points to be tested. Passed by reference always.
tolerance - The maximum distance, in object space, a point can be from the shell for its distance to be calculated.
point_count - Number of points in the shell that may enclose the points defined in test_points
points - Vector of x-y-z triplets for the coordinates of the vertices to be used to build the shell. (A simple N x 3 array may also be used). Passed by reference always.
face_list_length - Size of the array of integers which define the faces in face_list.
face_list - Encoded description of how to connect the points to build the faces of the shell (see Insert_Shell() ). Passed by reference always.
options - a string which allows you to specify which algorithm to use to perform the calculation.
results - Array of size test_point_count that specifies the shortest distance the point contained at that index in test_points is from the supplied shell. A -1 will be returned for points which are outside the provided tolerance. Passed by reference. Returned to user.
Returns:
count - The number of points that were within the given tolerance to the shell.

DETAILS

This function allows you to quickly determine the shortest distance between each point in a point cloud and a provided shell. You can provide a tolerance so that points outside a certain distance will not be considered. Through the options string you can dictate which algorithm to use to calculate the distances. Valid choices for the options string are:

mode = [grid|octree] The grid has a high preprocess cost but provides much better performance with larger datasets. The default setting is "mode=octree".

The results string contains an array of floats which detail the distances. A -1 will be returned in the results array for points outside the provided tolerance.

NOTES

If you are making multiple calls to this API then you should consider calling this API between calls to Begin_Shell_Selection and End_Shell_Selection. This will result in HOOPS caching the octree data structures. This optimization is not currently available for the "mode=grid" algorithm.

See also:
Insert_Shell, Show_Shell, Compute_Points_On_Shell, Compute_Points_Inside_Shell

int DCompute_Points_Distance_From_Shell ( int  test_point_count,
const HC_DPOINT *  test_points,
double  tolerance,
int  point_count,
const HC_DPOINT *  points,
int  face_list_length,
const int *  face_list,
const char *  options,
float *  results 
)

Similar to Compute_Points_Distance_From_Shell, but operates on double-precision data.

Parameters:
test_point_count - Number of points in the point cloud.
test_points - Vector of x-y-z triplets defining the points to be tested. Passed by reference always.
tolerance - The maximum distance, in object space, a point can be from the shell for its distance to be calculated.
point_count - Number of points in the shell that may enclose the points defined in test_points
points - Vector of x-y-z triplets for the coordinates of the vertices to be used to build the shell. (A simple N x 3 array may also be used). Passed by reference always.
face_list_length - Size of the array of integers which define the faces in face_list.
face_list - Encoded description of how to connect the points to build the faces of the shell (see Insert_Shell() ). Passed by reference always.
options - a string which allows you to specify which algorithm to use to perform the calculation.
results - Array of size test_point_count that specifies the shortest distance the point contained at that index in test_points is from the supplied shell. A -1 will be returned for points which are outside the provided tolerance. Passed by reference. Returned to user.
Returns:
count - The number of points that were within the given tolerance to the shell.

Brief Index      Full Index      Events Index      I.M. Reference