Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

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.

SpecializeOptionsMeaning
STAGEhook, findthe 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)
MATCHposition, normalevery point within the radius is next to the point, or only one whose normal (nrm) is within cos_angle of its own
COUNTplain, deviceevery 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.