Skip to content

M_Rhino_Geometry_Mesh_ClosestPoint_2

Will Pearson edited this page Aug 12, 2016 · 2 revisions

Mesh.ClosestPoint Method (Point3d, Point3d, Double)

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

Syntax

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

Parameters

 

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.

Return Value

Type: Int32
Index of face that the closest point lies on if successful. -1 if not successful; the value of pointOnMesh is undefined.

Version Information

Supported in: 6.0.16224.21491, 5D58w

See Also

Reference

Mesh Class
ClosestPoint Overload
Rhino.Geometry Namespace

Clone this wiki locally