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

Abstract representation of a signed distance function. More...

#include <EBGeometry_SignedDistanceFunction.hpp>

Inheritance diagram for EBGeometry::SignedDistanceFunction< T >:
Inheritance graph
[legend]
Collaboration diagram for EBGeometry::SignedDistanceFunction< T >:
Collaboration graph
[legend]

Public Member Functions

 SignedDistanceFunction ()=default
 Default constructor.
 
 ~SignedDistanceFunction () override=default
 Destructor.
 
value (const Vec3T< T > &a_point) const noexcept final
 Implementation of ImplicitFunction::value; delegates to signedDistance().
 
virtualsignedDistance (const Vec3T< T > &a_point) const noexcept=0
 Pure virtual signed distance function to be implemented by subclasses.
 
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.
 

Detailed Description

template<class T>
class EBGeometry::SignedDistanceFunction< T >

Abstract representation of a signed distance function.

Users can put whatever they like in here, e.g. analytic functions, DCEL meshes, or DCEL meshes stored in a full TreeBVH or a PackedBVH. The signedDistance function must be implemented by the user. When computing it, the user can apply transformation operators (rotations, scaling, translations) by calling transformPoint on the input coordinate.

Template Parameters
TFloating-point precision.

Member Function Documentation

◆ normal()

template<class T >
virtual Vec3T< T > EBGeometry::SignedDistanceFunction< T >::normal ( const Vec3T< T > &  a_point,
const T &  a_delta 
) const
inlinevirtualnoexcept

Compute the outward normal using central finite differences.

Approximates the gradient of the signed distance function at a_point using step size a_delta, then normalizes the result.

Parameters
[in]a_point3D query point.
[in]a_deltaFinite-difference step size. Must be strictly positive.
Returns
Outward unit normal vector at a_point. Undefined if the finite-difference gradient is exactly zero (e.g. a_point sits on a local extremum of signedDistance).

◆ signedDistance()

template<class T >
virtual T EBGeometry::SignedDistanceFunction< T >::signedDistance ( const Vec3T< T > &  a_point) const
pure virtualnoexcept

◆ value()

template<class T >
T EBGeometry::SignedDistanceFunction< T >::value ( const Vec3T< T > &  a_point) const
finalvirtualnoexcept

Implementation of ImplicitFunction::value; delegates to signedDistance().

Parameters
[in]a_point3D query point.
Returns
Signed distance at a_point.

Implements EBGeometry::ImplicitFunction< T >.


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