Learn R Programming

Rvcg (version 0.7.1)

vcgClost: Project coordinates onto a target triangular surface mesh.

Description

For a set of 3D-coordinates/triangular mesh, the closest matches on a target surface are determined and normals at as well as distances to that point are calculated.

Usage

vcgClost(x, mesh, sign = TRUE, barycentric = FALSE, smoothNormals = FALSE,
  borderchk = TRUE)

Arguments

x
k x 3 matrix containing 3D-coordinates or object of class "mesh3d".
mesh
triangular surface mesh stored as object of class "mesh3d".
sign
logical: if TRUE, signed distances are returned.
barycentric
logical: if TRUE, barycentric coordinates of the hit points are returned.
smoothNormals
logical: if TRUE, laplacian smoothed normals are used.
borderchk
logical: request checking if the hit face is at the border of the mesh.

Value

  • returns an object of class "mesh3d" with:
  • vb4 x n matrix containing n vertices as homolougous coordinates.
  • normals4 x n matrix containing vertex normals.
  • qualitynumeric vector containing distances to target.
  • it3 x m integer matrix containing vertex indices forming triangular faces.Only available, when x is a mesh.
  • borderinteger 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.
  • barycoords3 x m Matrix containing barycentric coordinates of closest points; only available if barycentric=TRUE.

References

Baerentzen, Jakob Andreas. & Aanaes, H., 2002. Generating Signed Distance Fields From Triangle Meshes. Informatics and Mathematical Modelling.

See Also

vcgPlyRead

Examples

Run this code
data(humface)
clost <- vcgClost(humface.lm, humface)

Run the code above in your browser using DataLab