@loaders.gl/ply
Version:
Framework-independent loader for the PLY format
43 lines • 1.53 kB
JavaScript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import { parsePLY } from "./lib/parse-ply.js";
import { parsePLYInBatches } from "./lib/parse-ply-in-batches.js";
// __VERSION__ is injected by babel-plugin-version-inline
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const VERSION = typeof "4.4.2" !== 'undefined' ? "4.4.2" : 'latest';
/**
* Worker loader for PLY - Polygon File Format (aka Stanford Triangle Format)'
* links: ['http://paulbourke.net/dataformats/ply/',
* 'https://en.wikipedia.org/wiki/PLY_(file_format)']
*/
export const PLYWorkerLoader = {
dataType: null,
batchType: null,
name: 'PLY',
id: 'ply',
module: 'ply',
// shapes: ['mesh', 'gltf', 'columnar-table'],
version: VERSION,
worker: true,
extensions: ['ply'],
mimeTypes: ['text/plain', 'application/octet-stream'],
text: true,
binary: true,
tests: ['ply'],
options: {
ply: {}
}
};
/**
* Loader for PLY - Polygon File Format
*/
export const PLYLoader = {
...PLYWorkerLoader,
// Note: parsePLY supports both text and binary
parse: async (arrayBuffer, options) => parsePLY(arrayBuffer, options?.ply), // TODO - this may not detect text correctly?
parseTextSync: (arrayBuffer, options) => parsePLY(arrayBuffer, options?.ply),
parseSync: (arrayBuffer, options) => parsePLY(arrayBuffer, options?.ply),
parseInBatches: (arrayBuffer, options) => parsePLYInBatches(arrayBuffer, options?.ply)
};
//# sourceMappingURL=ply-loader.js.map