12#ifndef EBGeometry_MeshDistanceFunctions
13#define EBGeometry_MeshDistanceFunctions
31 template <
class T,
class Meta,
class BV,
size_t K>
32 std::shared_ptr<EBGeometry::BVH::NodeT<T, FaceT<T, Meta>,
BV,
K>>
40template <
class T,
class Meta = DCEL::DefaultMetaData>
47 using Mesh = EBGeometry::DCEL::MeshT<T, Meta>;
74 const std::shared_ptr<Mesh>
101 using Face =
typename EBGeometry::DCEL::FaceT<T, Meta>;
106 using Mesh =
typename EBGeometry::DCEL::MeshT<T, Meta>;
111 using Node = EBGeometry::BVH::NodeT<T, Face, BV, K>;
145 virtual std::vector<std::pair<std::shared_ptr<const Face>,
T>>
151 virtual std::shared_ptr<Node>&
183 using Face =
typename EBGeometry::DCEL::FaceT<T, Meta>;
188 using Mesh =
typename EBGeometry::DCEL::MeshT<T, Meta>;
193 using Root =
typename EBGeometry::BVH::LinearBVH<T, Face, BV, K>;
198 using Node =
typename Root::LinearNode;
232 virtual std::vector<std::pair<std::shared_ptr<const Face>,
T>>
238 virtual std::shared_ptr<Root>&
270 using Mesh = EBGeometry::DCEL::MeshT<T, Meta>;
280 using Root =
typename EBGeometry::BVH::LinearBVH<T, Tri, BV, K>;
285 using Node =
typename Root::LinearNode;
327 virtual std::vector<std::pair<std::shared_ptr<const Tri>,
T>>
333 virtual std::shared_ptr<Root>&
355#include "EBGeometry_NamespaceFooter.hpp"
357#include "EBGeometry_MeshDistanceFunctionsImplem.hpp"
Declaration of a bounding volume hierarchy (BVH) class.
Declaration of a various bounding volumes used for bounding volume hierarchy.
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 triangle class with signed distance functionality.
Triangle class with signed distance functionality.
Definition EBGeometry_Triangle.hpp:49
Signed distance function for a DCEL mesh. This class uses the compact BVH representation.
Definition EBGeometry_MeshDistanceFunctions.hpp:178
FastCompactMeshSDF()=delete
Default disallowed constructor.
virtual ~FastCompactMeshSDF()=default
Destructor.
typename EBGeometry::BVH::LinearBVH< T, Face, BV, K > Root
Alias for which BVH root node.
Definition EBGeometry_MeshDistanceFunctions.hpp:193
FastCompactMeshSDF(const std::shared_ptr< Mesh > &a_mesh, const BVH::Build a_build=BVH::Build::TopDown) noexcept
Full constructor. Takes the input mesh and creates the BVH.
typename Root::LinearNode Node
Alias for linearized BVH.
Definition EBGeometry_MeshDistanceFunctions.hpp:198
virtual std::vector< std::pair< std::shared_ptr< const Face >, T > > getClosestFaces(const Vec3T< T > &a_point, const bool a_sorted) const noexcept
Get the closest faces to the input point.
virtual std::shared_ptr< Root > & getRoot() noexcept
Get the bounding volume hierarchy enclosing the mesh.
typename EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition EBGeometry_MeshDistanceFunctions.hpp:188
typename EBGeometry::DCEL::FaceT< T, Meta > Face
Alias for DCEL face type.
Definition EBGeometry_MeshDistanceFunctions.hpp:183
virtual T signedDistance(const Vec3T< T > &a_point) const noexcept override
Value function.
Signed distance function for a DCEL mesh. This class uses the full BVH representation.
Definition EBGeometry_MeshDistanceFunctions.hpp:96
EBGeometry::BVH::NodeT< T, Face, BV, K > Node
Alias for BVH root node.
Definition EBGeometry_MeshDistanceFunctions.hpp:111
virtual std::vector< std::pair< std::shared_ptr< const Face >, T > > getClosestFaces(const Vec3T< T > &a_point, const bool a_sorted) const noexcept
Get the closest faces to the input point.
FastMeshSDF(const std::shared_ptr< Mesh > &a_mesh, const BVH::Build a_build=BVH::Build::TopDown) noexcept
Full constructor. Takes the input mesh and creates the BVH.
FastMeshSDF()=delete
Default disallowed constructor.
virtual ~FastMeshSDF()=default
Destructor.
typename EBGeometry::DCEL::FaceT< T, Meta > Face
Alias for DCEL face type.
Definition EBGeometry_MeshDistanceFunctions.hpp:101
virtual std::shared_ptr< Node > & getBVH() noexcept
Get the bounding volume hierarchy enclosing the mesh.
virtual T signedDistance(const Vec3T< T > &a_point) const noexcept override
Value function.
typename EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition EBGeometry_MeshDistanceFunctions.hpp:106
Signed distance function for a triangle mesh. This class uses the full BVH representation.
Definition EBGeometry_MeshDistanceFunctions.hpp:265
virtual std::vector< std::pair< std::shared_ptr< const Tri >, T > > getClosestTriangles(const Vec3T< T > &a_point, const bool a_sorted) const noexcept
Get the closest triangles to the input point.
virtual ~FastTriMeshSDF()=default
Destructor.
EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition EBGeometry_MeshDistanceFunctions.hpp:270
virtual std::shared_ptr< Root > & getRoot() noexcept
Get the bounding volume hierarchy enclosing the mesh.
FastTriMeshSDF(const std::vector< std::shared_ptr< Tri > > &a_triangles, const BVH::Build a_build=BVH::Build::TopDown) noexcept
Full constructor. Takes the input triangles and creates the BVH.
FastTriMeshSDF()=delete
Default disallowed constructor.
typename EBGeometry::BVH::LinearBVH< T, Tri, BV, K > Root
Alias for which BVH root node.
Definition EBGeometry_MeshDistanceFunctions.hpp:280
FastTriMeshSDF(const std::shared_ptr< Mesh > &a_mesh, const BVH::Build a_build=BVH::Build::TopDown) noexcept
Full constructor. Takes a DCEL mesh and creates the input triangles. Then creates the BVH.
virtual T signedDistance(const Vec3T< T > &a_point) const noexcept override
Value function.
typename EBGeometry::Triangle< T, Meta > Tri
Alias for DCEL face type.
Definition EBGeometry_MeshDistanceFunctions.hpp:275
typename Root::LinearNode Node
Alias for linearized BVH.
Definition EBGeometry_MeshDistanceFunctions.hpp:285
Signed distance function for a DCEL mesh. Does not use BVHs.
Definition EBGeometry_MeshDistanceFunctions.hpp:42
std::shared_ptr< Mesh > m_mesh
DCEL mesh.
Definition EBGeometry_MeshDistanceFunctions.hpp:88
virtual T signedDistance(const Vec3T< T > &a_point) const noexcept override
Value function.
MeshSDF(const std::shared_ptr< Mesh > &a_mesh) noexcept
Full constructor.
MeshSDF()=delete
Disallowed constructor.
EBGeometry::DCEL::MeshT< T, Meta > Mesh
Alias for DCEL mesh type.
Definition EBGeometry_MeshDistanceFunctions.hpp:47
virtual ~MeshSDF()=default
Destructor.
const std::shared_ptr< Mesh > getMesh() const noexcept
Get the surface mesh.
BV computeBoundingVolume() const noexcept
Compute bounding volume for this mesh.
Abstract representation of a signed distance function.
Definition EBGeometry_SignedDistanceFunction.hpp:32
Three-dimensional vector class with arithmetic operators.
Definition EBGeometry_Vec.hpp:218
Build
Enum for specifying whether or not the construction is top-down or bottom-up.
Definition EBGeometry_BVH.hpp:36
Namespace containing various double-connected edge list (DCEL) functionality.
std::shared_ptr< EBGeometry::BVH::NodeT< T, FaceT< T, Meta >, BV, K > > buildFullBVH(const std::shared_ptr< EBGeometry::DCEL::MeshT< T, Meta > > &a_dcelMesh, const BVH::Build a_build=BVH::Build::TopDown) noexcept
One-liner for turning a DCEL mesh into a full-tree BVH.