SpatialTree<T>
ReferencesProvides a spatial lookup tree for 3d point-like data. This class uses an adaptive octree-subdivision algorithm. If you're dealing with n-dimensional where n != 3, then you can use the SampleSet class in the Grasshopper2.Geometry.Clustering namespace.
Type parameters:
| T | Type of data to encapsulate. |
Constructors
Properties
Indexers
Methods
BuildTree
#Ensure the tree has been constructed.
public void BuildTree()
Remarks: This method locks, so check to see whether _root is null as a lightweight test.
Clear
#Remove all items from the tree. Although why you would want to do this instead of just creating just a new spatial tree is unclear.
public void Clear()
Difference
#Compute the difference along the x, y and z axes between two items.
FindCustom
#Perform a custom search.
public int[] FindCustom()
regionDelegate,
Delegate used for accepting/rejecting node regions.
locusDelegate
Delegate used for accepting/rejecting individual items.
Returns: Array of all indices that were found using the search delegates.
ForgetAbout
#Remove an item from the spatial lookup caches. This will prevent the item from being found using a Near or Far search, but it will not remove the item from this collection or affect the indices of other items.
FurthestItem
#Find the nearest item to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
FurthestItem
#Find the nearest item to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
FurthestItems
#Find the nearest items to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
FurthestItems
#Find the nearest items to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item to a search line.
public int NearestItem()
line,
Line of search.
minSearchRadius,
Minimum search distance.
maxSearchRadius
Maximum search distance.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item to a search line.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item using a custom distance metric.
public int NearestItem()
regionDelegate,
Delegate used for region distance metrics.
locusDelegate,
Delegate used for locus distance metrics.
minSearchRadius,
Minimum search distance.
maxSearchRadius
Maximum search distance.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item using a custom distance metric.
public int NearestItem()
regionDelegate,
Delegate used for region distance metrics.
locusDelegate
Delegate used for locus distance metrics.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item to a search locus.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItem
#Find the nearest item to a search locus.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItems
#Find the nearest item to a search line.
public int[] NearestItems()
line,
Line of search.
count,
Number of items to include.
minSearchRadius,
Minimum search distance.
maxSearchRadius
Maximum search distance.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItems
#Find the nearest item to a search line.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItems
#Find the nearest items to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItems
#Find the nearest items to a search point.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItems
#Find the nearest items using a custom distance metric.
public int[] NearestItems()
regionDelegate,
Delegate used for region distance metrics.
locusDelegate,
Delegate used for locus distance metrics.
count,
Number of items to include.
minSearchRadius,
Minimum search distance.
maxSearchRadius
Maximum search distance.
Returns: Integer of nearest item or -1 if no such item could be found.
NearestItems
#Find the nearest items using a custom distance metric.
public int[] NearestItems()
regionDelegate,
Delegate used for region distance metrics.
locusDelegate,
Delegate used for locus distance metrics.
count
Number of items to include.
Returns: Integer of nearest item or -1 if no such item could be found.
Optimize
#Optimize this tree. Optimized trees will have faster searches, but they become immutable. Any changes made to an optimized tree will result in the tree being rebuilt.
public void Optimize()