Description Usage Arguments Value See Also Examples
View source: R/simplification.R
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.
1 |
file |
Absolute or relative path to the input mesh; the following file formats are supported:
Text files are assumed to be structured as the AVS UCD ASCII files (.inp extension). |
An object of class mesh.2.5D
, provided with the following attributes:
nnodes
: number of nodes in the mesh;
nodes
: nnodes
-by-3 matrix collecting the coordinates of each vertex;
ntriangles
: number of triangles in the mesh;
triangles
: a ntriangles
-by-3 (when order
= 1) or ntriangles
-by-6 (when order
= 2) matrix. It specifies the triangles giving the row indices in nodes
of the triangles vertices and (when order
= 2) also of the triangles edges midpoints;
order
: either '1' or '2'. It specifies whether each mesh triangle should be represented by 3 nodes (the triangle vertices) or by 6 nodes (the triangle vertices and midpoints of the triangle edges). These are respectively used for linear (order
= 1) and quadratic (order
= 2) Finite Elements. Default is order
= 1.
simplify.mesh.2.5D
, plot.mesh.2.5D
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.