Builtin Library
README.md
core.resample.curve (procNode)
Redistribute the points of every curve evenly by arc length: a fixed number per curve, or as many as fit a spacing.
Built from core.arclength, core.points (one row per new point, from the expand kernel over the per-curve counts), core.sample_curve, core.interpolate, and an exclusive scan for the new curves' starts. The result is curves again: vertex.pt runs through the new points in order and primitive.vstart, vcount and closed describe each curve; a curve's own attributes carry over.
Inputs
curve(Curves). The curves resampled.count(Number). Default16. At least 2. Points per curve whenspacingis 0.spacing(Number). Default0.0. At least 0. The distance between points; each curve takes as many as fit. 0 usescount.
Outputs
curve: the resampled curves. Each new point also carries the sampling attributescore.sample_curvewrites (prim,ia,ib,ic,bary,t,tangent) and thesandlengthofcore.arclength.
Example
local line = g.curve.line({ start = vector.create(0, 0, 0), finish = vector.create(4, 0, 0), segments = 4 })
local even = g.core.resample.curve({ curve = line, count = 9 })
Nine points spread evenly along the line, 0.5 apart.