read_surfaces: read_surfaces

View source: R/read_surfaces.R

read_surfacesR Documentation

read_surfaces

Description

Imports multiple meshes' surfaces.

Usage

read_surfaces <- function(dir = NULL, pattern = pattern, files = NULL,
  target_faces = NULL, dec_percent = NULL, mesh_topo = FALSE, mesh_qual = FALSE,
  mesh_bound = FALSE, mergeVert = FALSE, vcgIsolated = FALSE, IsoFacenum = NULL,
  IsoDiameter = NULL, clean = FALSE, cleansed = NULL)

Arguments

pattern

string parameter that determines what type of mesh to import (e.g. 'ply' or 'stl')

files

Optional parameter. The default is all the files with a pattern (e.g. ply or stl).

target_faces

Number of target faces for all the meshes. For more information check *?vcgQEdecim* in Rvcg.

dec_percent

Degree of face reduction (from 0 to 1) across all meshes. For more information check *?vcgQEdecim* in Rvcg.

mesh_topo

Optional logical parameter, indicating if the mesh topology will be preserved across all the meshes. The default is FALSE. For more information check *?vcgQEdecim* in Rvcg.

mesh_qual

Optional logical parameter, indicating whether vertex quality will be considered across all the meshes. The default is FALSE. For more information check *?vcgQEdecim* in Rvcg.

mesh_bound

Optional logical parameter, indicating whether mesh boundary will be preserved across all the meshes. The default is FALSE. For more information check *?vcgQEdecim* in Rvcg.

mergeVert

Optional logical parameter to merge duplicated vertices across all meshes. For more information check *?mergeVertices* in rgl.

vcgIsolated

Optional parameter to remove isolated pieces. The default is FALSE. For more information check *?vcgIsolated* in Rvcg.

IsoFacenum

Optional parameter that determines the threshold to remove isolated pieces. The default is FALSE. For more information check *?vcgIsolated* in Rvcg.

IsoDiameter

Optional parameter that determines the threshold to remove isolated pieces (pices with an smaller diamter are removed). The default is FALSE. For more information check *?vcgIsolated* in Rvcg.

clean

Optional cleaning parameter from Rvcg that batch-cleans all meshes. The default is FALSE. For more information check *?vcgIsolated* in Rvcg.

dir

Optional parameter if the directory that contains the mesh is other than the current working directory. The default (NULL) is the current working directory.

cleansel

Optional cleaning parameter from Rvcg that determines which cleanign algorithms are applied across all meshes and in which order. The default (NULL) is options 0 to 6. For more information check *?vcgIsolated* in Rvcg.

Details

Imports multiple mesh files (e.g. PLY, STL) and batch-processes them (e.g. reducing the number of faces, merging vertices, removing isolated pieces, etc. with a few functions from Rvcg). For more information check the R package Rvcg (Schlager, 2017)

Value

This function returns an object of the class 'mesh_array' will keep the dimnames associated with each mesh (which correspond to the filenames).

Author(s)

Marta Vidal-Garcia

References

Schlager S (2017). “Morpho and Rvcg - Shape Analysis in R.” In Zheng G, Li S, Szekely G (eds.), _Statistical Shape and Deformation Analysis_, 217-256. Academic Press. ISBN 9780128104934.

Examples

# PLY meshes
dir <- "./data/"

# Import PLY meshes without any processing
test1 <- read_surfaces(dir = "./data", pattern = "ply")

# Import STL meshes and reduce number of faces
test2 <- read_surfaces(dir = dir, files = NULL, pattern = "stl", target_faces = 50000, clean = TRUE)


marta-vidalgarcia/mesh_process documentation built on May 7, 2022, 12:08 a.m.