Skip to contents

[Experimental] Create hexagon lattice points within a boundary

Usage

fm_hexagon_lattice(bnd, edge_len = NULL, buffer_n = 1)

Arguments

bnd

Boundary object

edge_len

Triangle edge length

buffer_n

Number of edge length multiples for buffer inside the boundary object to the start of the lattice. Default 1.

Value

A list with lattice points, edge length, and inner boundary

Author

Man Ho Suen M.H.Suen@sms.ed.ac.uk, Finn Lindgren Finn.Lindgren@gmail.com

Examples

(m <- fm_mesh_2d(
  fm_hexagon_lattice(
    fmexample$boundary_sf[[1]],
    edge_len = 0.1
  )$lattice,
  max.edge = c(0.2, 1),
  boundary = fmexample$boundary_sf,
  min.angle = c(32, 21)
))
#> fm_mesh_2d object:
#>   Manifold:	R2
#>   V / E / T:	2308 / 6877 / 4570
#>   Euler char.:	1
#>   Constraints:	Boundary: 44 boundary edges (1 group: 1), Interior: 131 interior edges (1 group: 1)
#>   Bounding box: (-5.331027, 4.061656) x (-3.998161, 5.415609)
#>   Basis d.o.f.:	2308
if (require("ggplot2", quietly = TRUE)) {
  ggplot() +
    geom_fm(data = m)
}