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

Implicit function whose interior is a smoothly blended intersection of all input function interiors. More...

#include <EBGeometry_CSG.hpp>

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

Public Member Functions

 SmoothIntersectionIF ()=delete
 Disallowed, use the full constructor.
 
 SmoothIntersectionIF (const std::shared_ptr< ImplicitFunction< T > > &a_implicitFunctionA, const std::shared_ptr< ImplicitFunction< T > > &a_implicitFunctionB, const T a_smoothLen, const std::function< T(const T &a, const T &b, const T &s)> &a_smoothMax=SmoothMax< T >) noexcept
 Constructs the smooth intersection of two implicit functions.
 
 SmoothIntersectionIF (const std::vector< std::shared_ptr< ImplicitFunction< T > > > &a_implicitFunctions, const T a_smoothLen, const std::function< T(const T &a, const T &b, const T &s)> &a_smoothMax=SmoothMax< T >) noexcept
 Constructs the smooth intersection of a list of implicit functions.
 
 ~SmoothIntersectionIF () override=default
 Destructor.
 
value (const Vec3T< T > &a_point) const noexcept override
 Evaluates the smoothly blended signed distance at a_point.
 
- 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::vector< std::shared_ptr< const ImplicitFunction< T > > > m_implicitFunctions
 Stored implicit functions.
 
m_smoothLen
 Smoothing length.
 
std::function< T(const T &a, const T &b, const T &s)> m_smoothMax
 Smooth-maximum operator.
 

Detailed Description

template<class T>
class EBGeometry::SmoothIntersectionIF< T >

Implicit function whose interior is a smoothly blended intersection of all input function interiors.

Replaces the sharp max of IntersectionIF with a smooth-maximum operator, yielding a C1 (or better) interface at intersection boundaries. Only the two largest values are blended; the blend region width is controlled by m_smoothLen.

Template Parameters
TFloating-point precision.

Constructor & Destructor Documentation

◆ SmoothIntersectionIF() [1/2]

template<class T >
EBGeometry::SmoothIntersectionIF< T >::SmoothIntersectionIF ( const std::shared_ptr< ImplicitFunction< T > > &  a_implicitFunctionA,
const std::shared_ptr< ImplicitFunction< T > > &  a_implicitFunctionB,
const a_smoothLen,
const std::function< T(const T &a, const T &b, const T &s)> &  a_smoothMax = SmoothMax< T > 
)
noexcept

Constructs the smooth intersection of two implicit functions.

Parameters
[in]a_implicitFunctionAFirst implicit function (must not be null).
[in]a_implicitFunctionBSecond implicit function (must not be null).
[in]a_smoothLenSmoothing length (must be > 0).
[in]a_smoothMaxSmooth-maximum operator; defaults to SmoothMax<T>.

◆ SmoothIntersectionIF() [2/2]

template<class T >
EBGeometry::SmoothIntersectionIF< T >::SmoothIntersectionIF ( const std::vector< std::shared_ptr< ImplicitFunction< T > > > &  a_implicitFunctions,
const a_smoothLen,
const std::function< T(const T &a, const T &b, const T &s)> &  a_smoothMax = SmoothMax< T > 
)
noexcept

Constructs the smooth intersection of a list of implicit functions.

Parameters
[in]a_implicitFunctionsList of implicit functions (must be non-empty; no null entries).
[in]a_smoothLenSmoothing length (must be > 0).
[in]a_smoothMaxSmooth-maximum operator; defaults to SmoothMax<T>.

Member Function Documentation

◆ value()

template<class T >
T EBGeometry::SmoothIntersectionIF< T >::value ( const Vec3T< T > &  a_point) const
overridevirtualnoexcept

Evaluates the smoothly blended signed distance at a_point.

Finds the two largest function values and applies the stored smooth-maximum operator. Negative when inside the smooth intersection.

Parameters
[in]a_point3D query point.
Returns
Smooth maximum signed distance value.

Implements EBGeometry::ImplicitFunction< T >.


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