Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

ply2mesh

Import 3D surface mesh files


Description

Import 3D surface mesh files

Usage

file2mesh(filename, clean = TRUE, readcol = FALSE)

obj2mesh(filename, adnormals = TRUE)

ply2mesh(filename, adnormals = TRUE, readnormals = FALSE,
  readcol = FALSE, silent = FALSE)

Arguments

filename

character: path to file

clean

Logical: Delete dumpfiles.

readcol

Logical: Import vertex colors (if available).

adnormals

Logical: If the file does not contain normal information, they will be calculated in R: Can take some time.

readnormals

Logical: Import vertex normals (if available), although no face information is present.

silent

logical: suppress messages.

Details

imports 3D mesh files and store them as an R .object of class mesh3d

Value

mesh

list of class mesh3d - see rgl manual for further details, or a matrix containing vertex information or a list containing vertex and normal information

Examples

data(nose)
mesh2ply(shortnose.mesh)
mesh <- ply2mesh("shortnose.mesh.ply")

mesh2obj(shortnose.mesh)
mesh2 <- obj2mesh("shortnose.mesh.obj")
## cleanup
unlink(c("shortnose.mesh.obj","shortnose.mesh.ply"))

Morpho

Calculations and Visualisations Related to Geometric Morphometrics

v2.8
GPL-2
Authors
Stefan Schlager [aut, cre, cph], Gregory Jefferis [ctb], Dryden Ian [cph]
Initial release
2020-02-26

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.