|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for a finite cone. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>


Public Member Functions | |
| ConeSDF ()=default | |
| Default constructor. Constructs a finite cone with its tip at the origin, height 1, and a 45-degree opening angle, body extending in the -z direction. | |
| ConeSDF (const Vec3T< T > &a_tip, const T &a_height, const T &a_angle) noexcept | |
| Full constructor. | |
| ConeSDF (const ConeSDF &)=default | |
| Copy constructor. | |
| ConeSDF (ConeSDF &&)=default | |
| Move constructor. | |
| ConeSDF & | operator= (const ConeSDF &)=default |
| Copy assignment. | |
| ConeSDF & | operator= (ConeSDF &&)=default |
| Move assignment. | |
| ~ConeSDF () override=default | |
| Destructor. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept override |
| Signed distance function for the finite cone. | |
Public Member Functions inherited from EBGeometry::SignedDistanceFunction< T > | |
| SignedDistanceFunction ()=default | |
| Default constructor. | |
| ~SignedDistanceFunction () override=default | |
| Destructor. | |
| T | 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. | |
| T | 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°. | |
| T | m_height = T(1) |
| Cone height (tip to base). | |
Signed distance field for a finite cone.
The cone tip is at m_tip and the body opens in the -z direction, so the base disc lies at m_tip + (0, 0, -m_height). The full opening angle a_angle is the tip-to-tip apex angle; internally the half-angle is encoded as m_c = (std::sin(half_angle), std::cos(half_angle)). The base radius equals m_height * std::tan(half_angle) = m_height * m_c.x / m_c.y.
The SDF is negative inside the solid cone (including the base disc) and positive outside. By default the tip is at the origin, the height is 1, and the full opening angle is 45°, giving a base radius of std::tan(22.5°) ≈ 0.414.
| T | Floating-point precision. |
|
inlinenoexcept |
Full constructor.
| [in] | a_tip | Cone tip position. |
| [in] | a_height | Cone height (tip to base). |
| [in] | a_angle | Full opening angle in degrees. |
|
default |
Move assignment.
|
default |
Copy assignment.
|
inlineoverridevirtualnoexcept |
Signed distance function for the finite cone.
| [in] | a_point | Position. |
Implements EBGeometry::SignedDistanceFunction< T >.