Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

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 above threshold. Wired, it is what decides, and attribute is 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 wiring mask.
  • equals (String | Float, optional). Keep the points whose attribute equals this instead of testing it against threshold: a number, or a label (one of the texts a text attribute holds, or one of the names the points' detail labels gives 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 })