Click or drag to resize

SubDClosestPoint Method (Point3d, Point3d, SubDComponentParameter)

Gets the point on this SubD's surface that is closest to a test point.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 9.0
Syntax
public bool ClosestPoint(
	Point3d testPoint,
	out Point3d closestPoint,
	out SubDComponentParameter parameter
)

Parameters

testPoint
Type: Rhino.GeometryPoint3d
The point to project onto this SubD.
closestPoint
Type: Rhino.GeometryPoint3d
The closest point is returned here, or Unset if this fails.
parameter
Type: Rhino.GeometrySubDComponentParameter
The parameter of the closest point is returned here, or Unset if this fails. Evaluating it with Evaluate(SubDComponentParameter, Point3d) returns closestPoint.

Return Value

Type: Boolean
True if a closest point was found.
Remarks
The search is refined on the surface itself, so the result is not limited to the surface mesh. The one exception is the corner of an extraordinary vertex, where the surface derivatives needed to refine are not available; there the result is the closest surface mesh point, so its accuracy is the accuracy of the surface mesh. Call UpdateSurfaceMeshCache(Boolean) first if you need more accuracy near extraordinary vertices.
See Also