write_surfaces: write_surfaces

View source: R/write_surfaces.R

write_surfacesR Documentation

write_surfaces

Description

Writes multiple meshes as PLY, STL, OBJ or VTK files

Usage

write_surfaces(surfaces = surfaces, pattern = c("PLY", "STL", "VTK", "OBJ"), binary = FALSE, print.progress = TRUE)

Arguments

surfaces

an object of the class "mesh_array" that contains two lists: a table with the meshes information (name, number of faces and vertices) and all the meshes that had previously been imported using the function import_surfaces.

pattern

Parameter indicating which format the meshes should be saved as. Options are _"PLY"_, _"STL"_, _"VTK"_ or _"OBJ"_.

binary

optional logical parameter indicating whether to write binary files (only for _"PLY"_ or _"STL"_). For more information check *?vcgStlWrite* and *?vcgPlyWrite* in Rvcg.

print.progress

optional parameter indicating whether to print the progress

Details

Takes an object of the class "mesh_array", which has been processed with the read_surfaces function, and saves the meshes as PLY, STL, or VTK meshes. The name of the meshes is (mesh_ID)_post.(mesht_type), for example, *mesh1_post.vtk*.

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

data(meshes)

# Example 1 - save VTK files
write_surfaces(surfaces = meshes, pattern = "VTK", print.progress = TRUE)

#' # Example 2 - save binary PLY files, don't print progress
write_surfaces(surfaces = meshes, pattern = "PLY", binary = TRUE, print.progress = FALSE)


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