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::ImplicitFunction< T > Class Template Referenceabstract

Abstract representation of an implicit function (not necessarily a signed distance function). More...

#include <EBGeometry_ImplicitFunction.hpp>

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

Public Member Functions

 ImplicitFunction ()=default
 Default constructor.
 
virtual ~ImplicitFunction ()=default
 Default destructor.
 
virtualvalue (const Vec3T< T > &a_point) const noexcept=0
 Value function. Points are outside the object if value > 0.0 and inside if value < 0.0.
 
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::ImplicitFunction< T >

Abstract representation of an implicit function (not necessarily a signed distance function).

The value function must be implemented by subclasses. Points with value < 0 are considered inside the object; points with value > 0 are outside.

Template Parameters
TFloating-point precision.

Member Function Documentation

◆ approximateBoundingVolumeOctree()

template<class T >
template<class BV >
BV EBGeometry::ImplicitFunction< T >::approximateBoundingVolumeOctree ( const Vec3T< T > &  a_initialLowCorner,
const Vec3T< T > &  a_initialHighCorner,
const unsigned int  a_maxTreeDepth,
const T &  a_safety = 0.0 
) const
inline

Compute an approximation to the bounding volume for the implicit surface using octree subdivision.

Recursively subdivides the initial box and marks each child cell as intersected when |value(center)| <= (1+a_safety)*half_width. The bounding volume is built from the corners of all intersected leaf cells. Relies on the implicit function being reasonably close to a signed distance function; if octree subdivision fails entirely, returns the maximally representable bounding volume.

Template Parameters
BVBounding volume type; must be constructible from std::vector<Vec3T<T>>.
Parameters
[in]a_initialLowCornerLow corner of the initial search box.
[in]a_initialHighCornerHigh corner of the initial search box.
[in]a_maxTreeDepthMaximum permitted octree depth.
[in]a_safetySafety factor for intersection test; 0 = exact, 1 = 1x cell-width margin.
Returns
Bounding volume enclosing the approximate zero-isosurface region.

◆ operator()()

template<class T >
T EBGeometry::ImplicitFunction< T >::operator() ( const Vec3T< T > &  a_point) const
noexcept

Call operator — alternative signature for the value function.

Parameters
[in]a_point3D query point.
Returns
Implicit function value at a_point (delegates to value()).

◆ value()

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

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