Hexagonal Lattice

Build a hexagonal lattice with periodic boundary conditions :

using CairoMakie
using LatticeMaker
L = HexagonalLattice(3, 4; periodic=(true, true))
Lattice{2}(UnitCell{2}(((1.0, 0.0), (0.5, 0.8660254037844386)), [(0.0, 0.0), (0.5, 0.28867513459481287)], [(1, (0, 0), 2), (1, (-1, 0), 2), (1, (0, -1), 2)]), (3, 4), (true, true))

Get the edges of the lattice:

edges(L)
36-element Vector{Vector{Int64}}:
 [1, 2]
 [1, 18]
 [1, 8]
 [9, 10]
 [2, 9]
 [9, 16]
 [17, 18]
 [10, 17]
 [17, 24]
 [3, 4]
 ⋮
 [7, 8]
 [7, 24]
 [6, 7]
 [15, 16]
 [8, 15]
 [14, 15]
 [23, 24]
 [16, 23]
 [22, 23]

Plot the lattice:

plot_lattice(L)
Example block output