Learn R Programming

Rvcg (version 0.12.2)

vcgImport: Import common mesh file formats.

Description

Import common mesh file formats and store the results in an object of class "mesh3d" - momentarily only triangular meshes are supported.

Usage

vcgImport(file, updateNormals = TRUE, readcolor = FALSE, clean = TRUE,
  silent = FALSE)

Arguments

file
character: file to be read.
updateNormals
logical: if TRUE and the imported file contais faces, vertex normals will be (re)calculated. Otherwise, normals will be a matrix containing zeros.
readcolor
if TRUE, vertex colors and texture (face and vertex) coordinates will be processed - if available, otherwise all vertices will be colored white.
clean
if TRUE, duplicated and unreferenced vertices as well as duplicate faces are removed (be careful when importing point clouds).
silent
logical, if TRUE no console output is issued.

Value

  • Object of class "mesh3d"

    with:

  • vb4 x n matrix containing n vertices as homolougous coordinates
  • it3 x m matrix containing vertex indices forming triangular faces
  • normals4 x n matrix containing vertex normals (homologous coordinates)
  • in case the imported files contains face or vertex quality, these will be stored as vectors named $quality (for vertex quality) and $facequality

    if the imported file contains vertex colors and readcolor = TRUE, these will be saved in $material$color according to "mesh3d" specifications.

See Also

vcgSmooth

Examples

Run this code
data(humface)
vcgPlyWrite(humface)
readit <- vcgImport("humface.ply")

Run the code above in your browser using DataLab