|
EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
|
Exponential smooth minimum for blending two signed-distance values. More...
#include <EBGeometry_Blend.hpp>
Public Member Functions | |
| T | operator() (const T &a, const T &b, const T &s) const noexcept |
| Evaluate the exponential smooth minimum. | |
Exponential smooth minimum for blending two signed-distance values.
Evaluates -s log(exp(-a/s) + exp(-b/s)), which approximates min(a, b) with exponential weighting; the blend region width scales with s. Useful when a differentiable interface is required. Approaches min(a, b) as s → 0. Computed as min(a, b) - s log1p(exp(-|a - b| / s)), which equals the formula above but cannot overflow or underflow however far a and b are from zero. A trivially copyable function object, so it can be stored in a BVHSmoothUnion and evaluated on a device.
| T | Floating-point precision. |
|
inlinenoexcept |
Evaluate the exponential smooth minimum.
| [in] | a | First value. |
| [in] | b | Second value. |
| [in] | s | Smoothing length (must be > 0). |