Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

group.write

Store a 0/1 mask as the group name of a class: the mask becomes an ordinary attribute column of that name, and the geometry's detail records that the column is a group, so group.list reports it even when nothing matched. The building block every node that makes a group ends in. A name starting with __ is refused: those names are the group markers the geometry keeps.

Inputs

  • geometry (Geometry). The geometry the group is written on. A copy carrying it comes out.
  • class (String, default "point", one of "edge", "point", "primitive", "vertex"). The element class the group lives on.
  • name (String, default ""). The name the group is written under.
  • mask (Field or Column<Float>). One value per element of class: 1 for a member, 0 for the rest.

Outputs

  • geometry (Geometry). The input carrying the group name on class.
local pts = g.points.grid({ countX = 4, countZ = 4 })
local marked = g.group.write({ geometry = pts, class = "point", name = "east", mask = g.where(g.compare(pts.point.P.x, "gt", 0), 1, 0) })