Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

attribute.rename

Give a column another name: the same class, the same values and the same type, under as, and name removed. A column already called as on the class is replaced.

Inputs

  • geometry (Geometry). What carries the column. A copy comes out with the column under its new name.
  • class (one of detail, edge, point, primitive, vertex). Default "point". Which class of elements the column lives on.
  • name (String). Default "". The column's current name. A name the class does not carry is refused.
  • as (String). Default "". The name it takes. Empty is refused; the same name as name leaves the geometry as it is.

Outputs

  • geometry: the geometry with the column under as.

Example

local grid = g.mesh.grid({ size = { x = 2, z = 2 }, cells = { x = 2, z = 2 } })
local copied = g.attribute.copy({ geometry = grid, name = "P", as = "rest" })
local renamed = g.attribute.rename({ geometry = copied, name = "rest", as = "origin" })