Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

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 under as on its class.
  • index (Field | Float). For each element of class, 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 the from class 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 is class.
  • as (String). Default "". The name the values are written under. Left empty it is name.

Outputs

  • geometry: the geometry with the gathered values, of the column's type, under as (or name) on class.

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.