Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

mesh.lattice

Make owners equal lattices on the device, one after another. A "grid" lattice is count by across points on the unit square, x fastest, one quad a cell; a "fan" is count points, the centre and then count - 1 on the unit circle, with count - 1 triangles about the centre. Each point stands at its unit position, which the node answers as x and y for a formula to turn into the shape the lattice is cut for.

The lattices come from core.make; the node adds each point's unit position, its lattice and its place in it.

Inputs

  • shape ("grid" or "fan", default "grid"). Unit square lattice, or centre point and ring.
  • count (Number, default 2, at least 2). Points along the first axis of a grid, or points in a fan counting its centre.
  • across (Number, default 2, at least 2). Points along the second axis of a grid. A fan ignores it.
  • owners (Number, default 1, at least 1). How many lattices are made, each of the same size.

Outputs

  • geometry (Geometry). The points, vertices and primitives of every lattice, with unit positions in P.
  • x, y (Column<Float>). The unit position of each point.
  • owner (Column<Int>). The lattice each point belongs to, from 0.
  • place (Column<Int>). The place of each point in its lattice, from 0.
local lattice = g.mesh.lattice({ shape = "fan", count = 9, owners = 2 })
local made = lattice.geometry
made.point.P = vector.create(lattice.x, lattice.owner, lattice.y)