11#ifndef EBGEOMETRY_MESHDISTANCEFUNCTIONS_HPP
12#define EBGEOMETRY_MESHDISTANCEFUNCTIONS_HPP
42template <
class T,
class Meta = DCEL::DefaultMetaData>
45 static_assert(std::is_floating_point_v<T>,
"FlatMeshSDF requires a floating-point T");
113 [[
nodiscard]]
const std::shared_ptr<Mesh>
151 static_assert(std::is_floating_point_v<T>,
"MeshSDF requires a floating-point T");
152 static_assert(K >= 2,
"MeshSDF requires branching factor K >= 2");
244 [[
nodiscard]]
virtual std::vector<std::pair<std::shared_ptr<const Face>, T>>
251 [[
nodiscard]]
virtual std::shared_ptr<Root>&
316 static_assert(std::is_floating_point_v<T>,
"TriMeshSDF<T,Meta,K,W> requires a floating-point T");
317 static_assert(K >= 2,
"TriMeshSDF requires branching factor K >= 2");
318 static_assert(
W > 0,
"TriMeshSDF requires SoA width W > 0");
349 T signedDistance = std::numeric_limits<T>::max();
452 [[
nodiscard]]
virtual std::shared_ptr<Root>&
493#include "EBGeometry_MeshDistanceFunctionsImplem.hpp"
Declaration of bounding volume hierarchy (BVH) classes.
Declarations of bounding volume types used in bounding volume hierarchies.
Declaration of a mesh class which stores a DCEL mesh (with signed distance functions)
Abstract base class for representing a signed distance function.
Declaration of a metadata-carrying wrapper around TriangleSoAT.
Declaration of SoA triangle group for SIMD signed-distance evaluation.
Declaration of a triangle class with signed distance functionality.
Declaration of 2D and 3D point/vector classes with templated precision. Used with DCEL tools.
Forward declaration of the linearised BVH. Needed so that TreeBVH::pack() and TreeBVH::packWith() can...
Definition EBGeometry_BVH.hpp:1264
Face class for navigating a DCEL mesh.
Definition EBGeometry_DCEL_Face.hpp:54
DCEL mesh class - stores a doubly-connected edge mesh.
Definition EBGeometry_DCEL_Mesh.hpp:50
Signed distance function for a DCEL mesh. Does not use BVHs.
Definition EBGeometry_MeshDistanceFunctions.hpp:44
FlatMeshSDF()=delete
Disallowed constructor.
FlatMeshSDF(const FlatMeshSDF &a_other)=default
Copy constructor.
FlatMeshSDF(FlatMeshSDF &&a_other) noexcept=default
Move constructor.
FlatMeshSDF & operator=(FlatMeshSDF &&a_other) noexcept=default
Move assignment operator.
~FlatMeshSDF() override=default
Destructor.
FlatMeshSDF & operator=(const FlatMeshSDF &a_other)=default
Copy assignment operator.
FlatMeshSDF(const std::shared_ptr< Mesh > &a_mesh) noexcept
Full constructor.
T signedDistance(const Vec3T< T > &a_point) const noexcept override
Compute the signed distance from a_point to the mesh.
const std::shared_ptr< Mesh > getMesh() const noexcept
Get the underlying DCEL mesh.
std::shared_ptr< Mesh > m_mesh
DCEL mesh.
Definition EBGeometry_MeshDistanceFunctions.hpp:129
BV computeBoundingVolume() const
Compute the axis-aligned bounding volume enclosing the mesh.
Signed distance function for a DCEL mesh. Stores the mesh in a PackedBVH for SIMD-accelerated travers...
Definition EBGeometry_MeshDistanceFunctions.hpp:150
typename EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition EBGeometry_MeshDistanceFunctions.hpp:163
MeshSDF(const std::shared_ptr< Mesh > &a_mesh, const BVH::Build a_build)
Full constructor. Takes the input mesh and creates the BVH.
MeshSDF(const MeshSDF &a_other)=default
Copy constructor.
T signedDistance(const Vec3T< T > &a_point) const noexcept override
Compute the signed distance from a_point to the mesh.
MeshSDF()=delete
Default disallowed constructor.
virtual std::vector< std::pair< std::shared_ptr< const Face >, T > > getClosestFaces(const Vec3T< T > &a_point, const bool a_sorted) const
Return faces within BVH-pruned candidate distance of a_point.
virtual std::shared_ptr< Root > & getRoot() noexcept
Get the PackedBVH enclosing the mesh.
typename EBGeometry::DCEL::FaceT< T, Meta > Face
Alias for DCEL face type.
Definition EBGeometry_MeshDistanceFunctions.hpp:158
typename Root::Node Node
Alias for a single linearized node.
Definition EBGeometry_MeshDistanceFunctions.hpp:173
~MeshSDF() override=default
Destructor.
MeshSDF & operator=(MeshSDF &&a_other) noexcept=default
Move assignment operator.
MeshSDF(MeshSDF &&a_other) noexcept=default
Move constructor.
MeshSDF & operator=(const MeshSDF &a_other)=default
Copy assignment operator.
Abstract representation of a signed distance function.
Definition EBGeometry_SignedDistanceFunction.hpp:34
Signed distance function for a pure triangle mesh using SoA-grouped primitives in a compact (lineariz...
Definition EBGeometry_MeshDistanceFunctions.hpp:315
typename EBGeometry::BVH::PackedBVH< T, TriAoSoA, K, StoragePolicy > Root
Alias for which BVH root node.
Definition EBGeometry_MeshDistanceFunctions.hpp:339
TriMeshSDF(const std::shared_ptr< Mesh > &a_mesh, const BVH::Build a_build, const size_t a_maxLeafGroups) noexcept
Full constructor. Takes a DCEL mesh and creates the input triangles. Then creates the BVH.
TriMeshSDF(const TriMeshSDF &a_other)=default
Copy constructor.
ClosestTriangle getClosestTriangle(const Vec3T< T > &a_point) const noexcept
Signed distance to the closest triangle, together with that triangle's metadata.
TriMeshSDF & operator=(TriMeshSDF &&a_other) noexcept=default
Move assignment operator.
TriMeshSDF()=delete
Default disallowed constructor.
typename EBGeometry::Triangle< T, Meta > Tri
Alias for DCEL face type.
Definition EBGeometry_MeshDistanceFunctions.hpp:329
TriMeshSDF & operator=(const TriMeshSDF &a_other)=default
Copy assignment operator.
T signedDistance(const Vec3T< T > &a_point) const noexcept override
Compute the signed distance from a_point to the triangle mesh.
TriMeshSDF(const std::vector< std::shared_ptr< Tri > > &a_triangles, const BVH::Build a_build, const size_t a_maxLeafGroups) noexcept
Full constructor. Takes the input triangles and creates the BVH.
~TriMeshSDF() override=default
Destructor.
TriMeshSDF(TriMeshSDF &&a_other) noexcept=default
Move constructor.
virtual std::shared_ptr< Root > & getRoot() noexcept
Get the PackedBVH storing SoA triangle groups.
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:225
Build
Enum for specifying the BVH construction strategy.
Definition EBGeometry_BVH.hpp:48
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_AnalyticDistanceFunctions.hpp:31
Compact BVH node stored in the flat node array.
Definition EBGeometry_BVH.hpp:1288
Result of getClosestTriangle(): the signed distance to the closest triangle and that triangle's metad...
Definition EBGeometry_MeshDistanceFunctions.hpp:348
Metadata-carrying wrapper around a single TriangleSoAT<T, W>.
Definition EBGeometry_TriangleAoSoA.hpp:52