convert_points_to_knownmesh: Convert 3-D coordinates to 3-D mesh based on reference mesh

Description Usage Arguments Value Examples

Description

\lifecycle

experimental

Build triangle mesh3d object from 3-D coordinates based on reference mesh with homologous vertices

Usage

1
convert_points_to_knownmesh(point_matrix, obj)

Arguments

point_matrix

3-D coordinates to be visualized (rows = vertices, columns = coordinates)

obj

Path to reference mesh in OBJ format

Value

Object of class mesh3d

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 
# CREATE EXAMPLE POINT MATRIX
path_to_ply <- system.file("extdata", "ply", package="facefuns")
data <- read_vertices(path_to_ply)

shapedata <- facefuns(data = data,
                      pc_criterion = "broken_stick",
                      quiet = TRUE)

point_matrix <- shapedata$pc_plot$PC1$minus

# PATH TO EXAMPLE REFERENCE MESH
obj <- paste0(system.file("extdata", "obj", package="facefuns"), "/example.wavefront")

# RUN FUNCTION
mesh <- convert_points_to_knownmesh(point_matrix = point_matrix,
                                    obj = obj)

# PLOT RESULT
rgl::open3d()
rgl::shade3d(mesh,
             box = FALSE, axes = FALSE,
             xlab = "", ylab = "", zlab = "",
             col = "white", specular = "black")

## End(Not run)

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