import.mesh.2.5D: Instantiate a 'mesh.2.5D' object from file.

Description Usage Arguments Value See Also Examples

View source: R/simplification.R

Description

This function reads a surface mesh from file, and returns an object of class mesh.2.5D holding the list of nodes and triangles in the mesh. The parsing of the file is carried out at the C++ level for the sake of efficiency.

Usage

1

Arguments

file

Absolute or relative path to the input mesh; the following file formats are supported:

  • AVS UCD ASCII (extension .inp);

  • text files (extension .txt);

  • Legacy VTK (extension .vtk).

Text files are assumed to be structured as the AVS UCD ASCII files (.inp extension).

Value

An object of class mesh.2.5D, provided with the following attributes:

See Also

simplify.mesh.2.5D, plot.mesh.2.5D

Examples

1
2
3
4
5
6
7
8
9
## Import the mesh of a pawn
fpath <- system.file("extdata", "pawn_250.inp", package="meshsimp")
mesh <- import.mesh.2.5D(fpath)
## Simplify the mesh down to 200 nodes; assume the components of the
## edge cost functions are equally weighted and that the data locations
## coincide with the vertices of the mesh
out1 <- simplify.mesh.2.5D(mesh, 200)
## Resume the simplification procedure, reducing the mesh down to 150 nodes
out2 <- simplify.mesh.2.5D(out1$mesh, 150, out1$locations)

meshsimp documentation built on June 20, 2017, 9:05 a.m.