convert_points_to_mesh: Convert 3-D coordinates to 3-D mesh

Description Usage Arguments Value Examples

View source: R/convert_points_to_mesh.R

Description

Computes alpha-shape of three-dimensional coordinates, see here for more info

Usage

1
convert_points_to_mesh(point_matrix, alpha, showme = TRUE)

Arguments

point_matrix

Coordinate data as matrix (individual points, x/y/z coordinates)

alpha

See ashape3d

showme

Return default 3D plot

Value

3D mesh

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
27
## 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

# RUN FUNCTION
mesh <- convert_points_to_mesh(point_matrix = point_matrix,
                               alpha = 1.2,
                               showme = FALSE)

# PLOT RESULT
rgl::open3d()
rgl::plot3d(mesh,
            type = "wire", col = "gray",
            box = FALSE, axes = FALSE,
            xlab = "", ylab = "", zlab = "",
            specular = "black")
rgl::aspect3d("iso")

## End(Not run)

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