WASM backend (compiled or TS-reference fallback) supplying
the projection kernels. Obtain via getPointsBackend(ndim).
OptionaltargetBuffers: ProjectionTargetBuffers | null
Optional accumulator buffers for zero-allocation operation. When provided, writes directly through; when null/undefined, allocates new arrays for the result.
Optionalscalars: optional per-point scalars for colormap lookup.
Components per color item: 3 = RGB (default), 4 = RGBA (the alpha column is per-point opacity). Strides every color guard/compaction below — a hardcoded 3 would truncate + misalign RGBA data (the gsplat colorK lesson).
Project nD points to 3D display space on the main thread, WASM-accelerated.
The two expensive steps — nD→3D extraction and effective-radius computation — run through the compiled WASM kernels (
extract_3d_positions,calculate_effective_radii) on thewasmmodule the caller supplies (compiled WASM, or the uncapped TS reference forndim > 16— seegetPointsBackend). The zero-radius filter, multi-type compaction, uint8-radius/255normalization, scalar handling, and bounds stay in TypeScript: they are cheap, multi-type, and tightly coupled to the accumulator's in-place reuse contract.Points run on the main thread (not a worker) by design: projection is memory-bandwidth-bound and pairs with the zero-allocation accumulator, so offloading would pay transfer cost both ways for little compute gain. This is the single Points projection implementation — the former worker dispatcher copy was deleted in W4b.
Two execution paths share this entry point:
targetBuffersprovided): the supported hot path. Writes through preallocated accumulator buffers for zero-allocation operation. Production code always takes this path viaLoadedPointsDataAccumulator.targetBuffersnull/undefined): allocates fresh arrays. Used by tests and the explicit no-accumulator opt-out. Color/sharpness inputs pass through by reference; positions3D and (when filtering applies) radii are freshly allocated.