ray_mesh_intersect
ray_mesh_intersect(cam_pos, cam_dir, V, F)
Shoot a ray from a position and see where it crashes into a given mesh
Uses a bounding volume hierarchy to efficiently compute intersections of many different rays with a given mesh.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cam_pos |
numpy double array
|
Matrix of camera positions |
required |
cam_dir |
numpy double array
|
Matrix of camera directions |
required |
V |
(n,d) numpy array
|
vertex list of a triangle mesh |
required |
F |
(m,3) numpy int array
|
face index list of a triangle mesh |
required |
Returns:
Name | Type | Description |
---|---|---|
ts |
list of doubles
|
The i-th entry of this list is the time it takes a ray starting at the i-th camera position with the i-th camera direction to hit the surface (inf if no hit is detected) |
ids |
list of ints
|
The i-th entry is the index into F of the mesh element that the i-th ray hits (-1 if no hit is detected) |
lambdas |
numpy double array
|
The i-th row contains the barycentric coordinates of where in the triangle the ray hit (all zeros is no hit is detected) |
Examples:
TODO
Source code in src/gpytoolbox/ray_mesh_intersect.py
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|