Read mesh data (vertices and faces) from ply files
A function to read ply files, which can be used for digitizing landmark coordinates or for shape warps.
read.ply(file, ShowSpecimen = TRUE, addNormals = TRUE)
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 |
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
.
Function returns the following components:
mesh3d |
list of class mesh3d- see rgl for details |
Dean Adams & Emma Sherratt
rgl-package
(used in 3D plotting)
# 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
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.