11#ifndef EBGEOMETRY_MESHDISTANCEFUNCTIONS_HPP
12#define EBGEOMETRY_MESHDISTANCEFUNCTIONS_HPP
40template <
class T,
class Meta = DCEL::DefaultMetaData>
43 static_assert(std::is_floating_point_v<T>,
"FlatMeshSDF requires a floating-point T");
111 [[
nodiscard]]
const std::shared_ptr<Mesh>
149 static_assert(std::is_floating_point_v<T>,
"MeshSDF requires a floating-point T");
150 static_assert(K >= 2,
"MeshSDF requires branching factor K >= 2");
242 [[
nodiscard]]
virtual std::vector<std::pair<std::shared_ptr<const Face>, T>>
249 [[
nodiscard]]
virtual std::shared_ptr<Root>&
310 static_assert(std::is_floating_point_v<T>,
"TriMeshSDF<T,Meta,K,W> requires a floating-point T");
311 static_assert(K >= 2,
"TriMeshSDF requires branching factor K >= 2");
312 static_assert(
W > 0,
"TriMeshSDF requires SoA width W > 0");
420 [[
nodiscard]]
virtual std::shared_ptr<Root>&
461#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 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:1238
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:42
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:127
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:148
typename EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition EBGeometry_MeshDistanceFunctions.hpp:161
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:156
typename Root::Node Node
Alias for a single linearized node.
Definition EBGeometry_MeshDistanceFunctions.hpp:171
~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:309
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.
typename EBGeometry::BVH::PackedBVH< T, TriSoA, K, StoragePolicy > Root
Alias for which BVH root node.
Definition EBGeometry_MeshDistanceFunctions.hpp:333
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:323
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:1262
SoA (Structure of Arrays) layout for W triangles, enabling SIMD evaluation.
Definition EBGeometry_TriangleSoA.hpp:101