Click or drag to resize
MeshClosestPoint Method (Point3d, Point3d, Vector3d, Double)
Gets the point on the mesh that is closest to a given test point.

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: 5.1.50000.0 (5.0.20693.0)
public int ClosestPoint(
	Point3d testPoint,
	out Point3d pointOnMesh,
	out Vector3d normalAtPoint,
	double maximumDistance


Type: Rhino.GeometryPoint3d
Point to seach for.
Type: Rhino.GeometryPoint3d
Point on the mesh closest to testPoint.
Type: Rhino.GeometryVector3d
The normal vector of the mesh at the closest point.
Type: SystemDouble
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.
See Also