public class KdTree : IDimensional
Represents an immutable kD-tree associated with a sample set.

Constructors

KdTree

#
public KdTree(ISampleSet parentSet, int maximumCount, int maximumDepth)
Create a new kD tree.
parentSet (ISampleSet)Sample set associated with this tree.
maximumCount (int)Maximum number of samples per spatial region.
maximumDepth (int)Maximum number of hierarchical subdivisions.

KdTree

#
public KdTree(ISampleSet parentSet)
Create a new kD tree.
parentSet (ISampleSet)Sample set associated with this tree.

Properties

Description

#
public string Description { get; }
Gets a description of this object type.
Description

Dimensionality

#
public int Dimensionality { get; }
Gets the dimensionality of this object.
Dimensionality

LeafCount

#
public int LeafCount { get; }
Gets the total number of leaf nodes in this tree.

NodeCount

#
public int NodeCount { get; }
Gets the total number of nodes in this tree.

ParentSet

#
public ISampleSet ParentSet { get; }
Gets the sample set associated with this cluster.

Methods

AddToRhino

#
[EditorBrowsable(EditorBrowsableState.Never)] public Guid[] AddToRhino(RhinoDoc doc)
Adds the first 3 dimensions of this tree to Rhino. This is for debugging purposes.
doc (RhinoDoc)Doc to add to.
List of objects ids that were added.

Find

#
public int Find(PointN location, double minimumQuadrance, double maximumQuadrance, HashSet<int> indexFilter)
Find the closest point.
location (PointN)Location to search from.
minimumQuadrance (double)Points whose quadrance is less than this value will be omitted from the search.
maximumQuadrance (double)Points whose quadrance is greater than this value will be omitted from the search.
indexFilter (HashSet<int>)Optional collection of indices to ignore during the search.
Index to closest point.

FindMultiple

#
public KdTreeSearchResults FindMultiple(PointN location, int maximumCount, double minimumQuadrance, double maximumQuadrance, HashSet<int> indexFilter)
Find the element(s) closest to a search point.
location (PointN)Search location.
maximumCount (int)Maximum number of points to include in the result.
minimumQuadrance (double)Points whose quadrance is less than this value will be omitted from the search.
maximumQuadrance (double)Points whose quadrance is greater than this value will be omitted from the search.
indexFilter (HashSet<int>)Collection of indices to omit from the search.
Search results.

FindMultiple

#
public KdTreeSearchResults FindMultiple(PointN location, int maximumCount, double minimumQuadrance, double maximumQuadrance)
Find the element(s) closest to a search point.
location (PointN)Search location.
maximumCount (int)Maximum number of points to include in the result.
minimumQuadrance (double)Points whose quadrance is less than this value will be omitted from the search.
maximumQuadrance (double)Points whose quadrance is greater than this value will be omitted from the search.
Search results.

FindMultiple

#
public KdTreeSearchResults FindMultiple(PointN location, int maximumCount)
Find the element(s) closest to a search point.
location (PointN)Search location.
maximumCount (int)Maximum number of points to include in the result.
Search results.

LeafMeans

#
public PointN[] LeafMeans(KdMeanSelectionPrecedence precedence, KdMeanType type)
Return all leaf means.
precedence (KdMeanSelectionPrecedence)Enumeration order.
type (KdMeanType)Mean type.
Sorted collection of leaf means.

MergeLeaves

#
public KdTree MergeLeaves(int leafTarget, KdLeafMergePrecedence precedence)
Reduce the leaf count of this tree to a specific target.
leafTarget (int)Target count.
precedence (KdLeafMergePrecedence)Merging precedence.
Reduced tree.

Pull

#
public int[] Pull(PointN[] points, bool reusePoints)
Pull a collection of points onto the points.
points (PointN[])Points to pull.
reusePoints (bool)If true, more than one point may be pulled onto the same tree point.
Pulled points.

SuperImpose

#
public int[] SuperImpose(KdTree otherTree)
Find the closest point in another tree for every point in this tree.
otherTree (KdTree)Tree to match.
An array of integers, specifying for each point in this tree what point in the other tree is closest.