Builtin Library
README.md
curve.strands (procNode)
Curves over points laid out one after another: curve k runs through the next counts[k] points. A curve of no points is dropped.
The vertex domain is one vertex per point reading its own point. The primitive domain has one curve per entry of counts: vstart is the running sum of the counts (geometry.offsets), vcount the counts, closed the flags. Curves with no points are removed by core.select; with device on, the counts of the curves that stay are kept on the device (curve.smooth and curve.grow). curve.branch ends here too.
Built from: geometry.offsets, core.select, member writes on the vertex and primitive domains.
Inputs
points(Geometry). The points, grouped by curve in order.counts(Column<Int>). How many points each curve takes.closed(Column<Int> | Int). Default0. 1 for a curve that closes, per curve or for all.device(Bool). Defaultfalse. Whether the counts of the curves stay on the device: the result holds the curves the points are allocated for and counts the kept ones there, and nothing is read back. Left off, the result is the exact size of the curves it holds.
Outputs
curve: the points as curves, one per count above 0, each withvstart,vcount,closedandcurve1 on its primitive.
Example
local points = g.points.grid({ countX = 6, countZ = 1 })
local strands = g.curve.strands({ points = points, counts = g.core.column({ values = { 2, 0, 4 } }) })
Two curves, of two and four points: vcount 2 and 4, vstart 0 and 2.