Learn R Programming

fmesher (version 0.3.0)

fm_bary_simplex: Extract Simplex information for Barycentric coordinates

Description

Extract the simplex vertex information for a combination of a mesh and fm_bary coordinates.

Usage

fm_bary_simplex(mesh, bary = NULL, ...)

# S3 method for fm_mesh_2d fm_bary_simplex(mesh, bary = NULL, ...)

# S3 method for fm_mesh_3d fm_bary_simplex(mesh, bary = NULL, ...)

# S3 method for fm_mesh_1d fm_bary_simplex(mesh, bary = NULL, ...)

# S3 method for fm_lattice_2d fm_bary_simplex(mesh, bary = NULL, ...)

# S3 method for fm_lattice_Nd fm_bary_simplex(mesh, bary = NULL, ...)

Value

A matrix of vertex indices, one row per point in bary.

Arguments

mesh

A mesh object, e.g. fm_mesh_2d or fm_mesh_1d.

bary

An fm_bary object. If NULL, return the full simplex information for the mesh.

...

Further arguments potentially used by sub-methods.

Methods (by class)

  • fm_bary_simplex(fm_mesh_2d): Extract the triangle vertex indices for a 2D mesh

  • fm_bary_simplex(fm_mesh_3d): Extract the tetrahedron vertex indices for a 3D mesh

  • fm_bary_simplex(fm_mesh_1d): Extract the edge vertex indices for a 1D mesh

  • fm_bary_simplex(fm_lattice_2d): Extract the cell vertex indices for a 2D lattice

  • fm_bary_simplex(fm_lattice_Nd): Extract the cell vertex indices for a ND lattice

See Also

fm_bary(), fm_bary_loc()

Examples

Run this code
bary <- fm_bary(fmexample$mesh, fmexample$loc_sf)
fm_bary_simplex(fmexample$mesh, bary)
mesh1 <- fm_mesh_1d(1:4)
(bary1 <- fm_bary(mesh1, seq(0, 5, by = 0.5)))
(bary1 <- fm_bary(mesh1, seq(0, 5, by = 0.5), restricted = TRUE))
fm_bary_simplex(mesh1, bary1)
m <- fm_lattice_2d(x = 1:3, y = 1:4)
bary <- fm_bary(m, cbind(1.5, 3.2))
fm_bary_simplex(m, bary)
m <- fm_lattice_Nd(list(x = 1:3, y = 1:4, z = 1:2))
(bary <- fm_bary(m, cbind(1.5, 3.2, 1.5)))
(fm_bary_simplex(m, bary))
fm_bary_loc(m, bary)

Run the code above in your browser using DataLab