Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commite8beb5604c

README.md

group.reach

Which elements of a class touch the selection one ring out: for each connector class the elements meet at (points for faces and edges, edges for points, points and faces for corners) the selection is folded across the connector and back, and the connectors combine. With op = "max" an element reaches when any neighbour through any connector is selected; with "min" when every neighbour through every connector is. What group.expand and group.shrink take a ring from. A geometry with no primitives is refused, since neighbours come from the primitives.

Inputs

  • geometry (Geometry). The geometry whose connectivity the ring follows.
  • class (String, default "point", one of "edge", "point", "primitive", "vertex"). The element class the selection lives on.
  • member (Field or Column<Float>). One value per element of class: above 0.5 is selected.
  • op (String, default "max", one of "max", "min"). "max": an element reaches when any neighbour is selected. "min": when every neighbour is.

Outputs

  • mask (Float per element of class). 1 for each element that reaches, 0 for the rest.
local tops = g.group.by_normal({ geometry = g.mesh.sphere({}), name = "top", class = "primitive", angle = 20 })
local ring = g.group.reach({ geometry = tops, class = "primitive", member = tops.primitive.top, op = "max" })