Estimate the minimum distance between points in a point cloud.

min_distance(
  cloud,
  distance = "euclidean",
  threads = 1L,
  verbose = FALSE,
  progress = FALSE,
  ...
)

Arguments

cloud

A data.table with *XYZ* coordinates in the first three columns representing a point cloud.

distance

Type of distance to calculate. "euclidean" as default. Look hnsw_knn for more options.

threads

An integer specifying the number of threads to use for parallel processing. Experiment to see what works best for your data on your hardware.

verbose

If TRUE, log messages to the console.

progress

If TRUE, log a progress bar when verbose = TRUE. Tracking progress could cause a small overhead.

...

Arguments passed to hnsw_build and hnsw_search.

Value

A numeric vector describing the minimum distance between points.

Author

J. Antonio Guzmán Q.

Examples

data("pc_tree")

#Estimate the minimum distance of a sample o 100 points
min_distance(pc_tree)
#> [1] 0.05000007