|
| class | EBGeometry::PlaneSDF< T > |
| | Signed distance function for a plane. More...
|
| |
| class | EBGeometry::SphereSDF< T > |
| | Signed distance field for a sphere. More...
|
| |
| class | EBGeometry::BoxSDF< T > |
| | Signed distance field for an axis-aligned box (AABB). More...
|
| |
| class | EBGeometry::TorusSDF< T > |
| | Signed distance field for a torus. More...
|
| |
| class | EBGeometry::CylinderSDF< T > |
| | Signed distance field for a finite, flat-capped cylinder. More...
|
| |
| class | EBGeometry::InfiniteCylinderSDF< T > |
| | Signed distance field for an infinitely long cylinder. More...
|
| |
| class | EBGeometry::CapsuleSDF< T > |
| | Signed distance field for a capsule (pill shape): a cylinder capped with hemispheres. More...
|
| |
| class | EBGeometry::InfiniteConeSDF< T > |
| | Signed distance field for an infinite cone. More...
|
| |
| class | EBGeometry::ConeSDF< T > |
| | Signed distance field for a finite cone. More...
|
| |
| class | EBGeometry::RoundedBoxSDF< T > |
| | Signed distance field for an axis-aligned box with rounded edges and corners. More...
|
| |
| class | EBGeometry::PerlinSDF< T > |
| | Ken Perlin's gradient-noise implicit function. More...
|
| |
| class | EBGeometry::RoundedCylinderSDF< T > |
| | Signed distance field for a cylinder with rounded (toroidal) edges. More...
|
| |
| struct | EBGeometry::AnalyticDetail::AxialCoordinates< T > |
| | A point's coordinates around an axis: its distance from the axis line, and its position along it. More...
|
| |
| class | EBGeometry::EllipsoidSDF< T > |
| | Signed distance field for an ellipsoid with its semi-axes along x, y and z. More...
|
| |
| class | EBGeometry::CappedConeSDF< T > |
| | Signed distance field for a capped cone (a frustum): a cone cut flat at both ends, between two end centers, with a radius at each. More...
|
| |
| class | EBGeometry::RoundConeSDF< T > |
| | Signed distance field for a round cone: two spheres, of different radii, and the cone tangent to both, like a capsule with a radius at each end. More...
|
| |
| class | EBGeometry::PolygonPrismSDF< T > |
| | Signed distance field for a regular prism: a regular polygon of n sides, extruded between two end centers. More...
|
| |
| class | EBGeometry::TubeSDF< T > |
| | Signed distance field for a tube (a pipe): the space between two coaxial cylinders, cut flat at two end centers. More...
|
| |
| class | EBGeometry::CappedTorusSDF< T > |
| | Signed distance field for a capped torus: an arc of a torus with flat ends, such as a pipe elbow. More...
|
| |
| class | EBGeometry::CutSphereSDF< T > |
| | Signed distance field for a cut sphere: the part of a sphere above a horizontal plane, a dome or a sphere with a flat bottom. More...
|
| |
| class | EBGeometry::CutHollowSphereSDF< T > |
| | 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...
|
| |
| class | EBGeometry::WedgeSDF< T > |
| | Signed distance field for an infinite wedge: a knife edge. More...
|
| |
|
| template<class T > |
| AxialCoordinates< T > | EBGeometry::AnalyticDetail::axialCoordinates (const Vec3T< T > &a_point, const Vec3T< T > &a_start, const Vec3T< T > &a_axis) noexcept |
| | A point's coordinates around the axis that starts at a_start and runs along the unit a_axis.
|
| |
| template<class T > |
| T | EBGeometry::AnalyticDetail::extrusion (const T a_profile, const T a_slab) noexcept |
| | The signed distance to a 2D profile extruded between two parallel planes: the exact distance, from the profile's signed distance and the signed distance to the slab between the planes.
|
| |
| template<class T > |
| bool | EBGeometry::AnalyticDetail::isFinite (const Vec3T< T > &a_point) noexcept |
| | Checks that a point given to a constructor is finite.
|
| |
| template<class T , size_t N> |
| T | EBGeometry::AnalyticDetail::ellipsoidRoot (const T(&a_r)[N], const T(&a_n)[N], const T a_lo, const T a_hi) noexcept |
| | The root of Eberly's function F(s) = sum_i (a_n[i] / (s + a_r[i]))^2 - 1 over the components with a_n[i] > 0, for the closest point on an ellipse or ellipsoid scaled so that its smallest semi-axis is 1.
|
| |
| template<class T > |
| T | EBGeometry::AnalyticDetail::ellipseDistance (const T a_e0, const T a_e1, const T a_y0, const T a_y1) noexcept |
| | The distance from a point to an ellipse with semi-axes a_e0 >= a_e1 > 0, for a point with coordinates a_y0, a_y1 >= 0 (Eberly's algorithm).
|
| |
| template<class T > |
| T | EBGeometry::AnalyticDetail::ellipsoidDistance (const T a_e0, const T a_e1, const T a_e2, const T a_y0, const T a_y1, const T a_y2) noexcept |
| | The distance from a point to an ellipsoid with semi-axes a_e0 >= a_e1 >= a_e2 > 0, for a point with coordinates a_y0, a_y1, a_y2 >= 0 (Eberly's algorithm).
|
| |
File containing various analytic signed distance fields.
Every shape here is a plain, trivially copyable value type with no base class and no virtual functions. Its signedDistance() and accessors are callable on the host and on a device, so a shape can be copied into a kernel by value and evaluated there. Constructors run on the host. Every shape is a shape in the sense of isShape, so it can be composed with the expression builder (Union, Translate, ...; see EBGeometry_Expr.hpp) and compiled into a Tape.
Conventions shared by every shape:
- Placement first: each constructor takes the shape's position (a center, corner, tip or point) before its sizes. PerlinSDF, which fills all of space, has none.
- One axis: a shape with a fixed axis has it along y (Torus, InfiniteCone, Cone, RoundedCylinder, CappedTorus, CutSphere, CutHollowSphere and Wedge, and the defaults of the others); Rotate turns it. Cylinder, Capsule, CappedCone, RoundCone, PolygonPrism and Tube take two end points, and InfiniteCylinder an axis index, so they can point anywhere.
- Outer sizes: a size is that of the finished shape, rounding included.
- computeBoundingVolume() returns the shape's axis-aligned bounding box. Along a direction in which the shape is unbounded, the box extends to plus or minus Math::Limits<T>::max().
- distanceQuality says how far signedDistance() can be trusted as a distance (DistanceQuality). Every shape is Exact except PerlinSDF, which is NotADistance.
- Author
- Robert Marskar
template<class T >
| T EBGeometry::AnalyticDetail::ellipsoidDistance |
( |
const T |
a_e0, |
|
|
const T |
a_e1, |
|
|
const T |
a_e2, |
|
|
const T |
a_y0, |
|
|
const T |
a_y1, |
|
|
const T |
a_y2 |
|
) |
| |
|
inlineprotectednoexcept |
The distance from a point to an ellipsoid with semi-axes a_e0 >= a_e1 >= a_e2 > 0, for a point with coordinates a_y0, a_y1, a_y2 >= 0 (Eberly's algorithm).
Internal helper; not part of the public API. A point on a coordinate plane is handled by the planar cases of the algorithm: its closest point is on the ellipse in that plane, or, for a point inside near the plane of the two larger axes, off it.
- Template Parameters
-
| T | Floating-point precision. |
- Parameters
-
| [in] | a_e0 | Largest semi-axis. |
| [in] | a_e1 | Middle semi-axis. |
| [in] | a_e2 | Smallest semi-axis. |
| [in] | a_y0 | Coordinate along a_e0. |
| [in] | a_y1 | Coordinate along a_e1. |
| [in] | a_y2 | Coordinate along a_e2. |
- Returns
- The unsigned distance to the ellipsoid surface.
template<class T , size_t N>
| T EBGeometry::AnalyticDetail::ellipsoidRoot |
( |
const T(&) |
a_r[N], |
|
|
const T(&) |
a_n[N], |
|
|
const T |
a_lo, |
|
|
const T |
a_hi |
|
) |
| |
|
inlineprotectednoexcept |
The root of Eberly's function F(s) = sum_i (a_n[i] / (s + a_r[i]))^2 - 1 over the components with a_n[i] > 0, for the closest point on an ellipse or ellipsoid scaled so that its smallest semi-axis is 1.
Internal helper; not part of the public API. F is decreasing and convex for s > -min(a_r), and its root lies in [a_lo, a_hi], where F(a_lo) >= 0 (Eberly, "Distance from a point to an ellipse, an
ellipsoid, or a hyperellipsoid", 2013). Newton's method from a_lo therefore increases monotonically to the root and never overshoots it; a step that would leave the bracket (by rounding) is replaced by bisection. It stops when F is no longer positive, when a step makes no progress or changes s by no more than a few units in the last place, or after MaxIterations.
- Template Parameters
-
| T | Floating-point precision. |
| N | Number of components (2 or 3). |
- Parameters
-
| [in] | a_r | The squared ratios of the semi-axes to the smallest one. |
| [in] | a_n | The scaled coordinates of the point, a_r[i] times the point's coordinate over the semi-axis. |
| [in] | a_lo | Lower end of the bracket, with F(a_lo) >= 0. |
| [in] | a_hi | Upper end of the bracket, with F(a_hi) <= 0. |
- Returns
- The root.