Ray Tracing
Functions Introduced:
The function
ProSolidRayIntersectionCompute() finds the intersections between a ray and a solid.
The ray is defined in terms of a start location and direction vector. The intersections are described in terms of an array of ProSelection objects to show their context in an assembly.
The function finds intersections in both directions from the start point of the ray, and assigns each intersection a depth—the distance from the ray start point in the direction defined (intersections in the reverse direction have a negative depth). You can extract the depth of each intersection using the function
ProSelectionDepthGet(). The intersections are ordered from the most negative depth to the most positive.
The function processes all solid surfaces and datum surfaces, but not datum planes. It also includes edges that lie within a certain critical distance, called the aperture radius, of the ray. Such an edge is shown as intersected, even if a neighboring surface is also intersected. This implies that several entries in the array may represent a single “piercing,” in geometrical terms.
The aperture radius is an optional input to the function, defined in terms of pixels. If you supply a value less than –1.0, the value is taken from the Creo Parametric configuration file option pick_aperture_radius. If that option is not set, the function uses the default value of 7.0.
In an assembly, each component is processed separately, so if two coincident mating faces are hit, the function records two separate intersections.
Surfaces and edges that are not displayed because they are assigned to a blanked layer are not intersected.
This function is most often used in optical analysis, when calculating the path of a ray of light through an assembly whose parts represent lenses or mirrors. In this case, you want to find the closest intersecting surface in the positive direction, then calculate the normal to the surface at that point, in assembly coordinates.