Click or drag to resize

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

Finds a point on the 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)
Syntax
public bool ClosestPoint(
	Point3d testPoint,
	out Point3d closestPoint,
	out ComponentIndex ci,
	out double s,
	out double t,
	double maximumDistance,
	out Vector3d normal
)

Parameters

testPoint
Type: Rhino.GeometryPoint3d
Base point to project to surface.
closestPoint
Type: Rhino.GeometryPoint3d
Location of the closest Brep point.
ci
Type: Rhino.GeometryComponentIndex
Component index of the Brep component that contains the closest point. Possible component index types are ComponentIndexType.BrepEdge and ComponentIndexType.BrepFace.
s
Type: SystemDouble
If ci.ComponentIndexType == ComponentIndexType.BrepEdge, then s is the parameter of the closest edge point.
t
Type: SystemDouble
If ci.ComponentIndexType == ComponentIndexType.BrepFace, then (s,t) is the parameter of the closest face point.
maximumDistance
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.
normal
Type: Rhino.GeometryVector3d
If ci.ComponentIndexType == ComponentIndexType.BrepEdge, then this is the tangent to the edge at s. If ci.ComponentIndexType == ComponentIndexType.BrepFace, then this is the normal to the face at (s,t).

Return Value

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