fm_hexagon_lattice: Create hexagon lattice points

View source: R/mesh_2d.R

fm_hexagon_latticeR Documentation

Create hexagon lattice points

Description

[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(s)

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)
))
if (require("ggplot2", quietly = TRUE)) {
  ggplot() +
    geom_fm(data = m)
}

finnlindgren/fmesher documentation built on April 5, 2025, 1:55 a.m.