Learn R Programming

MeshAgreement (version 0.1.4)

read_mesh_one: Read one mesh file

Description

Read one mesh object from a file.

Usage

read_mesh_one(x, name, fix_issues=TRUE,
              reconstruct=c("No", "AFS", "Poisson"),
              spacing=1)

Value

Mesh object - a list with components name, mesh, volume, centroid, where mesh is a cgalMesh object. Use read_mesh to read a list of several mesh objects each for several observers. Use read_mesh_obs to read a list of several mesh objects each for 1 observer.

Arguments

x

character. File name.

name

character. Name that should be assigned to the mesh object. If missing, the name is taken from the file name.

fix_issues

logical. Try to fix mesh issues, such as not being closed, not bounding a volume, or having self-intersections. Uses surface reconstruction if mesh is not closed.

reconstruct

character. Use "No" for no reconstruction. "AFS" uses the AFSreconstruction method of the cgalMesh class to re-build the triangles from the vertices. "Poisson" currently not implemented and falls back to AFS.

spacing

Controls vertex spacing for reconstruct="Poisson". Currently not implemented.

Details

Supported file formats: STL, PLY, OBJ, OFF.

See Also

cgalMesh, read_mesh, read_mesh_obs,

Examples

Run this code
if(interactive()) {
    src_dir <- system.file("extdata", package="MeshAgreement")
    ff      <- list.files(src_dir, pattern="^Obs01", full.names=TRUE)
    mesh    <- read_mesh_one(ff[1], reconstruct="AFS")
    get_mesh_info_one(mesh)
}

Run the code above in your browser using DataLab