Skip to main content

NeighborSearch

Trait NeighborSearch 

Source
pub trait NeighborSearch {
    // Required methods
    fn knn_into(&self, query: &Vector3<f64>, k: usize, out: &mut Vec<Neighbor>);
    fn radius_into(
        &self,
        query: &Vector3<f64>,
        radius: f64,
        out: &mut Vec<Neighbor>,
    );

    // Provided methods
    fn knn(&self, query: &Vector3<f64>, k: usize) -> Vec<Neighbor> { ... }
    fn radius(&self, query: &Vector3<f64>, radius: f64) -> Vec<Neighbor> { ... }
}
Expand description

Nearest-neighbour search.

Implementations must honour the order defined by compare_neighbors.

Required Methods§

Source

fn knn_into(&self, query: &Vector3<f64>, k: usize, out: &mut Vec<Neighbor>)

The k nearest points to query, written into out, whose previous contents are discarded.

The buffer is supplied by the caller so that the ICP hot loop does not allocate once per point.

Source

fn radius_into( &self, query: &Vector3<f64>, radius: f64, out: &mut Vec<Neighbor>, )

Every point inside the ball of radius radius, written into out.

Provided Methods§

Source

fn knn(&self, query: &Vector3<f64>, k: usize) -> Vec<Neighbor>

Allocating convenience wrapper over knn_into.

Source

fn radius(&self, query: &Vector3<f64>, radius: f64) -> Vec<Neighbor>

Allocating convenience wrapper over radius_into.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§