Builtin Library
README.md
group.by_bounds
Group the elements inside a region: a box of size about center, a sphere of radius about it, or the half-space on the axis side of the plane through it. A point is read at its own position, a vertex at its point's, a primitive and an edge at the mean of their points; wire a position field to test any other placement. An element on the region's surface is inside.
Inputs
geometry(Geometry). The geometry the group is made on. A copy carrying the group comes out.position(Field<Vec3>, optional). Where each element is judged to stand. Left unwired, the class's own positions are used.name(String, default ""). The name the group is written under.class(String, default "point", one of "edge", "point", "primitive", "vertex"). The element class the group lives on.shape(String, default "box", one of "box", "plane", "sphere"). Which region is tested: the axis-aligned box ofsizeaboutcenter, the ball ofradiusabout it, or the half-space lying on theaxisside of the plane through it.center(Vec3, default (0, 0, 0)). Where the region sits: the box's and the sphere's centre, and the point the plane passes through.size(Vec3, default (1, 1, 1)). The box's full extent on each axis, so it reaches half of each component either way fromcenter.radius(Float, default 1). The ball's radius aboutcenter.axis(Vec3, default (0, 1, 0)). The direction the kept half-space lies in from the plane throughcenter. A zero-length axis withshape"plane" is refused.invert(Bool, default false). true takes the complement: every element of the class outside the region.
Outputs
geometry(Geometry). The input carrying the groupnameonclass.
local low = g.group.by_bounds({ geometry = g.mesh.box({}), name = "low", shape = "plane", center = vector.create(0, 0, 0), axis = vector.create(0, -1, 0) })