Builtin Library
README.md
points.filter (procNode)
Keep the points whose mask field (or named attribute) is above a threshold, or whose named attribute equals a value or a label. Every point attribute and the detail come through with the points that stay. Given neither a mask nor an attribute, every point stays.
The value each point is tested by is the mask field or the named attribute's values; the test is > threshold or, with equals, == equals (a label read through its index). core.select keeps the elements and renumbers the linkage. mask and attribute given together test the mask, and equals then compares the mask with the label's index.
Built from: attribute.labels, g.compare, core.select.
Inputs
points(Geometry). The cloud to thin. Every point attribute and every detail value is carried onto the survivors.mask(Field, optional). The per-point value tested: a point stays when it is abovethreshold. Wired, it is what decides, andattributeis read only when this is empty.threshold(Float, default 0.5). A point stays when its value is strictly above this.attribute(String, optional). A point attribute to test instead of wiringmask.equals(String | Float, optional). Keep the points whoseattributeequals this instead of testing it againstthreshold: a number, or a label (one of the texts a text attribute holds, or one of the names the points' detaillabelsgives a numeric one).
Outputs
points(Geometry). The points that stay, in their order, with everything they carried.
local pts = g.points.grid({ countX = 4, countZ = 2 })
local back = g.points.filter({ points = pts, attribute = "id", threshold = 3.5 })
local third = g.points.filter({ points = pts, attribute = "id", equals = 2 })