Builtin Library
README.md
group.combine
Set algebra between two groups of the same class: union, intersect, subtract (name without other), or xor. The result is written as the group named by as, which may be name or other to replace one of them. A name that is not a group of class is refused.
Inputs
geometry(Geometry). The geometry carrying both groups. A copy carrying the combined group comes out.as(String, default ""). The name the result is written under. Passing the value ofnameor ofotherreplaces that group.class(String, default "point", one of "edge", "point", "primitive", "vertex"). The element class both groups live on.name(String, default ""). The group on the left of the operation.other(String, default ""). The group on the right of the operation, the one subtracted under "subtract".op(String, default "union", one of "intersect", "subtract", "union", "xor"). The set operation: union takes an element in either, intersect only in both, subtract innameand notother, xor in exactly one of the two.
Outputs
geometry(Geometry). The input carrying the groupasonclass.
local box = g.group.by_normal({ geometry = g.mesh.box({}), name = "top", class = "primitive", angle = 10 })
box = g.group.by_normal({ geometry = box, name = "bottom", class = "primitive", direction = vector.create(0, -1, 0), angle = 10 })
local caps = g.group.combine({ geometry = box, class = "primitive", name = "top", other = "bottom", op = "union", as = "caps" })