EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Attributes | List of all members
EBGeometry::FlatMeshSDF< T, Meta > Class Template Reference

Signed distance function for a DCEL mesh. Does not use BVHs. More...

#include <EBGeometry_MeshDistanceFunctions.hpp>

Inheritance diagram for EBGeometry::FlatMeshSDF< T, Meta >:
Inheritance graph
[legend]
Collaboration diagram for EBGeometry::FlatMeshSDF< T, Meta >:
Collaboration graph
[legend]

Public Types

using Mesh = EBGeometry::DCEL::MeshT< T, Meta >
 Alias for DCEL mesh type.
 

Public Member Functions

 FlatMeshSDF ()=delete
 Disallowed constructor.
 
 FlatMeshSDF (const std::shared_ptr< Mesh > &a_mesh) noexcept
 Full constructor.
 
 ~FlatMeshSDF () override=default
 Destructor.
 
 FlatMeshSDF (const FlatMeshSDF &a_other)=default
 Copy constructor.
 
FlatMeshSDFoperator= (const FlatMeshSDF &a_other)=default
 Copy assignment operator.
 
 FlatMeshSDF (FlatMeshSDF &&a_other) noexcept=default
 Move constructor.
 
FlatMeshSDFoperator= (FlatMeshSDF &&a_other) noexcept=default
 Move assignment operator.
 
signedDistance (const Vec3T< T > &a_point) const noexcept override
 Compute the signed distance from a_point to the mesh.
 
const std::shared_ptr< MeshgetMesh () const noexcept
 Get the underlying DCEL mesh.
 
template<class BV >
BV computeBoundingVolume () const
 Compute the axis-aligned bounding volume enclosing the mesh.
 
- Public Member Functions inherited from EBGeometry::SignedDistanceFunction< T >
 SignedDistanceFunction ()=default
 Default constructor.
 
 ~SignedDistanceFunction () override=default
 Destructor.
 
value (const Vec3T< T > &a_point) const noexcept final
 Implementation of ImplicitFunction::value; delegates to signedDistance().
 
virtual Vec3T< T > normal (const Vec3T< T > &a_point, const T &a_delta) const noexcept
 Compute the outward normal using central finite differences.
 
- Public Member Functions inherited from EBGeometry::ImplicitFunction< T >
 ImplicitFunction ()=default
 Default constructor.
 
virtual ~ImplicitFunction ()=default
 Default destructor.
 
operator() (const Vec3T< T > &a_point) const noexcept
 Call operator — 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
 Compute an approximation to the bounding volume for the implicit surface using octree subdivision.
 

Protected Attributes

std::shared_ptr< Meshm_mesh
 DCEL mesh.
 

Detailed Description

template<class T, class Meta = DCEL::DefaultMetaData>
class EBGeometry::FlatMeshSDF< T, Meta >

Signed distance function for a DCEL mesh. Does not use BVHs.

Iterates over every face of the mesh on every query — O(N) per call. Suitable only for very small meshes or debugging.

Template Parameters
TFloating-point precision type (float or double).
MetaTriangle metadata type stored on each DCEL face.

Constructor & Destructor Documentation

◆ FlatMeshSDF() [1/3]

template<class T , class Meta = DCEL::DefaultMetaData>
EBGeometry::FlatMeshSDF< T, Meta >::FlatMeshSDF ( const std::shared_ptr< Mesh > &  a_mesh)
noexcept

Full constructor.

Parameters
[in]a_meshInput mesh

◆ FlatMeshSDF() [2/3]

template<class T , class Meta = DCEL::DefaultMetaData>
EBGeometry::FlatMeshSDF< T, Meta >::FlatMeshSDF ( const FlatMeshSDF< T, Meta > &  a_other)
default

Copy constructor.

Explicitly defaulted for documentation purposes: FlatMeshSDF's only member (m_mesh) is a shared_ptr, so the implicitly-generated copy is a cheap, correct handle-copy.

Parameters
[in]a_otherOther instance to copy.

◆ FlatMeshSDF() [3/3]

template<class T , class Meta = DCEL::DefaultMetaData>
EBGeometry::FlatMeshSDF< T, Meta >::FlatMeshSDF ( FlatMeshSDF< T, Meta > &&  a_other)
defaultnoexcept

Move constructor.

Explicitly defaulted: the user-declared destructor above would otherwise suppress the implicitly-generated move constructor.

Parameters
[in,out]a_otherOther instance to move from.

Member Function Documentation

◆ computeBoundingVolume()

template<class T , class Meta = DCEL::DefaultMetaData>
template<class BV >
BV EBGeometry::FlatMeshSDF< T, Meta >::computeBoundingVolume ( ) const

Compute the axis-aligned bounding volume enclosing the mesh.

Template Parameters
BVBounding-volume type to construct (e.g. AABBT<T>).
Returns
Bounding volume that encloses all mesh vertices.

◆ getMesh()

template<class T , class Meta = DCEL::DefaultMetaData>
const std::shared_ptr< Mesh > EBGeometry::FlatMeshSDF< T, Meta >::getMesh ( ) const
noexcept

Get the underlying DCEL mesh.

Returns
Shared pointer to the mesh.

◆ operator=() [1/2]

template<class T , class Meta = DCEL::DefaultMetaData>
FlatMeshSDF & EBGeometry::FlatMeshSDF< T, Meta >::operator= ( const FlatMeshSDF< T, Meta > &  a_other)
default

Copy assignment operator.

Parameters
[in]a_otherOther instance to copy.
Returns
Reference to *this.

◆ operator=() [2/2]

template<class T , class Meta = DCEL::DefaultMetaData>
FlatMeshSDF & EBGeometry::FlatMeshSDF< T, Meta >::operator= ( FlatMeshSDF< T, Meta > &&  a_other)
defaultnoexcept

Move assignment operator.

Parameters
[in,out]a_otherOther instance to move from.
Returns
Reference to *this.

◆ signedDistance()

template<class T , class Meta = DCEL::DefaultMetaData>
T EBGeometry::FlatMeshSDF< T, Meta >::signedDistance ( const Vec3T< T > &  a_point) const
overridevirtualnoexcept

Compute the signed distance from a_point to the mesh.

Parameters
[in]a_pointQuery point.
Returns
Signed distance to the nearest face; negative inside the mesh.

Implements EBGeometry::SignedDistanceFunction< T >.


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