declutterFrontier
declutterFrontier(
tree,frontier,t,width,height,opts,scratch?):Uint32Array
Defined in: network/lod.ts:1244
Thin an LOD frontier in screen space: keep higher-importance glyphs (by tree LODTree.weight = strength) and drop lower-importance ones that would overlap a kept glyph (centre distance < sum of the two radii). Greedy in descending importance over a uniform screen grid, so a dense cluster keeps its most important members and the kept set is overlap-free (no overdraw). Runs per cut, so it’s zoom-dependent — more glyphs resolve as you zoom in. Returns the kept frontier ids (original order).
Pass an engine-owned scratch (makeDeclutterFrontierScratch) to make the thinning
allocation-free steady-state (#213); the returned set is then a view of scratch.out, valid until
the next call with that scratch. Without it, every call allocates a private scratch.
Parameters
Section titled “Parameters”frontier
Section titled “frontier”Uint32Array
number
height
Section titled “height”number
scratch?
Section titled “scratch?”Returns
Section titled “Returns”Uint32Array