|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for a cut hollow sphere: a spherical shell of some thickness, the part above a horizontal plane, such as a dome or a radome. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
Public Member Functions | |
| CutHollowSphereSDF ()=default | |
| Default constructor. Constructs the upper half of a shell of thickness 0.1 around the unit sphere at the origin. | |
| CutHollowSphereSDF (const Vec3T< T > &a_center, const T a_radius, const T a_height, const T a_thickness) | |
| Full constructor. | |
| CutHollowSphereSDF (const CutHollowSphereSDF &)=default | |
| Copy constructor. | |
| CutHollowSphereSDF (CutHollowSphereSDF &&)=default | |
| Move constructor. | |
| CutHollowSphereSDF & | operator= (const CutHollowSphereSDF &)=default |
| Copy assignment. | |
| CutHollowSphereSDF & | operator= (CutHollowSphereSDF &&)=default |
| Move assignment. | |
| const Vec3T< T > & | getCenter () const noexcept |
| Get the center of the sphere. | |
| const T & | getRadius () const noexcept |
| Get the radius of the shell's middle surface. | |
| const T & | getHeight () const noexcept |
| Get the height of the cut plane above the center. | |
| const T & | getThickness () const noexcept |
| Get the shell's thickness. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| Signed distance function for the cut hollow sphere. | |
| uint32_t | getNumParts () const noexcept |
| How many parts the shape has (see hasParts): 2. | |
| uint32_t | closestPart (const Vec3T< T > &a_point) const noexcept |
| The part whose term decides the value at a point (see hasParts): 0 the shell, 1 its rounded rim. | |
| 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() |
| Center of the sphere. | |
| T | m_radius = T(1) |
| Radius of the shell's middle surface. | |
| T | m_height = T(0) |
| Height of the cut plane above the center. | |
| T | m_thickness = T(0.1) |
| The shell's thickness. | |
| T | m_rim = T(1) |
| Radius of the rim, sqrt(radius^2 - height^2). | |
Signed distance field for a cut hollow sphere: a spherical shell of some thickness, the part above a horizontal plane, such as a dome or a radome.
The shell is the set of points within half the thickness of the sphere, and the part kept is the one above the cone from the center through the rim, where the sphere meets the plane y = center.y + height. The shell's rims are therefore rounded, with radius half the thickness. The distance is exact (Quilez's cut hollow sphere): the distance to the sphere's arc above the rim, or to the rim, less half the thickness. Turn it with Rotate. By default it is the upper half of a shell of thickness 0.1 around the unit sphere at the origin.
| T | Floating-point precision. |
|
inline |
Full constructor.
| [in] | a_center | Center of the sphere. |
| [in] | a_radius | Radius of the shell's middle surface, finite and positive. |
| [in] | a_height | Height of the cut plane above the center, between -a_radius and a_radius. |
| [in] | a_thickness | The shell's thickness, positive and less than twice the radius. |
|
inlinenoexcept |
The part whose term decides the value at a point (see hasParts): 0 the shell, 1 its rounded rim.
| [in] | a_point | Position. |
|
inlinenoexcept |
The shape's axis-aligned bounding box.
|
inlinenoexcept |
Get the center of the sphere.
|
inlinenoexcept |
Get the height of the cut plane above the center.
|
inlinenoexcept |
How many parts the shape has (see hasParts): 2.
|
inlinenoexcept |
Get the radius of the shell's middle surface.
|
inlinenoexcept |
Get the shell's thickness.
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlinenoexcept |
Signed distance function for the cut hollow sphere.
| [in] | a_point | Position. |