Builtin Library
- ..
- README.md1.6 KB
- bindings.yaml2.4 KB
- shader.wgsl1.7 KB
README.md
hash_hook
One hooking round of the connected sets of the points that stand within a radius of each other, searched through
the spatial hash the hash and hash_starts kernels build. label names each point's root, and every point of a set
names the same root (a star); hooked starts as a copy of label. Every point walks the points within the radius and
lowers the entry of its own root in hooked to the smallest root among them, so after the round each root links to
the smallest root next to its set, or to itself. Links only ever point at a smaller root, so they form a forest, and
the find stage, which follows each point's links in hooked to their end and lowers its entry to that root, makes
every set a star again.
| Specialize | Options | Meaning |
|---|---|---|
STAGE | hook, find | the hooking round over the hash (binds pts, order, range, label, hooked), or the walk of each point's links to its root (binds hooked alone) |
MATCH | position, normal | every point within the radius is next to the point, or only one whose normal (nrm) is within cos_angle of its own |
COUNT | plain, device | every slot is live, or the live count is read from domain_count |
A round of hooking then finding halves the number of sets that still have a neighbouring set every two rounds, so
twice as many rounds as the bits of the number of points leave every set a star of its smallest point. core.weld
folds that many rounds, with no read-back. Exact: the smallest root wins whatever order the invocations run in.