IBrepClosestPoint(Point3, Point3, ComponentIndex3, Double, Double, Double, Vector3) Method

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.

Definition

Namespace: Karamba.Geometry
Assembly: KarambaCommon (in KarambaCommon.dll) Version: 3.0.8.0+eb23a7103f0eca0b6d808121e15fec6899194e15
C#
bool ClosestPoint(
	Point3 testPoint,
	out Point3 closestPoint,
	out ComponentIndex3 ci,
	out double s,
	out double t,
	double maximumDistance,
	out Vector3 normal
)

Parameters

testPoint  Point3
base point to project to surface.
closestPoint  Point3
location of the closest brep point.
ci  ComponentIndex3
Component index of the brep component that contains the closest point. Possible types are brep_face, brep_edge or brep_vertex.
s  Double
If the ci type is brep_edge, then s is the parameter of the closest edge point.
t  Double
If the ci type is brep_face, then (s,t) is the parameter of the closest edge point.
maximumDistance  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  Vector3
The normal to the face if ci is a brep_face and the tangent to the edge if ci is brep_edge.

Return Value

Boolean
true if the operation succeeded; otherwise, false.

See Also