Rhino C++ API  8.14
Public Member Functions | Public Attributes | List of all members
ON_SignedDistanceFunction Class Referenceabstract

#include <opennurbs_plus_implicitfn.h>

Inheritance diagram for ON_SignedDistanceFunction:
ON_OffsetCurveSDF ON_PlaneSDF ON_SphereSDF

Public Member Functions

 ON_SignedDistanceFunction ()
 
virtual double Evaluate (const ON_3dPoint &p, ON_3dVector &normal) const =0
 

Public Attributes

int nEval
 

Detailed Description

Copyright (c) 1993-2022 Robert McNeel & Associates. All rights reserved. OpenNURBS, Rhinoceros, and Rhino3D are registered trademarks of Robert McNeel & Associates.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.

For complete openNURBS copyright information see http://www.opennurbs.org. An abstract base class for a signed distance function (SDF).

The SDF must be a non-manifold function that divides R3 into closed (possibly at infinity) regions of negative distance and positive distance, thereby defining a set of implicit boundaries where the SDF is equal to zero.

Constructor & Destructor Documentation

◆ ON_SignedDistanceFunction()

ON_SignedDistanceFunction::ON_SignedDistanceFunction ( )
inline

Member Function Documentation

◆ Evaluate()

virtual double ON_SignedDistanceFunction::Evaluate ( const ON_3dPoint p,
ON_3dVector normal 
) const
pure virtual

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.

Implemented in ON_OffsetCurveSDF, ON_SphereSDF, and ON_PlaneSDF.

Member Data Documentation

◆ nEval

int ON_SignedDistanceFunction::nEval