## 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)
Run the code above in your browser using DataLab