@voxelkloud/format-potree
v0.5.1
Published
Potree v2 driver for voxelkloud: metadata.json/hierarchy.bin/octree.bin over HTTP Range requests.
Maintainers
Readme
@voxelkloud/format-potree
The Potree v2 driver for voxelkloud — one format among several, not the shape of the library.
npm install @voxelkloud/format-potreeMost applications never install this directly: @voxelkloud/loader registers it
on the first load, so pointing the loader at a Potree directory just works.
Install it by name when you want the driver's own fields — source.metadata,
source.isBrotli, the decoded point records — or when you are pinning the
format on purpose.
What is actually Potree-specific
That distinction is the reason this package exists. The vocabulary every driver
shares — bounding boxes, attributes, transport, warnings, the source and tree
contracts, octree subdivision and Morton order — lives in @voxelkloud/core.
What is here is what genuinely belongs to this format:
- the
metadata.jsonschema, includinghierarchy.firstChunkSizeandencoding - the 22-byte
hierarchy.binnode record, and the proxy-chunk paging over it r047node naming — EPT keys a nodeD-X-Y-Z, COPC keys itlevel-x-y-z- the DEFAULT interleaved stride and the BROTLI planar 47 B/pt block, with morton-coded positions and colour
Using it directly
import { loadPotreeSource, loadHierarchy } from "@voxelkloud/format-potree";
const source = await loadPotreeSource("https://example.com/clouds/autzen/");
source.metadata.points; // 10653336 — the driver's own field
source.pointCount; // 10653336 — the neutral one
source.bytesPerPoint; // 35
source.warnings; // tolerated anomalies, never thrown
const tree = await loadHierarchy(source);potreeFormat is the same driver as a registry entry, for
formats.register(...).
BROTLI
No browser exposes a brotli decoder to JS, so a BROTLI-encoded cloud needs one
supplied. Resolution is tiered — injected, then Node's zlib, then
DecompressionStream — and the vendored reference decoder is opt-in behind the
@voxelkloud/format-potree/brotli subpath and never auto-imported.
MIT. This package vendors the Brotli Authors' reference decoder; see THIRD-PARTY-NOTICES.md.
