Lattice generation