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::SmoothDifferenceIF< T > Class Template Reference

Implicit function representing a smoothly blended set difference A \ B. More...

#include <EBGeometry_CSG.hpp>

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

Public Member Functions

 SmoothDifferenceIF ()=delete
 Disallowed, use the full constructor.
 
 SmoothDifferenceIF (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 difference A \ B from two implicit functions.
 
 SmoothDifferenceIF (const std::shared_ptr< ImplicitFunction< T > > &a_implicitFunctionA, const std::vector< std::shared_ptr< ImplicitFunction< T > > > &a_implicitFunctionsB, 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 difference A \ union(Bs) from A and a list of subtrahends.
 
 ~SmoothDifferenceIF () 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::shared_ptr< SmoothIntersectionIF< T > > m_smoothIntersectionIF
 Internal smooth intersection implementing smooth(A ∩ complement(B)).
 

Detailed Description

template<class T>
class EBGeometry::SmoothDifferenceIF< T >

Implicit function representing a smoothly blended set difference A \ B.

Implemented as a smooth intersection of A with the complement of B. A point is near-inside if it is inside A and outside (or near-outside) B; the interface is smoothed over a region of width m_smoothLen.

Template Parameters
TFloating-point precision.

Constructor & Destructor Documentation

◆ SmoothDifferenceIF() [1/2]

template<class T >
EBGeometry::SmoothDifferenceIF< T >::SmoothDifferenceIF ( 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 difference A \ B from two implicit functions.

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

◆ SmoothDifferenceIF() [2/2]

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

Constructs the smooth difference A \ union(Bs) from A and a list of subtrahends.

Parameters
[in]a_implicitFunctionAMinuend (must not be null).
[in]a_implicitFunctionsBSubtrahends (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::SmoothDifferenceIF< T >::value ( const Vec3T< T > &  a_point) const
overridevirtualnoexcept

Evaluates the smoothly blended signed distance at a_point.

Delegates to the internal SmoothIntersectionIF of A with the complement of B.

Parameters
[in]a_point3D query point.
Returns
Smooth signed distance representing A \ B.

Implements EBGeometry::ImplicitFunction< T >.


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