# RTree class

Namespace: [Rhino.Geometry](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.geometry.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
public class RTree : IDisposable
```

Represents a spatial search structure based on implementations of the R-tree algorithm by Toni Gutman.

**Remarks:** The opennurbs rtree code is a modified version of the free and unrestricted R-tree implementation obtained from http://www.superliminal.com/sources/sources.htm .

## Constructors

- [RTree](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/ctor.md): Initializes a new, empty instance of the tree.

## Finalizer

- [~RTree](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/finalize.md): Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().

## Properties

- [Count](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/count.md): Gets the number of items in this tree.

## Methods

- [Clear](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/clear.md): Removes all elements.
- [CreateFromPointArray](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/createfrompointarray.md): (static) Constructs a new tree with an element for each point cloud point.
- [CreateMeshFaceTree](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/createmeshfacetree.md): (static) Constructs a new tree with an element for each face in the mesh. The element id is set to the index of the face.
- [CreatePointCloudTree](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/createpointcloudtree.md): (static) Constructs a new tree with an element for each point cloud point.
- [Dispose](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/dispose.md): (2 overloads) Actively reclaims unmanaged resources that this instance uses.
- [Insert](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/insert.md): (6 overloads) Inserts an element into the tree.
- [Point3dClosestPoints](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/point3dclosestpoints.md): (static) Finds the point in a list of 3D points that is closest to a test point.
- [Point3dKNeighbors](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/point3dkneighbors.md): (static) Finds a certain amount of points in a list of 3D points that are the k-closest to a test point.
- [PointCloudClosestPoints](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/pointcloudclosestpoints.md): (static) Finds the point in a list of 3D points that is closest to a test point.
- [PointCloudKNeighbors](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/pointcloudkneighbors.md): (static) Finds a certain amount of points in a list of 3D points that are the k-closest to a test point.
- [Remove](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/remove.md): (5 overloads) Removes an element from the tree.
- [Search](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/search.md): (4 overloads) Searches for items in a bounding box. The bounding box can be singular and contain exactly one single point.
- [SearchOverlaps](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.rtree/searchoverlaps.md): (2 overloads) Searches for pairs of bounding boxes that overlap.
