# KdTree class

Namespace: [Grasshopper2.Geometry.Clustering](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.geometry.clustering.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public class KdTree : IDimensional
```

Represents an immutable kD-tree associated with a sample set.

## Constructors

- [KdTree](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/ctor.md): (2 overloads) Create a new kD tree.

## Properties

- [Description](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/description.md): Gets a description of this object type.
- [Dimensionality](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/dimensionality.md): Gets the dimensionality of this object.
- [LeafCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/leafcount.md): Gets the total number of leaf nodes in this tree.
- [NodeCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/nodecount.md): Gets the total number of nodes in this tree.
- [ParentSet](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/parentset.md): Gets the sample set associated with this cluster.

## Methods

- [AddToRhino](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/addtorhino.md): Adds the first 3 dimensions of this tree to Rhino. This is for debugging purposes.
- [Find](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/find.md): Find the closest point.
- [FindMultiple](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/findmultiple.md): (3 overloads) Find the element(s) closest to a search point.
- [LeafMeans](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/leafmeans.md): Return all leaf means.
- [MergeLeaves](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/mergeleaves.md): Reduce the leaf count of this tree to a specific target.
- [Pull](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/pull.md): Pull a collection of points onto the points.
- [SuperImpose](https://developer.rhino3d.com/api/gh2/type/grasshopper2.geometry.clustering.kdtree/superimpose.md): Find the closest point in another tree for every point in this tree.
