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


Public Member Functions | |
| TorusSDF ()=default | |
| Default constructor. Constructs a torus centered at the origin with major radius 1 and minor radius 0.5. | |
| TorusSDF (const Vec3T< T > &a_center, const T &a_majorRadius, const T &a_minorRadius) noexcept | |
| Full constructor. | |
| TorusSDF (const TorusSDF &)=default | |
| Copy constructor. | |
| TorusSDF (TorusSDF &&)=default | |
| Move constructor. | |
| TorusSDF & | operator= (const TorusSDF &)=default |
| Copy assignment. | |
| TorusSDF & | operator= (TorusSDF &&)=default |
| Move assignment. | |
| ~TorusSDF () override=default | |
| Destructor. | |
| const Vec3T< T > & | getCenter () const noexcept |
| Get torus center. | |
| Vec3T< T > & | getCenter () noexcept |
| Get torus center. | |
| const T & | getMajorRadius () const noexcept |
| Get major radius. | |
| T & | getMajorRadius () noexcept |
| Get major radius. | |
| const T & | getMinorRadius () const noexcept |
| Get minor radius. | |
| T & | getMinorRadius () noexcept |
| Get minor radius. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept override |
| Signed distance function for the torus. | |
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_center = Vec3T<T>::zeros() |
| Torus center. | |
| T | m_majorRadius = T(1) |
| Major (ring) radius. | |
| T | m_minorRadius = T(0.5) |
| Minor (tube) radius. | |
Signed distance field for a torus.
The torus ring lies in the xy-plane and is centred at m_center. The major radius m_majorRadius is the distance from the torus centre to the centre-line of the tube; the minor radius m_minorRadius is the tube radius. The bounding box spans [center ± (majorRadius + minorRadius)] in x and y, and [center ± minorRadius] in z. The SDF is negative inside the tube and positive outside. The minor radius must be strictly less than the major radius; otherwise the tube would self-intersect at the torus centre. By default the torus is centred at the origin with major radius 1 and minor radius 0.5.
| T | Floating-point precision. |
|
inlinenoexcept |
Full constructor.
| [in] | a_center | Torus center. |
| [in] | a_majorRadius | Major (ring) radius. |
| [in] | a_minorRadius | Minor (tube) radius. |
|
inlinenoexcept |
Get torus center.
|
inlinenoexcept |
Get torus center.
|
inlinenoexcept |
Get major radius.
|
inlinenoexcept |
Get major radius.
|
inlinenoexcept |
Get minor radius.
|
inlinenoexcept |
Get minor radius.
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlineoverridevirtualnoexcept |
Signed distance function for the torus.
| [in] | a_point | Position. |
Implements EBGeometry::SignedDistanceFunction< T >.