Learn R Programming

Rvcg (version 0.24)

vcgClostOnKDtreeFromBarycenters: search a KD-tree from Barycenters for multiple closest point searches on a mesh

Description

search a KD-tree from Barycenters for multiple closest point searches on a mesh

Usage

vcgClostOnKDtreeFromBarycenters(
  x,
  query,
  k = 50,
  sign = TRUE,
  barycentric = FALSE,
  borderchk = FALSE,
  angdev = NULL,
  weightnorm = FALSE,
  facenormals = FALSE,
  threads = 1
)

Value

returns an object of class "mesh3d" with:

vb

4 x n matrix containing n vertices as homolougous coordinates.

normals

4 x n matrix containing vertex normals.

quality

numeric vector containing distances to target.

it

3 x m integer matrix containing vertex indices forming triangular faces.Only available, when x is a mesh.

border

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.

barycoords

3 x m Matrix containing barycentric coordinates of closest points; only available if barycentric=TRUE.

Arguments

x

object of class "vcgKDtreeWithBarycenters"

query

matrix or triangular mesh containing coordinates

k

integer: check the kdtree for thek closest faces (using faces' barycenters).

sign

logical: if TRUE, signed distances are returned.

barycentric

logical: if TRUE, barycentric coordinates of the hit points are returned.

borderchk

logical: request checking if the hit face is at the border of the mesh.

angdev

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.

weightnorm

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)

facenormals

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.

threads

integer: threads to use in closest point search.

Author

Stefan Schlager

See Also

vcgCreateKDtreeFromBarycenters, vcgSearchKDtree, vcgCreateKDtree