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

Signed distance field for an infinite cone. More...

#include <EBGeometry_AnalyticDistanceFunctions.hpp>

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

Public Member Functions

 InfiniteConeSDF ()=default
 Default constructor. Constructs an infinite cone with tip at the origin, 45° full opening angle, and body extending in the -z direction.
 
 InfiniteConeSDF (const Vec3T< T > &a_tip, const T &a_angle) noexcept
 Full constructor.
 
 InfiniteConeSDF (const InfiniteConeSDF &)=default
 Copy constructor.
 
 InfiniteConeSDF (InfiniteConeSDF &&)=default
 Move constructor.
 
InfiniteConeSDFoperator= (const InfiniteConeSDF &)=default
 Copy assignment.
 
InfiniteConeSDFoperator= (InfiniteConeSDF &&)=default
 Move assignment.
 
 ~InfiniteConeSDF () override=default
 Destructor.
 
signedDistance (const Vec3T< T > &a_point) const noexcept override
 Signed distance function for the infinite cone.
 
- Public Member Functions inherited from EBGeometry::SignedDistanceFunction< T >
 SignedDistanceFunction ()=default
 Default constructor.
 
 ~SignedDistanceFunction () override=default
 Destructor.
 
value (const Vec3T< T > &a_point) const noexcept final
 Implementation of ImplicitFunction::value; delegates to signedDistance().
 
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.
 

Protected Attributes

Vec3T< T > m_tip = Vec3T<T>::zeros()
 Tip position.
 
Vec2T< T > m_c = Vec2T<T>(std::sin(pi<T> / T(8)), std::cos(pi<T> / T(8)))
 (sin, cos) of the half opening-angle. Default: 45° full angle → half-angle 22.5°.
 

Detailed Description

template<class T>
class EBGeometry::InfiniteConeSDF< T >

Signed distance field for an infinite cone.

The cone tip is at m_tip. The cone body opens in the -z direction from the tip (the interior, where SDF < 0, is the solid region extending downward along -z within the cone surface). The full opening angle a_angle (tip-to-tip across the cone) is halved internally; the half-angle is stored as m_c = (std::sin(half_angle), std::cos(half_angle)).

For a 45° full opening angle the half-angle is 22.5°; a point directly below the tip at depth d sits on the cone surface when its radial distance from the axis equals d * std::tan(half_angle).

The cone is infinite: it has no base plane. By default the tip is at the origin and the full opening angle is 45°, with the body extending along -z.

Template Parameters
TFloating-point precision.

Constructor & Destructor Documentation

◆ InfiniteConeSDF()

template<class T >
EBGeometry::InfiniteConeSDF< T >::InfiniteConeSDF ( const Vec3T< T > &  a_tip,
const T &  a_angle 
)
inlinenoexcept

Full constructor.

Parameters
[in]a_tipCone tip position.
[in]a_angleFull opening angle in degrees (must be in (0°, 180°)). The half-angle a_angle / 2 is used internally and encoded as m_c = (sin, cos) of that half-angle.

Member Function Documentation

◆ operator=() [1/2]

template<class T >
InfiniteConeSDF & EBGeometry::InfiniteConeSDF< T >::operator= ( const InfiniteConeSDF< T > &  )
default

Copy assignment.

Returns
Reference to (*this).

◆ operator=() [2/2]

template<class T >
InfiniteConeSDF & EBGeometry::InfiniteConeSDF< T >::operator= ( InfiniteConeSDF< T > &&  )
default

Move assignment.

Returns
Reference to (*this).

◆ signedDistance()

template<class T >
T EBGeometry::InfiniteConeSDF< T >::signedDistance ( const Vec3T< T > &  a_point) const
inlineoverridevirtualnoexcept

Signed distance function for the infinite cone.

Parameters
[in]a_pointPosition.
Returns
Signed distance from a_point to the cone surface; negative inside the cone.

Implements EBGeometry::SignedDistanceFunction< T >.


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