HC_Compute_Intersect_Polyline
-
int
HC_Compute_Intersect_Polyline(int pcount1, Point const points1[], int flist_length1, int const face_list1[], int pcount2, Point const points2[], int flist_length2, int const face_list2[], int *polyline_count, int polyline_lengths[], int *polyline_points_count, Point polyline_points[]) - int HC_Compute_Intersect_Polyline(int pcount1, Point const points1, int flist_length1, int const face_list1, int pcount2, Point const points2, int flist_length2, int const face_list2, int polyline_count, int polyline_lengths, int polyline_points_count, 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.
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 reference, it is strongly recommended that Show_Intersect_Polyline_Size() be called first to know how much memory to allocate.
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.
HC_Compute_Selection, HC_Show_Geometry_Pointer, HC_Show_Shell, HC_Compute_Transformed_Points, HC_PShow_Net_Modelling_Matrix.Parameters
pcount1: the number of points in the first shell
points1: the points array for the first shell
flist_length1: 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()
- the number of points in the second shell
pcount2:
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