|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for a cylinder with rounded (toroidal) edges. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>


Public Member Functions | |
| RoundedCylinderSDF ()=default | |
| Default constructor. Constructs a rounded cylinder centred at the origin, axis along y, with outer radius 1, total height 1, and edge curvature 0.1. | |
| RoundedCylinderSDF (const T a_radius, const T a_curvature, const T a_height) noexcept | |
| Full constructor. | |
| RoundedCylinderSDF (const RoundedCylinderSDF &)=default | |
| Copy constructor. | |
| RoundedCylinderSDF (RoundedCylinderSDF &&)=default | |
| Move constructor. | |
| RoundedCylinderSDF & | operator= (const RoundedCylinderSDF &)=default |
| Copy assignment. | |
| RoundedCylinderSDF & | operator= (RoundedCylinderSDF &&)=default |
| Move assignment. | |
| ~RoundedCylinderSDF () override=default | |
| Destructor. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept override |
| Signed distance function for the rounded cylinder. | |
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. | |
Signed distance field for a cylinder with rounded (toroidal) edges.
The cylinder is centred at the origin with its axis along y. The constructor takes the outer radius, the total height, and an edge curvature radius. The curvature rounds the sharp edges where the flat caps meet the cylindrical wall; the resulting shape is sometimes called a "stadium of revolution" or a "pill cylinder".
Internally three derived parameters are stored:
m_majorRadius = a_radius - a_curvature: radius of the inner cylindrical core (before edge rounding).m_minorRadius = a_curvature: radius of the torus-like edge rounding.m_height = 0.5 * a_height - a_curvature: half-height of the inner cylindrical core (before edge rounding).The outer bounding cylinder has radius m_majorRadius + m_minorRadius = a_radius and half-height m_height + m_minorRadius = 0.5 * a_height. For the geometry to be valid, a_curvature must be strictly less than a_radius and less than 0.5 * a_height.
The SDF is negative inside and positive outside. By default the cylinder has outer radius 1, height 1, and edge curvature 0.1 (stored as m_majorRadius=0.9, m_minorRadius=0.1, m_height=0.4).
| T | Floating-point precision. |
|
inlinenoexcept |
Full constructor.
| [in] | a_radius | Outer cylinder radius. Must be > 0 and > a_curvature. |
| [in] | a_curvature | Edge rounding radius. Must be > 0 and satisfy a_curvature < a_radius and 2 * a_curvature < a_height. |
| [in] | a_height | Total cylinder height. Must be > 0 and > 2 * a_curvature. |
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlineoverridevirtualnoexcept |
Signed distance function for the rounded cylinder.
| [in] | a_point | Position. |
Implements EBGeometry::SignedDistanceFunction< T >.