[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

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

if (FALSE) { 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) }