Builtin Library
README.md
attribute.gather
Each element reads a column from the element its index names: element i of class takes name from element index(i) of the from class, of source when one is wired and of this geometry when not. What reads a neighbour, follows a parent, takes the value of the face a corner lies on, or copies values across from another geometry. An index naming no element reads zeros.
Inputs
geometry(Geometry). What receives the column. A copy comes out with the values written underason itsclass.index(Field | Float). For each element ofclass, the element whose value it takes: a whole number, 0 for the first. A field, a column, or one number every element shares.source(Geometry, optional). Where the values are read from. Left empty, the geometry reads from itself.name(String). Default"". The column read. A name thefromclass does not carry is refused.class(one of edge, point, vertex, primitive). Default"point". Which elements of the geometry read, each taking one value.from(one of "", edge, point, vertex, primitive). Default"". Which class of the source the index counts in. Left empty it isclass.as(String). Default"". The name the values are written under. Left empty it isname.
Outputs
geometry: the geometry with the gathered values, of the column's type, underas(orname) onclass.
Example
local points = g.points.grid({ countX = 4, countZ = 1, spacing = 1 })
local taken = g.attribute.gather({ geometry = points, index = 0, name = "P", as = "first" })
Every point's first holds the position of point 0.