search a KD-tree from Barycenters for multiple closest point searches on a mesh
vcgClostOnKDtreeFromBarycenters(
x,
query,
k = 50,
sign = TRUE,
barycentric = FALSE,
borderchk = FALSE,
angdev = NULL,
weightnorm = FALSE,
facenormals = FALSE,
threads = 1
)
returns an object of class "mesh3d" with:
4 x n matrix containing n vertices as homolougous coordinates.
4 x n matrix containing vertex normals.
numeric vector containing distances to target.
3 x m integer matrix containing vertex indices forming triangular faces.Only available, when x is a mesh.
integer vector of length n: if borderchk = TRUE, for each clostest point the value will be 1 if the hit face is at the border of the target mesh and 0 otherwise.
3 x m Matrix containing barycentric coordinates of closest points; only available if barycentric=TRUE.
object of class "vcgKDtreeWithBarycenters"
matrix or triangular mesh containing coordinates
integer: check the kdtree for thek
closest faces (using faces' barycenters).
logical: if TRUE, signed distances are returned.
logical: if TRUE, barycentric coordinates of the hit points are returned.
logical: request checking if the hit face is at the border of the mesh.
maximum deviation between reference and target normals. If the none of the k closest triangles match this criterion, the closest point on the closest triangle is returned but the corresponding distance in $quality is set to 1e5.
logical if angdev is set, this requests the normal of the closest points to be estimated by weighting the surrounding vertex normals. Otherwise, simply the hit face's normal is used (faster but slightly less accurate)
logical: if TRUE only the facenormal of the face the closest point has hit is returned, the weighted average of the surrounding vertex normals otherwise.
integer: threads to use in closest point search.
Stefan Schlager
vcgCreateKDtreeFromBarycenters, vcgSearchKDtree, vcgCreateKDtree