|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for an axis-aligned box with rounded edges and corners. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>
Public Member Functions | |
| RoundedBoxSDF ()=default | |
| Default constructor. Constructs a rounded unit cube, [-0.5, 0.5]^3, centered at the origin, with rounding radius 0.1. | |
| RoundedBoxSDF (const Vec3T< T > &a_center, const Vec3T< T > &a_size, const T a_curvature) noexcept | |
| Full constructor. | |
| RoundedBoxSDF (const RoundedBoxSDF &)=default | |
| Copy constructor. | |
| RoundedBoxSDF (RoundedBoxSDF &&)=default | |
| Move constructor. | |
| RoundedBoxSDF & | operator= (const RoundedBoxSDF &)=default |
| Copy assignment. | |
| RoundedBoxSDF & | operator= (RoundedBoxSDF &&)=default |
| Move assignment. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept |
| Signed distance function for the rounded box. | |
| 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 | |
| T | m_curvature = T(0.1) |
| Corner rounding radius. | |
| Vec3T< T > | m_center = Vec3T<T>::zeros() |
| Box center. | |
| Vec3T< T > | m_dimensions = Vec3T<T>(T(0.4), T(0.4), T(0.4)) |
| Half-extents of the inner box (= 0.5 * outer size - curvature). | |
Signed distance field for an axis-aligned box with rounded edges and corners.
The constructor takes the box's center, its outer size (the full side lengths of the finished, rounded box, which is also its bounding box) and the rounding radius. The rounding is a sphere of that radius swept over an inner box whose half-extents, m_dimensions = 0.5 * size - curvature, are stored. The SDF is negative inside and positive outside.
| T | Floating-point precision. |
|
inlinenoexcept |
Full constructor.
| [in] | a_center | Box center. |
| [in] | a_size | Outer size: the full side lengths of the rounded box. Each must exceed twice the rounding radius. |
| [in] | a_curvature | Rounding radius of the edges and corners. Must be > 0. |
|
inlinenoexcept |
The shape's axis-aligned bounding box.
The center plus and minus half the outer size.
|
default |
Copy assignment.
|
default |
Move assignment.
|
inlinenoexcept |
Signed distance function for the rounded box.
| [in] | a_point | Position. |