Click or drag to resize

RhinoListPoint2dKNeighbors Method

Finds a certain amour of points in a list of single-precision 2D points that are the k-closest to a test point. This method searches needlePoints by computing all distances from each point cloud point and keeping a "short list".

Namespace:  Rhino.Collections
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 6.0
public static IEnumerable<int[]> Point2dKNeighbors(
	IEnumerable<Point2d> hayPoints,
	IEnumerable<Point2d> needlePoints,
	int amount


Type: System.Collections.GenericIEnumerablePoint2d
A point cloud to be searched.
Type: System.Collections.GenericIEnumerablePoint2d
Points to search for.
Type: SystemInt32
The required amount of closest neighbors to find.

Return Value

Type: IEnumerableInt32
An enumerable of arrays of indices; each array contains the indices for each of the needlePts.
See Also