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

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

#include <EBGeometry_AnalyticDistanceFunctions.hpp>

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 -y 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.
 
InfiniteConeSDF & operator= (const InfiniteConeSDF &)=default
 Copy assignment.
 
InfiniteConeSDF & operator= (InfiniteConeSDF &&)=default
 Move assignment.
 
T signedDistance (const Vec3T< T > &a_point) const noexcept
 Signed distance function for the infinite cone.
 
BoundingVolumes::AABBT< T > computeBoundingVolume () const noexcept
 The shape's axis-aligned bounding box.
 

Static Public Attributes

static constexpr DistanceQuality distanceQuality = DistanceQuality::Exact
 How far signedDistance() can be trusted as a distance: the Euclidean distance to the surface.
 

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 -y direction from the tip (the interior, where SDF < 0, is the solid region extending downward along -y 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 -y.

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

◆ computeBoundingVolume()

template<class T >
BoundingVolumes::AABBT< T > EBGeometry::InfiniteConeSDF< T >::computeBoundingVolume ( ) const
inlinenoexcept

The shape's axis-aligned bounding box.

Bounded above by the tip in y, and unbounded below it and in x and z.

Returns
The bounding box.

◆ 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
inlinenoexcept

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.

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