|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for a finite, flat-capped cylinder. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
Public Member Functions | |
| CylinderSDF ()=default | |
| Default constructor. Constructs a unit cylinder of radius 1 and height 1, centered at the origin with its axis along y (cap centers at (0,-0.5,0) and (0,0.5,0)). | |
| CylinderSDF (const Vec3T< T > &a_center1, const Vec3T< T > &a_center2, const T &a_radius) noexcept | |
| Full constructor. | |
| CylinderSDF (const CylinderSDF &)=default | |
| Copy constructor. | |
| CylinderSDF (CylinderSDF &&)=default | |
| Move constructor. | |
| CylinderSDF & | operator= (const CylinderSDF &)=default |
| Copy assignment. | |
| CylinderSDF & | operator= (CylinderSDF &&)=default |
| Move assignment. | |
| const Vec3T< T > & | getCenter1 () const noexcept |
| Get one endpoint. | |
| const Vec3T< T > & | getCenter2 () const noexcept |
| Get the other endpoint. | |
| const T & | getRadius () const noexcept |
| Get radius. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| Signed distance function for the cylinder. | |
| 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_center1 = Vec3T<T>(T(0), T(-0.5), T(0)) |
| One endpoint (cap center). | |
| Vec3T< T > | m_center2 = Vec3T<T>(T(0), T(0.5), T(0)) |
| Other endpoint (cap center). | |
| Vec3T< T > | m_center = Vec3T<T>::zeros() |
| Midpoint of m_center1 and m_center2. | |
| Vec3T< T > | m_axis = Vec3T<T>(T(0), T(1), T(0)) |
| Unit axis pointing from m_center1 to m_center2. | |
| T | m_length = T(1) |
| Distance between the two endpoints. | |
| T | m_radius = T(1) |
| Cylinder radius. | |
Signed distance field for a finite, flat-capped cylinder.
The cylinder is defined by two cap-center positions m_center1 and m_center2 and a radius m_radius. The cylinder axis is the unit vector from m_center1 to m_center2, and its height (distance between the two flat caps) equals distance(m_center1, m_center2). The SDF is negative inside the cylinder and positive outside. By default the cylinder has radius 1 and height 1, centered at the origin with its axis along y (cap centers at (0,-0.5,0) and (0,0.5,0)).
| T | Floating-point precision. |
|
inlinenoexcept |
Full constructor.
| [in] | a_center1 | One endpoint (cap center). |
| [in] | a_center2 | Other endpoint (cap center). |
| [in] | a_radius | Cylinder radius. |
|
inlinenoexcept |
The shape's axis-aligned bounding box.
The box around the two cap discs: along axis i, each disc reaches the radius times sqrt(1 - axis_i^2) beyond its center.
|
inlinenoexcept |
Get one endpoint.
|
inlinenoexcept |
Get the other endpoint.
|
inlinenoexcept |
Get radius.
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlinenoexcept |
Signed distance function for the cylinder.
| [in] | a_point | Position. |