Signed Distance Fields 1.0
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
SDFNode2 Class Referenceabstract

Base planar signed distance node. ,. More...

#include <sdf.h>

Inheritance diagram for SDFNode2:
SDFBinary2 SDFPrimitive2 SDFUnary2 SDFDifference2 SDFIntersection2 SDFSmoothDifference2 SDFSmoothIntersection2 SDFSmoothUnion2 SDFUnion2 SDFEuclidean2 SDFPseudoAxialSquadricSwept SDFNoise2 SDFPlanarSymmetry2 SDFRotate2 SDFRound2 SDFScale2 SDFThickSurface2 SDFTranslate2 SDFTurbulence2 SDFUniformScale2

Public Member Functions

 SDFNode2 ()
 Create a generic node. More...
 
virtual ~SDFNode2 ()
 Destructor.
 
virtual double Signed (const Vector2 &) const
 Compute the signed distance. More...
 
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.
 

Protected Attributes

Box2 box
 Box bounding the surface.
 
double k
 Lipschitz constant.
 

Static Protected Attributes

static constexpr double Epsilon = 0.01
 Small constant used for bounding volumes.
 

Detailed Description

Base planar signed distance node. ,.

Constructor & Destructor Documentation

◆ SDFNode2()

SDFNode2::SDFNode2 ( )
explicit

Create a generic node.

Internally set Lipschitz bound to 1.0.

Member Function Documentation

◆ K()

double SDFNode2::K ( ) const
virtual

Return the Lipschitz constant of the node.

By default, nodes are considered as signed Euclidean distance functions, and the Lipschitz consistant is λ=1.

Reimplemented in SDFUnary2.

◆ Signed()

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