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

BVH-accelerated smooth union of implicit functions. More...

#include <EBGeometry_CSG.hpp>

Inheritance diagram for EBGeometry::BVHSmoothUnionIF< T, P, BV, K >:
Inheritance graph
[legend]
Collaboration diagram for EBGeometry::BVHSmoothUnionIF< T, P, BV, K >:
Collaboration graph
[legend]

Public Types

using Root = EBGeometry::BVH::PackedBVH< T, P, K >
 Alias for the flat BVH type.
 
using Node = typename Root::Node
 Alias for a BVH node.
 

Public Member Functions

 BVHSmoothUnionIF ()=delete
 Disallowed, use the full constructor.
 
 BVHSmoothUnionIF (const std::vector< std::shared_ptr< P > > &a_distanceFunctions, const std::vector< BV > &a_boundingVolumes, const T a_smoothLen, const std::function< T(const T &, const T &, const T &)> a_smoothMin=SmoothMin< T >) noexcept
 Constructs the BVH-accelerated smooth union.
 
 ~BVHSmoothUnionIF () override=default
 Destructor.
 
value (const Vec3T< T > &a_point) const noexcept override
 Evaluates the smoothly blended signed distance at a_point using BVH traversal.
 
const EBGeometry::BoundingVolumes::AABBT< T > & getBoundingVolume () const noexcept
 Returns the axis-aligned bounding box enclosing all primitives.
 
- 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 Member Functions

void buildTree (const std::vector< std::pair< std::shared_ptr< const P >, BV > > &a_primsAndBVs, const BVH::Build a_build=BVH::Build::SAH) noexcept
 Builds the internal BVH from primitive/BV pairs.
 

Protected Attributes

std::shared_ptr< EBGeometry::BVH::PackedBVH< T, P, K > > m_bvh
 Flat BVH over all input primitives.
 
m_smoothLen
 Smoothing length.
 
std::function< T(const T &, const T &, const T &)> m_smoothMin
 Smooth-minimum operator.
 

Detailed Description

template<class T, class P, class BV, size_t K>
class EBGeometry::BVHSmoothUnionIF< T, P, BV, K >

BVH-accelerated smooth union of implicit functions.

Uses the BVH to locate the two nearest primitives and applies a smooth-minimum operator to their values, yielding C1 (or better) blending across nearby surfaces. Query cost is sub-linear in the number of primitives.

Template Parameters
TFloating-point precision.
PPrimitive type; must derive from ImplicitFunction<T>.
BVBounding volume type (e.g. AABBT<T>).
KBVH branching factor.

Constructor & Destructor Documentation

◆ BVHSmoothUnionIF()

template<class T , class P , class BV , size_t K>
EBGeometry::BVHSmoothUnionIF< T, P, BV, K >::BVHSmoothUnionIF ( const std::vector< std::shared_ptr< P > > &  a_distanceFunctions,
const std::vector< BV > &  a_boundingVolumes,
const a_smoothLen,
const std::function< T(const T &, const T &, const T &)>  a_smoothMin = SmoothMin< T > 
)
noexcept

Constructs the BVH-accelerated smooth union.

Parameters
[in]a_distanceFunctionsInput implicit functions (must be non-empty; no null entries).
[in]a_boundingVolumesBounding volumes for each function (same length as a_distanceFunctions).
[in]a_smoothLenSmoothing length (must be > 0).
[in]a_smoothMinSmooth-minimum operator; defaults to SmoothMin<T>.

Member Function Documentation

◆ buildTree()

template<class T , class P , class BV , size_t K>
void EBGeometry::BVHSmoothUnionIF< T, P, BV, K >::buildTree ( const std::vector< std::pair< std::shared_ptr< const P >, BV > > &  a_primsAndBVs,
const BVH::Build  a_build = BVH::Build::SAH 
)
inlineprotectednoexcept

Builds the internal BVH from primitive/BV pairs.

Parameters
[in]a_primsAndBVsPrimitives and their bounding volumes.
[in]a_buildBVH construction strategy.

◆ getBoundingVolume()

template<class T , class P , class BV , size_t K>
const EBGeometry::BoundingVolumes::AABBT< T > & EBGeometry::BVHSmoothUnionIF< T, P, BV, K >::getBoundingVolume ( ) const
noexcept

Returns the axis-aligned bounding box enclosing all primitives.

Returns
Const reference to the root bounding volume of the BVH.

◆ value()

template<class T , class P , class BV , size_t K>
T EBGeometry::BVHSmoothUnionIF< T, P, BV, K >::value ( const Vec3T< T > &  a_point) const
overridevirtualnoexcept

Evaluates the smoothly blended signed distance at a_point using BVH traversal.

Finds the two nearest primitives via BVH and applies the stored smooth-minimum. Negative when inside the smooth union.

Parameters
[in]a_point3D query point.
Returns
Smooth minimum signed distance blended from the two closest primitives.

Implements EBGeometry::ImplicitFunction< T >.


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