@loaders.gl/potree
Version:
potree loaders for large point clouds.
28 lines (27 loc) • 748 B
JavaScript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright vis.gl contributors
import { parsePotreeBin } from "./parsers/parse-potree-bin.js";
/**
* Loader for potree Binary Point Attributes
* */
export const PotreeBinLoader = {
dataType: null,
batchType: null,
name: 'potree Binary Point Attributes',
id: 'potree',
extensions: ['bin'],
mimeTypes: ['application/octet-stream'],
// Unfortunately binary potree files have no header bytes, no test possible
// test: ['...'],
parseSync,
binary: true,
options: {}
// @ts-ignore
};
function parseSync(arrayBuffer, options) {
const index = {};
const byteOffset = 0;
parsePotreeBin(arrayBuffer, byteOffset, options, index);
return index;
}