|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for a quadric of revolution around y: a hyperboloid of one sheet, a hyperboloid of two sheets, or a paraboloid. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
Public Types | |
| enum class | Kind : uint32_t { HyperboloidOneSheet , HyperboloidTwoSheets , Paraboloid } |
| Which quadric, with r the distance from the axis and y the height above the center (or the tip). More... | |
Public Member Functions | |
| QuadricSDF ()=default | |
| Default constructor. Constructs the paraboloid with its tip at the origin, opening toward -y, with a tip radius of 1. | |
| QuadricSDF (const QuadricSDF &)=default | |
| Copy constructor. | |
| QuadricSDF (QuadricSDF &&)=default | |
| Move constructor. | |
| QuadricSDF & | operator= (const QuadricSDF &)=default |
| Copy assignment. | |
| QuadricSDF & | operator= (QuadricSDF &&)=default |
| Move assignment. | |
| Kind | getKind () const noexcept |
| Get which quadric this is. | |
| const Vec3T< T > & | getCenter () const noexcept |
| Get the center (a hyperboloid) or the tip (a paraboloid). | |
| const T & | getA () const noexcept |
| Get the semi-axis across y, a, of a hyperboloid, or the tip radius of a paraboloid. | |
| const T & | getC () const noexcept |
| Get the semi-axis along y, c, of a hyperboloid; for a paraboloid, its tip radius. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| Signed distance function for the quadric. | |
| BoundingVolumes::AABBT< T > | computeBoundingVolume () const noexcept |
| The shape's axis-aligned bounding box: unbounded, but above the tip of a paraboloid. | |
Static Public Member Functions | |
| static QuadricSDF | hyperboloid (const Vec3T< T > &a_center, const T a_waist, const T a_angle) |
| A hyperboloid of one sheet around the y axis through the center: a waisted tower, unbounded along y. | |
| static QuadricSDF | hyperboloidTwoSheets (const Vec3T< T > &a_center, const T a_tipDistance, const T a_angle) |
| A hyperboloid of two sheets around the y axis through the center: two cups, with their tips on the axis at the given distance above and below the center, each opening away from it, unbounded along y. | |
| static QuadricSDF | paraboloid (const Vec3T< T > &a_tip, const T a_tipRadius) |
| A paraboloid around the y axis through its tip, opening toward -y, as the cones do, unbounded below. | |
Static Public Attributes | |
| static constexpr DistanceQuality | distanceQuality = DistanceQuality::Exact |
| How far signedDistance() can be trusted as a distance: the Euclidean distance to the surface. | |
Static Protected Member Functions | |
| static QuadricSDF | checked (const Vec3T< T > &a_center, const T a_size, const T a_angle, const char *a_who) |
| Checks a factory's arguments, and makes a quadric at the center. | |
Protected Attributes | |
| Kind | m_kind = Kind::Paraboloid |
| Which quadric. | |
| Vec3T< T > | m_center = Vec3T<T>::zeros() |
| The center (a hyperboloid) or the tip (a paraboloid). | |
| T | m_a = T(1) |
| The semi-axis across y, a (a hyperboloid), or the tip radius rho (a paraboloid). | |
| T | m_c = T(1) |
| The semi-axis along y, c (a hyperboloid); the tip radius for a paraboloid. | |
Signed distance field for a quadric of revolution around y: a hyperboloid of one sheet, a hyperboloid of two sheets, or a paraboloid.
The three share their code: in the cross-section through the axis, the surface is a conic (a hyperbola or a parabola), and the distance to it is exact, from the closest point on the conic: the root of a scalar equation found by safeguarded Newton steps for a hyperbola, as for EllipsoidSDF, and a cubic solved in closed form for a parabola. Each is unbounded: cut it with an Intersection, or use it to cut. They are made by the static functions hyperboloid(), hyperboloidTwoSheets() and paraboloid(), which return a QuadricSDF; turn them with Rotate. By default the quadric is the paraboloid with its tip at the origin and a tip radius of 1.
| T | Floating-point precision. |
|
strong |
Which quadric, with r the distance from the axis and y the height above the center (or the tip).
|
inlinestaticprotected |
Checks a factory's arguments, and makes a quadric at the center.
| [in] | a_center | The center or tip. |
| [in] | a_size | The size, finite and positive. |
| [in] | a_angle | The angle in degrees, in (0, 180). |
| [in] | a_who | The factory, for the messages. |
|
inlinenoexcept |
The shape's axis-aligned bounding box: unbounded, but above the tip of a paraboloid.
|
inlinenoexcept |
Get the semi-axis across y, a, of a hyperboloid, or the tip radius of a paraboloid.
|
inlinenoexcept |
Get the semi-axis along y, c, of a hyperboloid; for a paraboloid, its tip radius.
|
inlinenoexcept |
Get the center (a hyperboloid) or the tip (a paraboloid).
|
inlinenoexcept |
Get which quadric this is.
|
inlinestatic |
A hyperboloid of one sheet around the y axis through the center: a waisted tower, unbounded along y.
| [in] | a_center | The center, on the axis at the narrowest point. |
| [in] | a_waist | The radius at the narrowest point, finite and positive. |
| [in] | a_angle | The full opening angle of the asymptotic cone, in degrees, in (0, 180): the hyperboloid widens toward that cone far from the center. |
|
inlinestatic |
A hyperboloid of two sheets around the y axis through the center: two cups, with their tips on the axis at the given distance above and below the center, each opening away from it, unbounded along y.
The solid is inside the two cups. The radius of curvature at a tip is a_tipDistance tan^2(angle / 2).
| [in] | a_center | The center, midway between the tips. |
| [in] | a_tipDistance | The distance from the center to each tip, finite and positive. |
| [in] | a_angle | The full opening angle of the asymptotic cone, in degrees, in (0, 180). |
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlinestatic |
A paraboloid around the y axis through its tip, opening toward -y, as the cones do, unbounded below.
| [in] | a_tip | The tip. |
| [in] | a_tipRadius | The radius of curvature at the tip, finite and positive: the paraboloid is y = -r^2 / (2 a_tipRadius) below the tip. |
|
inlinenoexcept |
Signed distance function for the quadric.
| [in] | a_point | Position. |