geomc 1.0
A c++ linear algebra template library
|
Base class describing N-dimensional shapes which implement a signed distance function. More...
#include <geomc/shape/Shape.h>
Public Member Functions | |
T | sdf (Vec< T, N > p) const |
Signed distance function. More... | |
bool | contains (Vec< T, N > p) const |
Shape-point overlap test. More... | |
Base class describing N-dimensional shapes which implement a signed distance function.
Uses the curiously-recurring template pattern to perform static polymorphism. Override sdf()
in the derived implemenation.
|
inline |
Shape-point overlap test.
Return true
if the point p
is on the surface or interior of the shape, false
otherwise.
|
inline |
Signed distance function.
Compute a signed distance to the nearest surface point on the shape. Points on the exterior have positive value; points on the interior have negative value; surface points have sdf value 0.