Learn R Programming

MeshAgreement (version 0.1.4)

read_mesh: Read mesh files

Description

Read several mesh objects each for several observers from files.

Usage

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

Value

list (each component representing one observer) of lists of mesh objects. Each object is a list with components name, mesh, volume, centroid, where mesh is a cgalMesh object. Sample object given in data_heart_obsL. Use read_mesh_obs to read several mesh files from one observer. Use read_mesh_one to read a single mesh file.

Arguments

x

list of character vectors of file names. One vector for the files from one observer.

name

list of character vectors of mesh names that should be assigned to the mesh objects. If missing, names are taken from the file names.

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. Useful for meshes with defects such as not being closed or having self-intersections. "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. For subsequent comparison, the first file from observer 1 will be paired with the first file from observer 2, and so on.

See Also

cgalMesh, data_heart_obsL, read_mesh_obs, read_mesh_one,

Examples

Run this code
if(interactive()) {
    src_dir <- system.file("extdata", package="MeshAgreement")
    ff1     <- list.files(src_dir, pattern="^Obs01", full.names=TRUE)
    ff2     <- list.files(src_dir, pattern="^Obs02", full.names=TRUE)
    ff3     <- list.files(src_dir, pattern="^Obs03", full.names=TRUE)
    obsL    <- read_mesh(list(Obs01=ff1,
                              Obs02=ff2,
                              Obs03=ff3),
                         reconstruct="AFS")

    get_mesh_info(obsL)
}

Run the code above in your browser using DataLab