plot_3dpcs: Plot 3-D PCs

Description Usage Arguments Value Examples

Description

\lifecycle

experimental

Create and plot principal components of 3-D mesh data. If path to reference mesh is provided, existing mesh information will be used to create meshes; otherwise, alpha shape is computed

Usage

1
plot_3dpcs(input, ref, which_pcs = 1, vis_sd = 3, alpha = 1.2, ref_mesh = NULL)

Arguments

input

Object of class prcomp, gm.prcomp or PC_list (see make_pcs)

ref

Reference face used to visualize PCs (sample average is recommended)

which_pcs

Which PCs are to be created. Single number or vector (maximum number of PCs to plot is 3)

vis_sd

Extent of desired manipulation in units of standard deviation

alpha

See ashape3d. Tweak value to adjust appearance of your meshes

ref_mesh

Path to reference mesh

Value

Returns plot

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## Not run: 
path_to_ply <- system.file("extdata", "ply", package="facefuns")
data <- read_vertices(path_to_ply)
shapedata <- facefuns(data = data)

# PLOT MESHES
# Will rebuild mesh from point coordinates
rgl::open3d()
plot_3dpcs(input = shapedata$pc_plot, which_pcs = 1:2, ref = shapedata$average, alpha = 2)

# PLOT MESHES WITH REFERENCE MESH
# Will rebuild mesh from reference mesh
ref_mesh <- paste0(system.file("extdata", "obj", package="facefuns"), "/example.wavefront")

rgl::open3d()
plot_3dpcs(input = shapedata$pc_plot, which_pcs = 1:2, ref = shapedata$average, ref_mesh = ref_mesh)

## End(Not run)

iholzleitner/facefuns documentation built on March 19, 2021, 2:43 p.m.