EBGeometry 1.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
FastTriMeshSDF< T, Meta, BV, K > Class Template Reference

Signed distance function for a triangle mesh. This class uses the full BVH representation. More...

#include <EBGeometry_MeshDistanceFunctions.hpp>

Inheritance diagram for FastTriMeshSDF< T, Meta, BV, K >:
Inheritance graph
[legend]
Collaboration diagram for FastTriMeshSDF< T, Meta, BV, K >:
Collaboration graph
[legend]

Public Types

using Mesh = EBGeometry::DCEL::MeshT< T, Meta >
 Alias for DCEL mesh type.
 
using Tri = typename EBGeometry::Triangle< T, Meta >
 Alias for DCEL face type.
 
using Root = typename EBGeometry::BVH::LinearBVH< T, Tri, BV, K >
 Alias for which BVH root node.
 
using Node = typename Root::LinearNode
 Alias for linearized BVH.
 

Public Member Functions

 FastTriMeshSDF ()=delete
 Default disallowed constructor.
 
 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.
 
 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.
 
virtual ~FastTriMeshSDF ()=default
 Destructor.
 
virtual T signedDistance (const Vec3T< T > &a_point) const noexcept override
 Value function.
 
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 std::shared_ptr< Root > & getRoot () noexcept
 Get the bounding volume hierarchy enclosing the mesh.
 
virtual const std::shared_ptr< Root > & getRoot () const noexcept
 Get the bounding volume hierarchy enclosing the mesh.
 
BV computeBoundingVolume () const noexcept
 Compute bounding volume for this mesh.
 
- Public Member Functions inherited from SignedDistanceFunction< T >
 SignedDistanceFunction ()=default
 Disallowed, use the full constructor.
 
virtual ~SignedDistanceFunction ()=default
 Destructor (does nothing)
 
virtual T value (const Vec3T< T > &a_point) const noexcept override final
 Implementation of ImplicitFunction::value.
 
virtual Vec3T< Tnormal (const Vec3T< T > &a_point, const T &a_delta) const noexcept
 Signed distance normal vector.
 
- Public Member Functions inherited from ImplicitFunction< T >
 ImplicitFunction ()=default
 Disallowed, use the full constructor.
 
virtual ~ImplicitFunction ()=default
 Destructor (does nothing)
 
T operator() (const Vec3T< T > &a_point) const noexcept
 Alternative signature for the value function.
 
template<class BV >
BV approximateBoundingVolumeOctree (const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=0.0) const noexcept
 Compute an approximation to the bounding volume for the implicit surface, using octrees.
 

Protected Attributes

std::shared_ptr< Rootm_bvh
 Bounding volume hierarchy.
 

Detailed Description

template<class T, class Meta, class BV, size_t K>
class FastTriMeshSDF< T, Meta, BV, K >

Signed distance function for a triangle mesh. This class uses the full BVH representation.

Constructor & Destructor Documentation

◆ FastTriMeshSDF() [1/2]

template<class T , class Meta , class BV , size_t K>
FastTriMeshSDF< T, Meta, BV, K >::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.

Parameters
[in]a_meshDCEL mesh
[in]a_buildSpecification of build method. Must be TopDown, Morton, or Nested.

◆ FastTriMeshSDF() [2/2]

template<class T , class Meta , class BV , size_t K>
FastTriMeshSDF< T, Meta, BV, K >::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.

Parameters
[in]a_trianglesInput triangle soup
[in]a_buildSpecification of build method. Must be TopDown, Morton, or Nested.

Member Function Documentation

◆ getClosestTriangles()

template<class T , class Meta , class BV , size_t K>
virtual std::vector< std::pair< std::shared_ptr< const Tri >, T > > FastTriMeshSDF< T, Meta, BV, K >::getClosestTriangles ( const Vec3T< T > &  a_point,
const bool  a_sorted 
) const
virtualnoexcept

Get the closest triangles to the input point.

This returns a list of candidate triangles that are close to the input point. The returned argment consists of the triangles and the unsigned distance to the triangles.

Parameters
[in]a_pointInput point
[in]a_sortedSort the output vector by distance or not. Closest go first.
Returns
List of candidate triangles (potentially sorted)

◆ signedDistance()

template<class T , class Meta , class BV , size_t K>
virtual T FastTriMeshSDF< T, Meta, BV, K >::signedDistance ( const Vec3T< T > &  a_point) const
overridevirtualnoexcept

Value function.

Parameters
[in]a_pointInput point.

Implements SignedDistanceFunction< T >.


The documentation for this class was generated from the following file: