DistanceQueries.jl
Introduction
DistanceQueries
provides distance queries to sets of points and sets of simplices – lines, triangles, tetrahedra – spanned by points. It aims at computing shortest distances to polygonal curves, triangle meshes, and tetrahedral meshes. This includes projections and point-location queries.
There is no guarantee that a kd-tree is efficient for nearest-neighbor queries on sets of simplices! This holds only if one can assume that a simplex does not span too many cells in the kd-tree! This is typically the case in our applications.
Distance to tetrahedra and tetrahedral meshes is currently not implemented.
Differences to NearestNeighbors.jl
- Restrictions
- We currently support only kd-trees.
- We currently support only finding the one nearest neighbor.
- We support only the Euclidean distance as metric.
- We focus on a small number of dimensions like 2d and 3d, and, e.g., not clustering in high dimensional spaces.
- We are similarly efficient. However, we cannot partition sets of simplicies as one simplex may appear in in both childs of a kd-tree node. This leads to some extra overhead.
- Additional features
- We support finding the nearest point on one element of a set of simplices using a kd-tree.
- We provide methods for computing distances or projections to one single simplex.
If you are working with point sets exclusively, use NearestNeighbors.jl!
Installation
julia> using Pkg
julia> Pkg.Registry.add("https://visual2.cs.ovgu.de/roessl/VCJuliaRegistry.git")
julia> Pkg.add("DistanceQueries")
julia> using DistanceQueries