M_Rhino_Geometry_Mesh_ClosestPoint_2 - mcneel/rhinocommon-api-docs GitHub Wiki
Gets the point on the mesh that is closest to a given test point.
Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: Rhino 6.0
C#
public int ClosestPoint(
Point3d testPoint,
out Point3d pointOnMesh,
double maximumDistance
)
VB
Public Function ClosestPoint (
testPoint As Point3d,
<OutAttribute> ByRef pointOnMesh As Point3d,
maximumDistance As Double
) As Integer
- testPoint
- Type: Rhino.Geometry.Point3d
Point to seach for. - pointOnMesh
- Type: Rhino.Geometry.Point3d
Point on the mesh closest to testPoint. - maximumDistance
- Type: System.Double
Optional upper bound on the distance from test point to the mesh. If you are only interested in finding a point Q on the mesh when testPoint.DistanceTo(Q) < maximumDistance, then set maximumDistance to that value. This parameter is ignored if you pass 0.0 for a maximumDistance.
Type: Int32
Index of face that the closest point lies on if successful. -1 if not successful; the value of pointOnMesh is undefined.
Supported in: 6.0.16224.21491, 5D58w