Builtin Library
README.md
attribute.number
Number the elements of a class: a whole-number column holding start on the first element, start + 1 on the second, and so on, written under name. The number is stored with the element, so it stays with it when elements are dropped, reordered or duplicated around it.
Inputs
geometry(Geometry). What is numbered. A copy carrying the column comes out.class(one of detail, edge, point, primitive, vertex). Default"point". Which elements are numbered.name(String). Default"". What the column is called. A name the class already carries is replaced. Empty is refused.start(Float). Default0. The number of the first element.
Outputs
geometry: the geometry with the Int column undernameonclass.
Example
local grid = g.mesh.grid({ size = { x = 2, z = 2 }, cells = { x = 2, z = 2 } })
local numbered = g.attribute.number({ geometry = grid, class = "primitive", name = "face", start = 1 })
The grid's eight primitives hold face 1 to 8.