fm_subset: Extract a subset of a mesh

View source: R/mesh.R

fm_subsetR Documentation

Extract a subset of a mesh

Description

[Experimental] (from version ⁠0.5.0.9003⁠) Constructs a new mesh based on a subset of the triangles of an existing mesh. The current version drops any edge constraint information from the mesh.

Usage

fm_subset(mesh, t_sub)

Arguments

mesh

an mesh to subset

t_sub

triangle or tetrahedron indices.

Value

A subset mesh.

Author(s)

Finn Lindgren Finn.Lindgren@gmail.com

Examples

mesh_sub <- fm_subset(fmexample$mesh, 1:100)
mesh_sub
plot(mesh_sub)

if (requireNamespace("geometry", quietly = TRUE)) {
  print(m <- fm_delaunay_3d(matrix(rnorm(30), 10, 3)))
  print(fm_subset(m, seq_len(min(5, nrow(m$graph$tv)))))
}

finnlindgren/fmesher documentation built on July 17, 2025, 1:04 a.m.