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 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). The surface may then 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.

Value

Function returns the following components:

mesh3d

list of class mesh3d- see rgl for details

Author(s)

Dean Adams & Emma Sherratt

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 July 5, 2026, 5:07 p.m.