unsigned_distance
unsigned_distance(Q, V, F=None, use_cpp=True, cpp_aabb=None)
Unsigned distances from a set of points in space.
General-purpose function which computes the unsigned distance from a set of points to a mesh (in 3D) or polyline (in 2D). In 3D, this uses an AABB tree for efficient computation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
Q
|
(p,dim) numpy double array
|
Matrix of query point positions |
required |
V
|
(v,dim) numpy double array
|
Matrix of mesh/polyline/pointcloud coordinates |
required |
F
|
(f,s) numpy int array (optional
|
Matrix of mesh/polyline/pointcloud indices into V. If None, input is assumed to be an ordered closed polyline in 2D. |
None)
|
use_cpp
|
bool, optional (default False)
|
If True, uses a C++ implementation to compute the squared distances. This is much faster but requires compilation of the C++ code. |
True
|
cpp_aabb
|
gpytoolbox.squared_distance_precompute, optional (default None)
|
Precomputed AABB tree built via |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
unsigned_distances |
(p,) numpy double array
|
Vector of minimum unsigned distances |
indices |
(p,) numpy int array
|
Indices into F (or V, if F is None) of closest elements to each query point |
lmbs |
(p,s) numpy double array
|
Barycentric coordinates into the closest element of each closest mesh point to each query point |
See Also
squared_distance, squared_distance_precompute
Source code in src/gpytoolbox/unsigned_distance.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |