Rhino C++ API  8.11
Public Member Functions | Public Attributes | List of all members
ON_SphereSDF Class Reference

#include <opennurbs_plus_implicitfn.h>

Inheritance diagram for ON_SphereSDF:
ON_SignedDistanceFunction

Public Member Functions

 ON_SphereSDF (ON_3dPoint center, double radius)
 
double Evaluate (const ON_3dPoint &pt, ON_3dVector &normal) const override
 
- Public Member Functions inherited from ON_SignedDistanceFunction
 ON_SignedDistanceFunction ()
 

Public Attributes

const ON_3dPoint center
 
const double radius
 
- Public Attributes inherited from ON_SignedDistanceFunction
int nEval
 

Constructor & Destructor Documentation

◆ ON_SphereSDF()

ON_SphereSDF::ON_SphereSDF ( ON_3dPoint  center,
double  radius 
)
inline

Member Function Documentation

◆ Evaluate()

double ON_SphereSDF::Evaluate ( const ON_3dPoint p,
ON_3dVector normal 
) const
overridevirtual

Evaluate the signed distance function Parameters: p [in] - the point to evaluate the SDF at normal [out] - normal at the closest point on the SDF such that closestPt = pt - dist*normal/normal.Length() Returns: the distance between the closest point and the input point. Remarks:

  1. The returned distance can be ON_UNSET_VALUE when the SDF is unable to evaluate the distance
  2. The returned normal is not unitized and can have (almost) zero length.

You should account for both cases when using the SDF.

Implements ON_SignedDistanceFunction.

Member Data Documentation

◆ center

const ON_3dPoint ON_SphereSDF::center

◆ radius

const double ON_SphereSDF::radius