Rhino C++ API  8.13
Public Member Functions | List of all members
ON_OffsetCurveSDF Class Reference

#include <opennurbs_plus_implicitfn.h>

Inheritance diagram for ON_OffsetCurveSDF:
ON_SignedDistanceFunction

Public Member Functions

 ON_OffsetCurveSDF (const ON_Curve &curve, double distance)
 
double Evaluate (const ON_3dPoint &pt, ON_3dVector &normal) const override
 
- Public Member Functions inherited from ON_SignedDistanceFunction
 ON_SignedDistanceFunction ()
 

Additional Inherited Members

- Public Attributes inherited from ON_SignedDistanceFunction
int nEval
 

Constructor & Destructor Documentation

◆ ON_OffsetCurveSDF()

ON_OffsetCurveSDF::ON_OffsetCurveSDF ( const ON_Curve curve,
double  distance 
)
inline

Member Function Documentation

◆ Evaluate()

double ON_OffsetCurveSDF::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.