Learn R Programming

Rvcg (version 0.7.1)

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)

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 will be read if available, otherwise all vertices will be colored white.
clean
if TRUE, duplicated and unreferenced vertices are removed (be careful when importing point clouds).

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)

See Also

vcgSmooth

Examples

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

Run the code above in your browser using DataLab