Functions | |
int | Compute_Intersect_Polyline (int pcount1, const HC_POINT *points1, int flist_length3, const int *face_list1, int pcount2, const HC_POINT *points2, int flist_length2, const int *face_list2, int *polyline_count, int *polyline_lengths, int *polyline_points_count, HC_POINT *polyline_points) |
Calculates the polyline of intersection between the faces of one shell and those of another. If the two shells do not exist, this function returns false. More... | |
int | DCompute_Intersect_Polyline (int pcount1, const HC_POINT *points1, int flist_length3, const int *face_list1, int pcount2, const HC_POINT *points2, int flist_length2, const int *face_list2, int *polyline_count, int *polyline_lengths, int *polyline_points_count, HC_POINT *polyline_points) |
Similar to Compute_Intersect_Polyline(), but operates on double-precision data. More... | |
int | Show_Intersect_Polyline_Size (int pcount1, const HC_POINT *points1, int flist_length3, const int *face_list1, int pcount2, const HC_POINT *points2, int flist_length2, const int *face_list2, int *polyline_count, int *polyline_points_count) |
Finds the size of the intersecting polyline. This is useful for determining the size of a data structure needed to store the polyline returned by Compute_Intersect_Polyline(). More... | |
Detailed Description
Function Documentation
◆ Compute_Intersect_Polyline()
int Compute_Intersect_Polyline | ( | int | pcount1, |
const HC_POINT * | points1, | ||
int | flist_length3, | ||
const int * | face_list1, | ||
int | pcount2, | ||
const HC_POINT * | points2, | ||
int | flist_length2, | ||
const int * | face_list2, | ||
int * | polyline_count, | ||
int * | polyline_lengths, | ||
int * | polyline_points_count, | ||
HC_POINT * | polyline_points | ||
) |
Calculates the polyline of intersection between the faces of one shell and those of another. If the two shells do not exist, this function returns false.
- Parameters
-
pcount1 - the number of points in the first shell points1 - the points array for the first shell flist_length3 - the length of the face lists for the first shell face_list1 - The face lists of the first shell, in the same coded format as defined in the documentation for Insert_Shell() pcount2 - the number of points in the second shell points2 - the points array for the second shell flist_length2 - the length of the face lists for the second shell face_list2 - The face lists of the second shell polyline_count - The number of distinct polylines along which the shells intersect. Passed by reference always. Returned to user. polyline_lengths - Array contains polyline_count entries. For each polyline, the corresponding value in this array specifies its length. Passed by reference always. Returned to user. polyline_points_count - The total number of points in all polylines. Passed by reference always. Returned to user. polyline_points - Vector of x-y-z triplets for the coordinates along the polylines. Passed by reference always. Returned to user.
- Returns
- found
DETAILS
This function takes two shells (as defined by the point clouds and face lists by which they would be inserted), and returns to the user a list of polylines along which they intersect. The calculation takes the lines along which any of the first shell's faces intersect with any of the second's, and merges them into as few polylines as possible.
The list of polylines is designated with two arrays. The first, an array of integers, specifies the length of each polyline. The second, an array of x-y-z triplets, is the combined array of vertices. Each of these two arrays has an associated length.
For example, two squares might be represented as the following (not that we'd typically expect a polyline of intersection to look like this):
-
polyline_count = 2
-
polyline_lengths = {5, 5}
-
polyline_points_count = 10
-
polyline_points = { { 0, 0, 0 }, { 0, 1, 0 }, { 1, 1, 0 }, { 1, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0,-1, 0 }, { -1,-1, 0 }, { -1, 0, 0 }, { 0, 0, 0 } }
Since both polyline_lengths and polyline_points are arrays that are copied into user supplied calls by refeference, it is strongly recommended that Show_Intersect_Polyline_Size() be called first to know how much memory to allocate.
NOTES
Holes in faces (a.k.a negative faces) are not (at least not yet) supported, nor are concave faces. This operation is defined for shells only (e.g. no NURBS surfaces, polycylinders or meshes).
polyline_points_count will always be equal to the sum of all entries in polyline_lengths.
This function is by nature expensive, and so should be used sparingly. Additionally, Compute_Selection_By_Shell() should be used to first figure out if the two shells do in fact collide. Since the intersect polyline size cannot be known until after the polyline has been calculated, Show_Intersect_Polyline_Size() (if used, that is) ends up doing the real work. It caches its results, however, in anticipation of a Compute_Intersect_Polyline() call. The result is that Show_Intersect_Polyline_Size() followed by Compute_Intersect_Polyline() costs very little additional computation relative to a simple Compute_Intersect_Polyline() .
If the two shells in question have also been inserted into HOOPS, Show_Geometry_Pointer() can in avoid copying of arrays that would otherwise be required by Show_Shell.
RESTRICTIONS
◆ DCompute_Intersect_Polyline()
void DCompute_Intersect_Polyline | ( | int | pcount1, |
const HC_POINT * | points1, | ||
int | flist_length3, | ||
const int * | face_list1, | ||
int | pcount2, | ||
const HC_POINT * | points2, | ||
int | flist_length2, | ||
const int * | face_list2, | ||
int * | polyline_count, | ||
int * | polyline_lengths, | ||
int * | polyline_points_count, | ||
HC_POINT * | polyline_point | ||
) |
Similar to Compute_Intersect_Polyline(), but operates on double-precision data.
- Parameters
-
pcount1 - the number of points in the first shell points1 - the points array for the first shell flist_length3 - the length of the face lists for the first shell face_list1 - The face lists of the first shell, in the same coded format as defined in the documentation for Insert_Shell() pcount2 - the number of points in the second shell points2 - the points array for the second shell flist_length2 - the length of the face lists for the second shell face_list2 - The face lists of the second shell polyline_count - The number of distinct polylines along which the shells intersect. Passed by reference always. Returned to user. polyline_lengths - Array contains polyline_count entries. For each polyline, the corresponding value in this array specifies its length. Passed by reference always. Returned to user. polyline_points_count - The total number of points in all polylines. Passed by reference always. Returned to user. polyline_points - Vector of x-y-z triplets for the coordinates along the polylines. Passed by reference always. Returned to user.
- Returns
- found
◆ Show_Intersect_Polyline_Size()
int Show_Intersect_Polyline_Size | ( | int | pcount1, |
const HC_POINT * | points1, | ||
int | flist_length3, | ||
const int * | face_list1, | ||
int | pcount2, | ||
const HC_POINT * | points2, | ||
int | flist_length2, | ||
const int * | face_list2, | ||
int * | polyline_count, | ||
int * | polyline_points_count | ||
) |
Finds the size of the intersecting polyline. This is useful for determining the size of a data structure needed to store the polyline returned by Compute_Intersect_Polyline().
- Parameters
-
pcount1 - the number of points in the first shell points1 - the points array for the first shell flist_length3 - the length of the face lists for the first shell face_list1 - The face lists of the first shell, in the same coded format as defined in the documentation for Insert_Shell() pcount2 - the number of points in the second shell points2 - the points array for the second shell flist_length2 - the length of the face lists for the second shell face_list2 - The face lists of the second shell polyline_count - The number of distinct polylines along which the shells intersect. Passed by reference always. Returned to user. polyline_points_count - The total number of points in all polylines. Passed by reference always. Returned to user.
- Returns
- found
DETAILS
No additional details. See Compute_Intersect_Polyline()