Skip to content

M_Rhino_Geometry_Brep_ClosestPoint_1

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

Brep.ClosestPoint Method (Point3d, Point3d, ComponentIndex, Double, Double, Double, Vector3d)

Finds a point on a brep that is closest to testPoint.

Namespace: Rhino.Geometry
Assembly: RhinoCommon (in RhinoCommon.dll) Version: Rhino 6.0

Syntax

C#

public bool ClosestPoint(
	Point3d testPoint,
	out Point3d closestPoint,
	out ComponentIndex ci,
	out double s,
	out double t,
	double maximumDistance,
	out Vector3d normal
)

VB

Public Function ClosestPoint ( 
	testPoint As Point3d,
	<OutAttribute> ByRef closestPoint As Point3d,
	<OutAttribute> ByRef ci As ComponentIndex,
	<OutAttribute> ByRef s As Double,
	<OutAttribute> ByRef t As Double,
	maximumDistance As Double,
	<OutAttribute> ByRef normal As Vector3d
) As Boolean

Parameters

 

testPoint
Type: Rhino.Geometry.Point3d
base point to project to surface.
closestPoint
Type: Rhino.Geometry.Point3d
location of the closest brep point.
ci
Type: Rhino.Geometry.ComponentIndex
Component index of the brep component that contains the closest point. Possible types are brep_face, brep_edge or brep_vertex.
s
Type: System.Double
If the ci type is brep_edge, then s is the parameter of the closest edge point.
t
Type: System.Double
If the ci type is brep_face, then (s,t) is the parameter of the closest edge point.
maximumDistance
Type: System.Double
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.Geometry.Vector3d
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.

Version Information

Supported in: 6.0.16224.21491, 5D58w

See Also

Reference

Brep Class
ClosestPoint Overload
Rhino.Geometry Namespace

Clone this wiki locally