API Reference > OdDg Classes > OdDgCurveElement2d Class > OdDgCurveElement2d Methods > OdDgCurveElement2d::getClosestPointTo Method
OdDgCurveElement2d::getClosestPointTo Method
Syntax
C++
virtual OdResult getClosestPointTo(const OdGePoint2d& givenPoint, OdGePoint2d& pointOnCurve, bool extend = false) const;
Parameters 
Description 
const OdGePoint2d& givenPoint 
[in] Given point.  
OdGePoint2d& pointOnCurve 
[out] Receives the closed point on this Curve object.  
bool extend = false 
[in] Extends this Curve object if and only if true.  
normal 
[in] Normal to the projection plane. 

Returns eOk if successful, or an appropriate error code if not.

Returns the point on this Curve object closest to the given point. 

 

If normal is specified, this Curve object is projected onto the plane defined by givenPoint and normal, finds the closest point on the projected curve to givenPoint, and projects said closest point back onto the plane of this Curve object. It is this point that is returned as pointOnCurve.

Copyright © 2002–2021. Open Design Alliance. All rights reserved.