|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Signed distance field for an axis-aligned box with rounded corners. More...
#include <EBGeometry_AnalyticDistanceFunctions.hpp>


Public Member Functions | |
| RoundedBoxSDF ()=default | |
| Default constructor. Constructs a rounded unit cube centered at the origin ([-0.5, 0.5]^3 before rounding) with corner curvature 0.1. | |
| RoundedBoxSDF (const Vec3T< T > &a_dimensions, const T a_curvature) noexcept | |
| Full constructor. | |
| RoundedBoxSDF (const RoundedBoxSDF &)=default | |
| Copy constructor. Shares the internal sphere object. | |
| RoundedBoxSDF (RoundedBoxSDF &&)=default | |
| Move constructor. | |
| RoundedBoxSDF & | operator= (const RoundedBoxSDF &)=default |
| Copy assignment. Shares the internal sphere object. | |
| RoundedBoxSDF & | operator= (RoundedBoxSDF &&)=default |
| Move assignment. | |
| ~RoundedBoxSDF () override=default | |
| Destructor. | |
| T | signedDistance (const Vec3T< T > &a_point) const noexcept override |
| Signed distance function for the rounded box. | |
Public Member Functions inherited from EBGeometry::SignedDistanceFunction< T > | |
| SignedDistanceFunction ()=default | |
| Default constructor. | |
| ~SignedDistanceFunction () override=default | |
| Destructor. | |
| T | value (const Vec3T< T > &a_point) const noexcept final |
| Implementation of ImplicitFunction::value; delegates to signedDistance(). | |
| virtual Vec3T< T > | normal (const Vec3T< T > &a_point, const T &a_delta) const noexcept |
| Compute the outward normal using central finite differences. | |
Public Member Functions inherited from EBGeometry::ImplicitFunction< T > | |
| ImplicitFunction ()=default | |
| Default constructor. | |
| virtual | ~ImplicitFunction ()=default |
| Default destructor. | |
| T | operator() (const Vec3T< T > &a_point) const noexcept |
| Call operator — alternative signature for the value function. | |
| template<class BV > | |
| BV | approximateBoundingVolumeOctree (const Vec3T< T > &a_initialLowCorner, const Vec3T< T > &a_initialHighCorner, const unsigned int a_maxTreeDepth, const T &a_safety=0.0) const |
| Compute an approximation to the bounding volume for the implicit surface using octree subdivision. | |
Protected Attributes | |
| std::shared_ptr< SphereSDF< T > > | m_sphere = std::make_shared<SphereSDF<T>>(Vec3T<T>::zeros(), T(0.1)) |
| Sphere of radius = curvature used to round the corners. | |
| Vec3T< T > | m_dimensions = Vec3T<T>(T(0.5), T(0.5), T(0.5)) |
| Half-extents of the inner box (= 0.5 * the user-supplied dimensions). | |
Signed distance field for an axis-aligned box with rounded corners.
The box is centred at the origin. The constructor takes the full side lengths along each axis and a corner curvature radius. Internally, half-extents m_dimensions = 0.5 * a_dimensions are stored. The actual bounding half-extent in each direction is m_dimensions[i] + curvature, so the total bounding box has full side lengths a_dimensions[i] + 2 * curvature. The corners are rounded by spheres of radius curvature. The SDF is negative inside and positive outside.
| T | Floating-point precision. |
|
default |
Default constructor. Constructs a rounded unit cube centered at the origin ([-0.5, 0.5]^3 before rounding) with corner curvature 0.1.
Total half-extent in each direction is 0.5 + 0.1 = 0.6.
|
inlinenoexcept |
Full constructor.
The total half-extent in direction i is 0.5*a_dimensions[i] + a_curvature.
| [in] | a_dimensions | Box dimensions (full side lengths before rounding). |
| [in] | a_curvature | Corner sphere radius. Must be > 0. |
|
default |
Copy assignment. Shares the internal sphere object.
|
default |
Move assignment.
|
inlineoverridevirtualnoexcept |
Signed distance function for the rounded box.
| [in] | a_point | Position. |
Implements EBGeometry::SignedDistanceFunction< T >.