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

Generic planar primitives. ,. More...

#include <sdf.h>

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

Public Member Functions

 SDFPrimitive2 ()
 Create a primitive.
 
virtual ~SDFPrimitive2 ()
 Destructor.
 
virtual double Signed (const Vector2 &) const
 Compute the signed distance function. More...
 
- 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 planar primitives. ,.

Member Function Documentation

◆ Signed()

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

Compute the signed distance function.

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

Parameters
pPoint.

Reimplemented from SDFNode2.

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