|
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. | |
| 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 |
| Signed distance function for the torus. | |
| 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_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 xz-plane, around an axis along y, and is centered at m_center. The major radius m_majorRadius is the distance from the torus center to the center-line of the tube; the minor radius m_minorRadius is the tube radius. The bounding box spans [center ± (majorRadius + minorRadius)] in x and z, and [center ± minorRadius] in y. 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 center. By default the torus is centered 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 |
The shape's axis-aligned bounding box.
The ring plus the tube radius in x and z, the tube radius alone in y.
|
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.
|
inlinenoexcept |
Signed distance function for the torus.
| [in] | a_point | Position. |