The ray forms (see RayForm) of the mesh SDFs. TriMeshSDF: its BVH walked along the ray (PackedBVH::traverse() with BVH::RayQuery), and its triangles crossed exactly (TriangleRay::crossing()). MeshSDF: the same walk, its polygon faces crossed exactly (DCEL::FaceT::rayCrossing()). FlatMeshSDF: every face, without a BVH. With this header included, firstHit() and intersects() on a mesh SDF are exact instead of marched, and so are compositions of mesh SDFs (see EBGeometry_CSGRayForms.hpp), through spans(): the crossings along the ray, nearest first, paired into spans by the side of the face the ray crosses from. A closed mesh is needed for the spans to mean inside and outside.
More...
#include <cstddef>
#include <cstdint>
#include "EBGeometry_MeshDistanceFunctions.hpp"
#include "EBGeometry_Ray.hpp"
Go to the source code of this file.
|
| struct | EBGeometry::RayForm< TriMeshSDF< T, K, W > > |
| | TriMeshSDF's ray form: the nearest triangle the ray crosses, found by walking the BVH nearest box first and stopping at boxes farther than the nearest crossing so far. Exact, and callable on a device. More...
|
| |
| struct | EBGeometry::RayForm< MeshSDF< T, K > > |
| | MeshSDF's ray form: the nearest polygon face the ray crosses, found by walking the BVH nearest box first and stopping at boxes farther than the nearest crossing so far. Exact, and callable on a device. More...
|
| |
| struct | EBGeometry::RayForm< FlatMeshSDF< T > > |
| | FlatMeshSDF's ray form: every face tested, as FlatMeshSDF's signed distance tests every face (no BVH). Exact, and callable on a device; as for MeshSDF otherwise. More...
|
| |
| struct | EBGeometry::RayDetail::NearestCrossings< T > |
| | The nearest crossings of a mesh along a ray, in order, as a BVH walk finds them: at most Capacity, enough for the spans a list holds and one more. More...
|
| |
| struct | EBGeometry::RayDetail::NearestCrossings< T >::Crossing |
| | A crossing. More...
|
| |
The ray forms (see RayForm) of the mesh SDFs. TriMeshSDF: its BVH walked along the ray (PackedBVH::traverse() with BVH::RayQuery), and its triangles crossed exactly (TriangleRay::crossing()). MeshSDF: the same walk, its polygon faces crossed exactly (DCEL::FaceT::rayCrossing()). FlatMeshSDF: every face, without a BVH. With this header included, firstHit() and intersects() on a mesh SDF are exact instead of marched, and so are compositions of mesh SDFs (see EBGeometry_CSGRayForms.hpp), through spans(): the crossings along the ray, nearest first, paired into spans by the side of the face the ray crosses from. A closed mesh is needed for the spans to mean inside and outside.
- Author
- Robert Marskar
◆ faceHit()
template<class T >
| HitT< T > EBGeometry::RayDetail::faceHit |
( |
const RayT< T > & |
a_ray, |
|
|
const T |
a_t, |
|
|
const uint32_t |
a_face, |
|
|
const Vec3T< T > & |
a_normal |
|
) |
| |
|
inlinenoexcept |
A crossing of a mesh face as a HitT.
Internal helper; not part of the public API.
- Template Parameters
-
| T | Floating-point precision. |
- Parameters
-
| [in] | a_ray | Ray. |
| [in] | a_t | Distance along the ray, or +infinity for none. |
| [in] | a_face | The face's id. |
| [in] | a_normal | The face's outward unit normal. |
- Returns
- The hit, or a miss.