Learn R Programming

geomorph (version 3.1.2)

read.ply: 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)

Value

Function returns the following components:

mesh3d

list of class mesh3d- see rgl for details

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.

See Also

rgl-package (used in 3D plotting)

Examples

Run this code
# 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 <- "gray" # using color word
myply$material <- "#FCE6C9" # using RGB code
# }

Run the code above in your browser using DataLab