Builtin Library
README.md
geometry.selected
Which primitives of a geometry a group selects, as a column of 1 and 0 over the primitives. A group on the primitive class is read once per primitive; a group on the point or vertex class selects a primitive only when every one of its corners is above threshold. With no group named, every primitive is selected. geometry.extrude, geometry.solidify and the other nodes with a group input read their selection through it.
Inputs
geometry(Geometry). The geometry whose primitives are selected.group(String, default ""). The attribute holding the selection, a number per element. Left empty, every primitive is selected.class(String, default "primitive", one of "point", "primitive", "vertex"). The class the group lives on.threshold(Float, default 0.5). The value a group element has to exceed to count as a member, which turns a continuous attribute (a mask, a noise field) into a selection.
Outputs
mask(Column<Float>). 1 for each selected primitive, 0 for the rest.
local box = g.group.by_normal({ geometry = g.mesh.box({}), name = "top", class = "primitive", angle = 10 })
local mask = g.geometry.selected({ geometry = box, group = "top" })