geomc 1.0
A c++ linear algebra template library
Public Member Functions | List of all members
SdfEvaluable< T, N, Derived > Class Template Reference

Base class describing N-dimensional shapes which implement a signed distance function. More...

#include <geomc/shape/Shape.h>

Inheritance diagram for SdfEvaluable< T, N, Derived >:
Projectable< T, N, Cylinder< T, N > > Projectable< Shape::elem_t, Shape::N, Dilated< Shape > > Projectable< Shape::elem_t, Shape::N+1, Extrusion< Shape > > Projectable< T, N, Rect< T, N > > Projectable< T, N, Sphere< T, N > > Projectable< T, N, SphericalSector< T, N > > Projectable< T, N, Derived > Cylinder< T, N > Dilated< Shape > Extrusion< Shape > Rect< T, N > Sphere< T, N > SphericalSector< T, N >

Public Member Functions

sdf (Vec< T, N > p) const
 Signed distance function. More...
 
bool contains (Vec< T, N > p) const
 Shape-point overlap test. More...
 

Detailed Description

template<typename T, index_t N, typename Derived>
class geom::SdfEvaluable< T, N, Derived >

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.

Member Function Documentation

◆ contains()

bool contains ( Vec< T, N >  p) const
inline

Shape-point overlap test.

Return true if the point p is on the surface or interior of the shape, false otherwise.

◆ sdf()

T sdf ( Vec< T, N >  p) const
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.


The documentation for this class was generated from the following file: