Click or drag to resize

BrepClosestPoint Method (Point3d, Point3d, ComponentIndex, Double, Double, Double, Vector3d)

Finds a point on a Brep that is closest to testPoint. The method searches all Brep faces looking for the one closest to testPoint. When found, if the closest point falls on the inactive region of the face, then the method finds the face's edge that is closest to testPoint.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 5.0
public bool ClosestPoint(
	Point3d testPoint,
	out Point3d closestPoint,
	out ComponentIndex ci,
	out double s,
	out double t,
	double maximumDistance,
	out Vector3d normal


Type: Rhino.GeometryPoint3d
base point to project to surface.
Type: Rhino.GeometryPoint3d
location of the closest brep point.
Type: Rhino.GeometryComponentIndex
Component index of the brep component that contains the closest point. Possible types are brep_face, brep_edge or brep_vertex.
Type: SystemDouble
If the ci type is brep_edge, then s is the parameter of the closest edge point.
Type: SystemDouble
If the ci type is brep_face, then (s,t) is the parameter of the closest edge point.
Type: SystemDouble
If maximumDistance > 0, then only points whose distance is <= maximumDistance will be returned. Using a positive value of maximumDistance can substantially speed up the search.
Type: Rhino.GeometryVector3d
The normal to the face if ci is a brep_face and the tangent to the edge if ci is brep_edge.

Return Value

Type: Boolean
true if the operation succeeded; otherwise, false.
See Also