read.ply: Read mesh data (vertices and faces) from ply files

read.plyR Documentation

Read mesh data (vertices and faces) from ply files

Description

A function to read ply files, which can be used for digitizing landmark coordinates or for shape warps.

Usage

read.ply(file, ShowSpecimen = TRUE, addNormals = TRUE)

Arguments

file

An ASCII ply file

ShowSpecimen

logical Indicating whether or not the ply file should be displayed

addNormals

logical Indicating whether or not the normals of each vertex should be calculated (using addNormals)

Details

Function reads three-dimensional surface data in the form of a single ply file (Polygon File Format; ASCII format only, from 3D scanners such as NextEngine and David scanners). Vertices of the surface may then be used to digitize three-dimensional points, and semilandmarks on curves and surfaces. The surface may also be used as a mesh for visualizing 3D deformations (warpRefMesh). The function opens the ply file and plots the mesh, with faces rendered if file contains faces, and colored if the file contains vertex color. Vertex normals allow better visualization and more accurate digitizing with digit.fixed.

Value

Function returns the following components:

mesh3d

list of class mesh3d- see rgl for details

Author(s)

Dean Adams & Emma Sherratt

See Also

rgl-package (used in 3D plotting)

Examples

## Not run: 
# If the file has no mesh color, or color is undesirable, user can 
# assign this as follows:
# Using the example scallop PLY
data(scallopPLY) 
myply <- scallopPLY$ply
myply$material$color <- "gray" # using color word
myply$material$color <- "#FCE6C9" # using RGB code

## End(Not run)

geomorph documentation built on June 24, 2024, 5:07 p.m.