Signed Distance Fields 1.0
Public Member Functions | List of all members

Generic primitives. , ,. More...

#include <sdf.h>

Inheritance diagram for SDFEuclidean2:
SDFPrimitive2 SDFNode2 SDFBox2 SDFCapsule2 SDFCircle2 SDFCircleArc2 SDFConvex2 SDFCubicCurveSet2 SDFDisc2 SDFEllipse2 SDFHemiDisc2 SDFHexagon2 SDFIsoceleTrapezoid2 SDFPentagon2 SDFPolygon2 SDFQuadricCurveSet2

Public Member Functions

 SDFEuclidean2 ()
 Create an Euclidean primitive. More...
 
virtual ~SDFEuclidean2 ()
 Destructor.
 
virtual double Signed (const Vector2 &) const
 Compute the signed Euclidean distance function. More...
 
- Public Member Functions inherited from SDFPrimitive2
 SDFPrimitive2 ()
 Create a primitive.
 
virtual ~SDFPrimitive2 ()
 Destructor.
 
- Public Member Functions inherited from SDFNode2
 SDFNode2 ()
 Create a generic node. More...
 
virtual ~SDFNode2 ()
 Destructor.
 
virtual int Memory () const
 Return the size of a sub-tree.
 
virtual double K () const
 Return the Lipschitz constant of the node. More...
 
Box2 GetBox () const
 Return the bounding box of the node.
 
virtual int Nodes () const
 Compute the number of nodes in the sub-tree.
 

Additional Inherited Members

- Protected Attributes inherited from SDFNode2
Box2 box
 Box bounding the surface.
 
double k
 Lipschitz constant.
 
- Static Protected Attributes inherited from SDFNode2
static constexpr double Epsilon = 0.01
 Small constant used for bounding volumes.
 

Detailed Description

Generic primitives. , ,.

Constructor & Destructor Documentation

◆ SDFEuclidean2()

SDFEuclidean2::SDFEuclidean2 ( )
explicit

Create an Euclidean primitive.

Those primitives compute the signed Euclidean distance to a skeleton, thus the Lipschitz constant is 1.

Member Function Documentation

◆ Signed()

double SDFEuclidean2::Signed ( const Vector2 p) const
virtual

Compute the signed Euclidean distance function.

By default compute the signed distance to the bounding box of the primitive.

Parameters
pPoint.

Reimplemented from SDFPrimitive2.

Reimplemented in SDFDisc2, SDFHexagon2, SDFPentagon2, SDFBox2, SDFQuadricCurveSet2, SDFCubicCurveSet2, SDFEllipse2, SDFPolygon2, SDFConvex2, SDFCircleArc2, SDFIsoceleTrapezoid2, SDFCapsule2, SDFHemiDisc2, SDFCircle2, and SDFQuadricCurveSetThick2.