Builtin Library
- ..
- .metadata204 B
- README.md1.7 KB
- init.luau5.2 KB
- make.module
README.md
core.make (procNode)
Make geometry on the device from a count for each owner and a shape. Every owner makes its own piece and the pieces sit end to end with their links already offset.
The make kernel's sizes pass, a prefix sum of the sizes, and the make kernel's fill pass; the columns are set into an empty geometry. The totals the fill pass is sized by come from the counts when every owner makes count (a row of points needs one multiplication, the other shapes one call of the make module); a count the graph states is a number already and the cook does not wait on the device for it, and a count left on the device is read back. When counts gives each owner its own, the totals are read back from the prefix sum.
Inputs
shape(one of points, strip, fan, grid, ring). Default"points". What each owner makes: a row of points, a zigzag of triangles, triangles round a centre, a lattice of quads, or one closed primitive round a circle.counts(Column<Int>). One count for each owner: the points along its main axis. Left out, every owner makescount.count(Number). Default0. At least 0. The points along the main axis of each owner whencountsis left out.owners(Number). Default1. At least 0. How many owners make a piece whencountsis left out.across(Number). Default2. At least 2. For the grid: how many points it holds along its second axis.
Outputs
geometry: the geometry withPon its points (the unit square or the unit circle),pton its vertices andvstartandvcounton its primitives; a ring also carriesclosed.
Example
local made = g.core.make({ shape = "grid", count = 3, across = 3 })
A 3 by 3 lattice: 9 points and 4 quads.