Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

attribute.read

Read a named attribute of a class of a geometry as a column: the values every element of the class carries under that name. The column is what a field, a fold or a write takes as its values.

Inputs

  • geometry (Geometry). What carries the column.
  • class (one of detail, edge, point, primitive, vertex). Default "point". Which class of elements the attribute lives on.
  • name (String). Default "P". The name the column was written under. A name the class does not carry is refused.

Outputs

  • column: The attribute's column, of the type it was written as.

Example

local grid = g.mesh.grid({ size = { x = 2, z = 2 }, cells = { x = 2, z = 2 } })
local positions = g.attribute.read({ geometry = grid })

positions is the Vec3 column of the grid's nine point positions.