@loaders.gl/pointclouds 0.0.0-stage → 5.0.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LAS-README.md +12 -0
- package/LICENSE +24 -0
- package/PCD-README.md +12 -0
- package/PLY-README.md +38 -0
- package/README.md +11 -2
- package/THIRD-PARTY-NOTICES.md +27 -0
- package/dist/dist.dev.js +31514 -0
- package/dist/dist.min.js +54 -0
- package/dist/index.cjs +55 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/las/bundled.cjs +69 -0
- package/dist/las/bundled.cjs.map +7 -0
- package/dist/las/bundled.d.ts +11 -0
- package/dist/las/bundled.d.ts.map +1 -0
- package/dist/las/bundled.js +11 -0
- package/dist/las/bundled.js.map +1 -0
- package/dist/las/index.cjs +75 -0
- package/dist/las/index.cjs.map +7 -0
- package/dist/las/index.d.ts +15 -0
- package/dist/las/index.d.ts.map +1 -0
- package/dist/las/index.js +12 -0
- package/dist/las/index.js.map +1 -0
- package/dist/las/las-copc-loader-types.cjs +49 -0
- package/dist/las/las-copc-loader-types.cjs.map +7 -0
- package/dist/las/las-copc-loader-types.d.ts +67 -0
- package/dist/las/las-copc-loader-types.d.ts.map +1 -0
- package/dist/las/las-copc-loader-types.js +14 -0
- package/dist/las/las-copc-loader-types.js.map +1 -0
- package/dist/las/las-copc-loader.cjs +60 -0
- package/dist/las/las-copc-loader.cjs.map +7 -0
- package/dist/las/las-copc-loader.d.ts +39 -0
- package/dist/las/las-copc-loader.d.ts.map +1 -0
- package/dist/las/las-copc-loader.js +45 -0
- package/dist/las/las-copc-loader.js.map +1 -0
- package/dist/las/las-format.cjs +44 -0
- package/dist/las/las-format.cjs.map +7 -0
- package/dist/las/las-format.d.ts +16 -0
- package/dist/las/las-format.d.ts.map +1 -0
- package/dist/las/las-format.js +19 -0
- package/dist/las/las-format.js.map +1 -0
- package/dist/las/las-loader-shared.cjs +84 -0
- package/dist/las/las-loader-shared.cjs.map +7 -0
- package/dist/las/las-loader-shared.d.ts +68 -0
- package/dist/las/las-loader-shared.d.ts.map +1 -0
- package/dist/las/las-loader-shared.js +60 -0
- package/dist/las/las-loader-shared.js.map +1 -0
- package/dist/las/las-loader-types.cjs +51 -0
- package/dist/las/las-loader-types.cjs.map +7 -0
- package/dist/las/las-loader-types.d.ts +77 -0
- package/dist/las/las-loader-types.d.ts.map +1 -0
- package/dist/las/las-loader-types.js +17 -0
- package/dist/las/las-loader-types.js.map +1 -0
- package/dist/las/las-loader.cjs +128 -0
- package/dist/las/las-loader.cjs.map +7 -0
- package/dist/las/las-loader.d.ts +91 -0
- package/dist/las/las-loader.d.ts.map +1 -0
- package/dist/las/las-loader.js +108 -0
- package/dist/las/las-loader.js.map +1 -0
- package/dist/las/las-writer.cjs +1054 -0
- package/dist/las/las-writer.cjs.map +7 -0
- package/dist/las/las-writer.d.ts +70 -0
- package/dist/las/las-writer.d.ts.map +1 -0
- package/dist/las/las-writer.js +992 -0
- package/dist/las/las-writer.js.map +1 -0
- package/dist/las/laz-rs-loader-types.cjs +49 -0
- package/dist/las/laz-rs-loader-types.cjs.map +7 -0
- package/dist/las/laz-rs-loader-types.d.ts +69 -0
- package/dist/las/laz-rs-loader-types.d.ts.map +1 -0
- package/dist/las/laz-rs-loader-types.js +16 -0
- package/dist/las/laz-rs-loader-types.js.map +1 -0
- package/dist/las/laz-rs-loader.cjs +275 -0
- package/dist/las/laz-rs-loader.cjs.map +7 -0
- package/dist/las/laz-rs-loader.d.ts +39 -0
- package/dist/las/laz-rs-loader.d.ts.map +1 -0
- package/dist/las/laz-rs-loader.js +43 -0
- package/dist/las/laz-rs-loader.js.map +1 -0
- package/dist/las/lazperf-loader-types.cjs +49 -0
- package/dist/las/lazperf-loader-types.cjs.map +7 -0
- package/dist/las/lazperf-loader-types.d.ts +71 -0
- package/dist/las/lazperf-loader-types.d.ts.map +1 -0
- package/dist/las/lazperf-loader-types.js +17 -0
- package/dist/las/lazperf-loader-types.js.map +1 -0
- package/dist/las/lazperf-loader.cjs +63 -0
- package/dist/las/lazperf-loader.cjs.map +7 -0
- package/dist/las/lazperf-loader.d.ts +41 -0
- package/dist/las/lazperf-loader.d.ts.map +1 -0
- package/dist/las/lazperf-loader.js +49 -0
- package/dist/las/lazperf-loader.js.map +1 -0
- package/dist/las/lib/copc/parse-las.cjs +177 -0
- package/dist/las/lib/copc/parse-las.cjs.map +7 -0
- package/dist/las/lib/copc/parse-las.d.ts +17 -0
- package/dist/las/lib/copc/parse-las.d.ts.map +1 -0
- package/dist/las/lib/copc/parse-las.js +215 -0
- package/dist/las/lib/copc/parse-las.js.map +1 -0
- package/dist/las/lib/get-las-schema.cjs +67 -0
- package/dist/las/lib/get-las-schema.cjs.map +7 -0
- package/dist/las/lib/get-las-schema.d.ts +16 -0
- package/dist/las/lib/get-las-schema.d.ts.map +1 -0
- package/dist/las/lib/get-las-schema.js +52 -0
- package/dist/las/lib/get-las-schema.js.map +1 -0
- package/dist/las/lib/las-compatibility.cjs +110 -0
- package/dist/las/lib/las-compatibility.cjs.map +7 -0
- package/dist/las/lib/las-compatibility.d.ts +40 -0
- package/dist/las/lib/las-compatibility.d.ts.map +1 -0
- package/dist/las/lib/las-compatibility.js +115 -0
- package/dist/las/lib/las-compatibility.js.map +1 -0
- package/dist/las/lib/las-extra-bytes.cjs +228 -0
- package/dist/las/lib/las-extra-bytes.cjs.map +7 -0
- package/dist/las/lib/las-extra-bytes.d.ts +35 -0
- package/dist/las/lib/las-extra-bytes.d.ts.map +1 -0
- package/dist/las/lib/las-extra-bytes.js +197 -0
- package/dist/las/lib/las-extra-bytes.js.map +1 -0
- package/dist/las/lib/las-types.cjs +19 -0
- package/dist/las/lib/las-types.cjs.map +7 -0
- package/dist/las/lib/las-types.d.ts +194 -0
- package/dist/las/lib/las-types.d.ts.map +1 -0
- package/dist/las/lib/las-types.js +5 -0
- package/dist/las/lib/las-types.js.map +1 -0
- package/dist/las/lib/las-waveform.cjs +196 -0
- package/dist/las/lib/las-waveform.cjs.map +7 -0
- package/dist/las/lib/las-waveform.d.ts +89 -0
- package/dist/las/lib/las-waveform.d.ts.map +1 -0
- package/dist/las/lib/las-waveform.js +193 -0
- package/dist/las/lib/las-waveform.js.map +1 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.cjs +382 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.cjs.map +7 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.d.ts +129 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.d.ts.map +1 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.js +377 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.js.map +1 -0
- package/dist/las/lib/laz-perf/parse-las.cjs +271 -0
- package/dist/las/lib/laz-perf/parse-las.cjs.map +7 -0
- package/dist/las/lib/laz-perf/parse-las.d.ts +24 -0
- package/dist/las/lib/laz-perf/parse-las.d.ts.map +1 -0
- package/dist/las/lib/laz-perf/parse-las.js +308 -0
- package/dist/las/lib/laz-perf/parse-las.js.map +1 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.cjs +631 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.cjs.map +7 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.d.ts +129 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.d.ts.map +1 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.js +414 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.js.map +1 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.cjs +271 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.cjs.map +7 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.d.ts +24 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.d.ts.map +1 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.js +308 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.js.map +1 -0
- package/dist/las/lib/typescript/parse-las.cjs +2889 -0
- package/dist/las/lib/typescript/parse-las.cjs.map +7 -0
- package/dist/las/lib/typescript/parse-las.d.ts +39 -0
- package/dist/las/lib/typescript/parse-las.d.ts.map +1 -0
- package/dist/las/lib/typescript/parse-las.js +2703 -0
- package/dist/las/lib/typescript/parse-las.js.map +1 -0
- package/dist/las/libs/laz-perf/laz-perf.cjs +18093 -0
- package/dist/las/libs/laz-perf/laz-perf.cjs.map +7 -0
- package/dist/las/libs/laz-perf/laz-perf.d.ts +2 -0
- package/dist/las/libs/laz-perf/laz-perf.d.ts.map +1 -0
- package/dist/las/libs/laz-perf/laz-perf.js +19003 -0
- package/dist/las/libs/laz-perf/laz-perf.js.map +1 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.d.ts +95 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.d.ts.map +1 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.js +442 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.js.map +1 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm +0 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm.d.ts +38 -0
- package/dist/las/unbundled.cjs +69 -0
- package/dist/las/unbundled.cjs.map +7 -0
- package/dist/las/unbundled.d.ts +11 -0
- package/dist/las/unbundled.d.ts.map +1 -0
- package/dist/las/unbundled.js +11 -0
- package/dist/las/unbundled.js.map +1 -0
- package/dist/las/workers/las-worker.cjs +23 -0
- package/dist/las/workers/las-worker.cjs.map +7 -0
- package/dist/las/workers/las-worker.d.ts +2 -0
- package/dist/las/workers/las-worker.d.ts.map +1 -0
- package/dist/las/workers/las-worker.js +23 -0
- package/dist/las/workers/las-worker.js.map +1 -0
- package/dist/las-copc-loader-types.cjs +51 -0
- package/dist/las-copc-loader-types.cjs.map +7 -0
- package/dist/las-copc-loader-types.d.ts +2 -0
- package/dist/las-copc-loader-types.d.ts.map +1 -0
- package/dist/las-copc-loader-types.js +2 -0
- package/dist/las-copc-loader-types.js.map +1 -0
- package/dist/las-copc-loader.cjs +62 -0
- package/dist/las-copc-loader.cjs.map +7 -0
- package/dist/las-copc-loader.d.ts +2 -0
- package/dist/las-copc-loader.d.ts.map +1 -0
- package/dist/las-copc-loader.js +2 -0
- package/dist/las-copc-loader.js.map +1 -0
- package/dist/las-loader-types.cjs +53 -0
- package/dist/las-loader-types.cjs.map +7 -0
- package/dist/las-loader-types.d.ts +2 -0
- package/dist/las-loader-types.d.ts.map +1 -0
- package/dist/las-loader-types.js +2 -0
- package/dist/las-loader-types.js.map +1 -0
- package/dist/las-loader.cjs +130 -0
- package/dist/las-loader.cjs.map +7 -0
- package/dist/las-loader.d.ts +2 -0
- package/dist/las-loader.d.ts.map +1 -0
- package/dist/las-loader.js +2 -0
- package/dist/las-loader.js.map +1 -0
- package/dist/las-worker.js +24024 -0
- package/dist/las-writer.cjs +1056 -0
- package/dist/las-writer.cjs.map +7 -0
- package/dist/las-writer.d.ts +2 -0
- package/dist/las-writer.d.ts.map +1 -0
- package/dist/las-writer.js +2 -0
- package/dist/las-writer.js.map +1 -0
- package/dist/laz-rs-loader-types.cjs +51 -0
- package/dist/laz-rs-loader-types.cjs.map +7 -0
- package/dist/laz-rs-loader-types.d.ts +2 -0
- package/dist/laz-rs-loader-types.d.ts.map +1 -0
- package/dist/laz-rs-loader-types.js +2 -0
- package/dist/laz-rs-loader-types.js.map +1 -0
- package/dist/laz-rs-loader.cjs +277 -0
- package/dist/laz-rs-loader.cjs.map +7 -0
- package/dist/laz-rs-loader.d.ts +2 -0
- package/dist/laz-rs-loader.d.ts.map +1 -0
- package/dist/laz-rs-loader.js +2 -0
- package/dist/laz-rs-loader.js.map +1 -0
- package/dist/lazperf-loader-types.cjs +51 -0
- package/dist/lazperf-loader-types.cjs.map +7 -0
- package/dist/lazperf-loader-types.d.ts +2 -0
- package/dist/lazperf-loader-types.d.ts.map +1 -0
- package/dist/lazperf-loader-types.js +2 -0
- package/dist/lazperf-loader-types.js.map +1 -0
- package/dist/lazperf-loader.cjs +65 -0
- package/dist/lazperf-loader.cjs.map +7 -0
- package/dist/lazperf-loader.d.ts +2 -0
- package/dist/lazperf-loader.d.ts.map +1 -0
- package/dist/lazperf-loader.js +2 -0
- package/dist/lazperf-loader.js.map +1 -0
- package/dist/pcd/bundled.cjs +31 -0
- package/dist/pcd/bundled.cjs.map +7 -0
- package/dist/pcd/bundled.d.ts +3 -0
- package/dist/pcd/bundled.d.ts.map +1 -0
- package/dist/pcd/bundled.js +5 -0
- package/dist/pcd/bundled.js.map +1 -0
- package/dist/pcd/index.cjs +37 -0
- package/dist/pcd/index.cjs.map +7 -0
- package/dist/pcd/index.d.ts +6 -0
- package/dist/pcd/index.d.ts.map +1 -0
- package/dist/pcd/index.js +7 -0
- package/dist/pcd/index.js.map +1 -0
- package/dist/pcd/lib/decompress-lzf.cjs +80 -0
- package/dist/pcd/lib/decompress-lzf.cjs.map +7 -0
- package/dist/pcd/lib/decompress-lzf.d.ts +7 -0
- package/dist/pcd/lib/decompress-lzf.d.ts.map +1 -0
- package/dist/pcd/lib/decompress-lzf.js +62 -0
- package/dist/pcd/lib/decompress-lzf.js.map +1 -0
- package/dist/pcd/lib/get-pcd-schema.cjs +70 -0
- package/dist/pcd/lib/get-pcd-schema.cjs.map +7 -0
- package/dist/pcd/lib/get-pcd-schema.d.ts +10 -0
- package/dist/pcd/lib/get-pcd-schema.d.ts.map +1 -0
- package/dist/pcd/lib/get-pcd-schema.js +53 -0
- package/dist/pcd/lib/get-pcd-schema.js.map +1 -0
- package/dist/pcd/lib/parse-pcd.cjs +354 -0
- package/dist/pcd/lib/parse-pcd.cjs.map +7 -0
- package/dist/pcd/lib/parse-pcd.d.ts +20 -0
- package/dist/pcd/lib/parse-pcd.d.ts.map +1 -0
- package/dist/pcd/lib/parse-pcd.js +341 -0
- package/dist/pcd/lib/parse-pcd.js.map +1 -0
- package/dist/pcd/lib/pcd-types.cjs +19 -0
- package/dist/pcd/lib/pcd-types.cjs.map +7 -0
- package/dist/pcd/lib/pcd-types.d.ts +31 -0
- package/dist/pcd/lib/pcd-types.d.ts.map +1 -0
- package/dist/pcd/lib/pcd-types.js +5 -0
- package/dist/pcd/lib/pcd-types.js.map +1 -0
- package/dist/pcd/pcd-format.cjs +42 -0
- package/dist/pcd/pcd-format.cjs.map +7 -0
- package/dist/pcd/pcd-format.d.ts +16 -0
- package/dist/pcd/pcd-format.d.ts.map +1 -0
- package/dist/pcd/pcd-format.js +19 -0
- package/dist/pcd/pcd-format.js.map +1 -0
- package/dist/pcd/pcd-loader-types.cjs +63 -0
- package/dist/pcd/pcd-loader-types.cjs.map +7 -0
- package/dist/pcd/pcd-loader-types.d.ts +82 -0
- package/dist/pcd/pcd-loader-types.d.ts.map +1 -0
- package/dist/pcd/pcd-loader-types.js +35 -0
- package/dist/pcd/pcd-loader-types.js.map +1 -0
- package/dist/pcd/pcd-loader.cjs +201 -0
- package/dist/pcd/pcd-loader.cjs.map +7 -0
- package/dist/pcd/pcd-loader.d.ts +80 -0
- package/dist/pcd/pcd-loader.d.ts.map +1 -0
- package/dist/pcd/pcd-loader.js +179 -0
- package/dist/pcd/pcd-loader.js.map +1 -0
- package/dist/pcd/pcd-writer.cjs +134 -0
- package/dist/pcd/pcd-writer.cjs.map +7 -0
- package/dist/pcd/pcd-writer.d.ts +38 -0
- package/dist/pcd/pcd-writer.d.ts.map +1 -0
- package/dist/pcd/pcd-writer.js +115 -0
- package/dist/pcd/pcd-writer.js.map +1 -0
- package/dist/pcd/unbundled.cjs +31 -0
- package/dist/pcd/unbundled.cjs.map +7 -0
- package/dist/pcd/unbundled.d.ts +3 -0
- package/dist/pcd/unbundled.d.ts.map +1 -0
- package/dist/pcd/unbundled.js +5 -0
- package/dist/pcd/unbundled.js.map +1 -0
- package/dist/pcd/workers/pcd-worker.cjs +23 -0
- package/dist/pcd/workers/pcd-worker.cjs.map +7 -0
- package/dist/pcd/workers/pcd-worker.d.ts +2 -0
- package/dist/pcd/workers/pcd-worker.d.ts.map +1 -0
- package/dist/pcd/workers/pcd-worker.js +23 -0
- package/dist/pcd/workers/pcd-worker.js.map +1 -0
- package/dist/pcd-loader-types.cjs +65 -0
- package/dist/pcd-loader-types.cjs.map +7 -0
- package/dist/pcd-loader-types.d.ts +2 -0
- package/dist/pcd-loader-types.d.ts.map +1 -0
- package/dist/pcd-loader-types.js +2 -0
- package/dist/pcd-loader-types.js.map +1 -0
- package/dist/pcd-loader.cjs +203 -0
- package/dist/pcd-loader.cjs.map +7 -0
- package/dist/pcd-loader.d.ts +2 -0
- package/dist/pcd-loader.d.ts.map +1 -0
- package/dist/pcd-loader.js +2 -0
- package/dist/pcd-loader.js.map +1 -0
- package/dist/pcd-worker.js +18561 -0
- package/dist/pcd-writer.cjs +136 -0
- package/dist/pcd-writer.cjs.map +7 -0
- package/dist/pcd-writer.d.ts +2 -0
- package/dist/pcd-writer.d.ts.map +1 -0
- package/dist/pcd-writer.js +2 -0
- package/dist/pcd-writer.js.map +1 -0
- package/dist/ply/bundled.cjs +31 -0
- package/dist/ply/bundled.cjs.map +7 -0
- package/dist/ply/bundled.d.ts +3 -0
- package/dist/ply/bundled.d.ts.map +1 -0
- package/dist/ply/bundled.js +5 -0
- package/dist/ply/bundled.js.map +1 -0
- package/dist/ply/index.cjs +37 -0
- package/dist/ply/index.cjs.map +7 -0
- package/dist/ply/index.d.ts +6 -0
- package/dist/ply/index.d.ts.map +1 -0
- package/dist/ply/index.js +8 -0
- package/dist/ply/index.js.map +1 -0
- package/dist/ply/lib/get-ply-schema.cjs +128 -0
- package/dist/ply/lib/get-ply-schema.cjs.map +7 -0
- package/dist/ply/lib/get-ply-schema.d.ts +16 -0
- package/dist/ply/lib/get-ply-schema.d.ts.map +1 -0
- package/dist/ply/lib/get-ply-schema.js +117 -0
- package/dist/ply/lib/get-ply-schema.js.map +1 -0
- package/dist/ply/lib/normalize-ply.cjs +96 -0
- package/dist/ply/lib/normalize-ply.cjs.map +7 -0
- package/dist/ply/lib/normalize-ply.d.ts +8 -0
- package/dist/ply/lib/normalize-ply.d.ts.map +1 -0
- package/dist/ply/lib/normalize-ply.js +89 -0
- package/dist/ply/lib/normalize-ply.js.map +1 -0
- package/dist/ply/lib/parse-ply-arrow.cjs +552 -0
- package/dist/ply/lib/parse-ply-arrow.cjs.map +7 -0
- package/dist/ply/lib/parse-ply-arrow.d.ts +25 -0
- package/dist/ply/lib/parse-ply-arrow.d.ts.map +1 -0
- package/dist/ply/lib/parse-ply-arrow.js +493 -0
- package/dist/ply/lib/parse-ply-arrow.js.map +1 -0
- package/dist/ply/lib/parse-ply-in-batches.cjs +613 -0
- package/dist/ply/lib/parse-ply-in-batches.cjs.map +7 -0
- package/dist/ply/lib/parse-ply-in-batches.d.ts +9 -0
- package/dist/ply/lib/parse-ply-in-batches.d.ts.map +1 -0
- package/dist/ply/lib/parse-ply-in-batches.js +630 -0
- package/dist/ply/lib/parse-ply-in-batches.js.map +1 -0
- package/dist/ply/lib/parse-ply.cjs +758 -0
- package/dist/ply/lib/parse-ply.cjs.map +7 -0
- package/dist/ply/lib/parse-ply.d.ts +69 -0
- package/dist/ply/lib/parse-ply.d.ts.map +1 -0
- package/dist/ply/lib/parse-ply.js +855 -0
- package/dist/ply/lib/parse-ply.js.map +1 -0
- package/dist/ply/lib/ply-types.cjs +19 -0
- package/dist/ply/lib/ply-types.cjs.map +7 -0
- package/dist/ply/lib/ply-types.d.ts +37 -0
- package/dist/ply/lib/ply-types.d.ts.map +1 -0
- package/dist/ply/lib/ply-types.js +2 -0
- package/dist/ply/lib/ply-types.js.map +1 -0
- package/dist/ply/ply-format.cjs +43 -0
- package/dist/ply/ply-format.cjs.map +7 -0
- package/dist/ply/ply-format.d.ts +18 -0
- package/dist/ply/ply-format.d.ts.map +1 -0
- package/dist/ply/ply-format.js +22 -0
- package/dist/ply/ply-format.js.map +1 -0
- package/dist/ply/ply-loader-types.cjs +64 -0
- package/dist/ply/ply-loader-types.cjs.map +7 -0
- package/dist/ply/ply-loader-types.d.ts +88 -0
- package/dist/ply/ply-loader-types.d.ts.map +1 -0
- package/dist/ply/ply-loader-types.js +38 -0
- package/dist/ply/ply-loader-types.js.map +1 -0
- package/dist/ply/ply-loader.cjs +192 -0
- package/dist/ply/ply-loader.cjs.map +7 -0
- package/dist/ply/ply-loader.d.ts +81 -0
- package/dist/ply/ply-loader.d.ts.map +1 -0
- package/dist/ply/ply-loader.js +173 -0
- package/dist/ply/ply-loader.js.map +1 -0
- package/dist/ply/ply-writer.cjs +175 -0
- package/dist/ply/ply-writer.cjs.map +7 -0
- package/dist/ply/ply-writer.d.ts +38 -0
- package/dist/ply/ply-writer.d.ts.map +1 -0
- package/dist/ply/ply-writer.js +140 -0
- package/dist/ply/ply-writer.js.map +1 -0
- package/dist/ply/unbundled.cjs +31 -0
- package/dist/ply/unbundled.cjs.map +7 -0
- package/dist/ply/unbundled.d.ts +3 -0
- package/dist/ply/unbundled.d.ts.map +1 -0
- package/dist/ply/unbundled.js +5 -0
- package/dist/ply/unbundled.js.map +1 -0
- package/dist/ply/workers/ply-worker.cjs +34 -0
- package/dist/ply/workers/ply-worker.cjs.map +7 -0
- package/dist/ply/workers/ply-worker.d.ts +2 -0
- package/dist/ply/workers/ply-worker.d.ts.map +1 -0
- package/dist/ply/workers/ply-worker.js +37 -0
- package/dist/ply/workers/ply-worker.js.map +1 -0
- package/dist/ply-loader-types.cjs +66 -0
- package/dist/ply-loader-types.cjs.map +7 -0
- package/dist/ply-loader-types.d.ts +2 -0
- package/dist/ply-loader-types.d.ts.map +1 -0
- package/dist/ply-loader-types.js +2 -0
- package/dist/ply-loader-types.js.map +1 -0
- package/dist/ply-loader.cjs +194 -0
- package/dist/ply-loader.cjs.map +7 -0
- package/dist/ply-loader.d.ts +2 -0
- package/dist/ply-loader.d.ts.map +1 -0
- package/dist/ply-loader.js +2 -0
- package/dist/ply-loader.js.map +1 -0
- package/dist/ply-worker.js +20962 -0
- package/dist/ply-writer.cjs +177 -0
- package/dist/ply-writer.cjs.map +7 -0
- package/dist/ply-writer.d.ts +2 -0
- package/dist/ply-writer.d.ts.map +1 -0
- package/dist/ply-writer.js +2 -0
- package/dist/ply-writer.js.map +1 -0
- package/package.json +238 -4
- package/src/index.ts +19 -0
- package/src/las/bundled.ts +38 -0
- package/src/las/index.ts +66 -0
- package/src/las/las-copc-loader-types.ts +18 -0
- package/src/las/las-copc-loader.ts +61 -0
- package/src/las/las-format.ts +21 -0
- package/src/las/las-loader-shared.ts +126 -0
- package/src/las/las-loader-types.ts +24 -0
- package/src/las/las-loader.ts +163 -0
- package/src/las/las-writer.ts +1477 -0
- package/src/las/laz-rs-loader-types.ts +21 -0
- package/src/las/laz-rs-loader.ts +53 -0
- package/src/las/lazperf-loader-types.ts +22 -0
- package/src/las/lazperf-loader.ts +65 -0
- package/src/las/lib/LASZIP-LICENSE +202 -0
- package/src/las/lib/LASZIP-NOTICE +4 -0
- package/src/las/lib/copc/parse-las.ts +265 -0
- package/src/las/lib/get-las-schema.ts +55 -0
- package/src/las/lib/las-compatibility.ts +178 -0
- package/src/las/lib/las-extra-bytes.ts +276 -0
- package/src/las/lib/las-types.ts +206 -0
- package/src/las/lib/las-waveform.ts +292 -0
- package/src/las/lib/laz-perf/laslaz-decoder.ts +443 -0
- package/src/las/lib/laz-perf/parse-las.ts +411 -0
- package/src/las/lib/laz-rs-wasm/laslaz-decoder.ts +488 -0
- package/src/las/lib/laz-rs-wasm/parse-las.ts +411 -0
- package/src/las/lib/typescript/parse-las.ts +3862 -0
- package/src/las/libs/laz-perf/laz-perf.ts +20615 -0
- package/src/las/libs/laz-rs-wasm/README.md +5 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm.d.ts +89 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm.js +497 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm +0 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm.d.ts +38 -0
- package/src/las/libs/laz-rs-wasm/package.json +25 -0
- package/src/las/unbundled.ts +38 -0
- package/src/las/workers/las-worker.ts +24 -0
- package/src/las-copc-loader-types.ts +1 -0
- package/src/las-copc-loader.ts +1 -0
- package/src/las-loader-types.ts +1 -0
- package/src/las-loader.ts +1 -0
- package/src/las-writer.ts +1 -0
- package/src/laz-rs-loader-types.ts +1 -0
- package/src/laz-rs-loader.ts +1 -0
- package/src/lazperf-loader-types.ts +1 -0
- package/src/lazperf-loader.ts +1 -0
- package/src/pcd/bundled.ts +6 -0
- package/src/pcd/index.ts +9 -0
- package/src/pcd/lib/decompress-lzf.ts +68 -0
- package/src/pcd/lib/get-pcd-schema.ts +66 -0
- package/src/pcd/lib/parse-pcd.ts +474 -0
- package/src/pcd/lib/pcd-types.ts +34 -0
- package/src/pcd/pcd-format.ts +21 -0
- package/src/pcd/pcd-loader-types.ts +52 -0
- package/src/pcd/pcd-loader.ts +247 -0
- package/src/pcd/pcd-writer.ts +156 -0
- package/src/pcd/unbundled.ts +6 -0
- package/src/pcd/workers/pcd-worker.ts +24 -0
- package/src/pcd-loader-types.ts +1 -0
- package/src/pcd-loader.ts +1 -0
- package/src/pcd-writer.ts +1 -0
- package/src/ply/bundled.ts +6 -0
- package/src/ply/index.ts +11 -0
- package/src/ply/lib/get-ply-schema.ts +133 -0
- package/src/ply/lib/normalize-ply.ts +110 -0
- package/src/ply/lib/parse-ply-arrow.ts +676 -0
- package/src/ply/lib/parse-ply-in-batches.ts +832 -0
- package/src/ply/lib/parse-ply.ts +1084 -0
- package/src/ply/lib/ply-types.ts +47 -0
- package/src/ply/ply-format.ts +24 -0
- package/src/ply/ply-loader-types.ts +60 -0
- package/src/ply/ply-loader.ts +255 -0
- package/src/ply/ply-writer.ts +219 -0
- package/src/ply/unbundled.ts +6 -0
- package/src/ply/workers/ply-worker.ts +40 -0
- package/src/ply-loader-types.ts +1 -0
- package/src/ply-loader.ts +1 -0
- package/src/ply-writer.ts +1 -0
- package/third-party-licenses/plasio-LICENSE +21 -0
- package/third-party-licenses/three-LICENSE +21 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ply/ply-writer.ts
|
|
21
|
+
var ply_writer_exports = {};
|
|
22
|
+
__export(ply_writer_exports, {
|
|
23
|
+
PLYWriter: () => PLYWriter
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ply_writer_exports);
|
|
26
|
+
var import_schema_utils = require("@loaders.gl/core/schema-utils");
|
|
27
|
+
var import_ply_format = require("./ply-format.cjs");
|
|
28
|
+
var VERSION = true ? "5.0.0-beta.10" : "latest";
|
|
29
|
+
var PLYWriter = {
|
|
30
|
+
...import_ply_format.PLYFormat,
|
|
31
|
+
dataType: null,
|
|
32
|
+
batchType: null,
|
|
33
|
+
version: VERSION,
|
|
34
|
+
options: {
|
|
35
|
+
ply: {}
|
|
36
|
+
},
|
|
37
|
+
text: true,
|
|
38
|
+
encode: async (data, options) => encodePLYSync(data, options),
|
|
39
|
+
encodeSync: encodePLYSync,
|
|
40
|
+
encodeTextSync: encodePLY
|
|
41
|
+
};
|
|
42
|
+
function encodePLYSync(data, options) {
|
|
43
|
+
const text = encodePLY(data, options);
|
|
44
|
+
return new TextEncoder().encode(text).buffer;
|
|
45
|
+
}
|
|
46
|
+
function encodePLY(data, options) {
|
|
47
|
+
const mesh = (0, import_schema_utils.convertTableToMesh)(normalizeMeshArrowTable(data));
|
|
48
|
+
const positionAttribute = getRequiredAttribute(mesh, "POSITION");
|
|
49
|
+
const normalAttribute = mesh.attributes.NORMAL;
|
|
50
|
+
const textureCoordinateAttribute = mesh.attributes.TEXCOORD_0;
|
|
51
|
+
const colorAttribute = mesh.attributes.COLOR_0;
|
|
52
|
+
const customScalarAttributes = getCustomScalarAttributes(mesh);
|
|
53
|
+
const vertexCount = positionAttribute.value.length / positionAttribute.size;
|
|
54
|
+
const triangleIndices = getTriangleIndices(mesh, vertexCount);
|
|
55
|
+
const header = getPLYHeader(
|
|
56
|
+
vertexCount,
|
|
57
|
+
triangleIndices.length / 3,
|
|
58
|
+
Boolean(normalAttribute),
|
|
59
|
+
Boolean(textureCoordinateAttribute),
|
|
60
|
+
Boolean(colorAttribute),
|
|
61
|
+
customScalarAttributes
|
|
62
|
+
);
|
|
63
|
+
const rows = [];
|
|
64
|
+
for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {
|
|
65
|
+
const row = [
|
|
66
|
+
getComponent(positionAttribute, vertexIndex, 0),
|
|
67
|
+
getComponent(positionAttribute, vertexIndex, 1),
|
|
68
|
+
getComponent(positionAttribute, vertexIndex, 2)
|
|
69
|
+
];
|
|
70
|
+
if (normalAttribute) {
|
|
71
|
+
row.push(
|
|
72
|
+
getComponent(normalAttribute, vertexIndex, 0),
|
|
73
|
+
getComponent(normalAttribute, vertexIndex, 1),
|
|
74
|
+
getComponent(normalAttribute, vertexIndex, 2)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
if (textureCoordinateAttribute) {
|
|
78
|
+
row.push(
|
|
79
|
+
getComponent(textureCoordinateAttribute, vertexIndex, 0),
|
|
80
|
+
getComponent(textureCoordinateAttribute, vertexIndex, 1)
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
if (colorAttribute) {
|
|
84
|
+
row.push(
|
|
85
|
+
getColorByte(colorAttribute, vertexIndex, 0),
|
|
86
|
+
getColorByte(colorAttribute, vertexIndex, 1),
|
|
87
|
+
getColorByte(colorAttribute, vertexIndex, 2)
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
for (const [, attribute] of customScalarAttributes) {
|
|
91
|
+
row.push(getComponent(attribute, vertexIndex, 0));
|
|
92
|
+
}
|
|
93
|
+
rows.push(row.join(" "));
|
|
94
|
+
}
|
|
95
|
+
for (let triangleIndex = 0; triangleIndex < triangleIndices.length; triangleIndex += 3) {
|
|
96
|
+
rows.push(
|
|
97
|
+
`3 ${triangleIndices[triangleIndex]} ${triangleIndices[triangleIndex + 1]} ${triangleIndices[triangleIndex + 2]}`
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
return `${header.concat(rows).join("\n")}
|
|
101
|
+
`;
|
|
102
|
+
}
|
|
103
|
+
function normalizeMeshArrowTable(data) {
|
|
104
|
+
if (!("attributes" in data)) {
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
return (0, import_schema_utils.convertMeshToArrowTableWrapper)(data);
|
|
108
|
+
}
|
|
109
|
+
function getRequiredAttribute(mesh, attributeName) {
|
|
110
|
+
const attribute = mesh.attributes[attributeName];
|
|
111
|
+
if (!attribute) {
|
|
112
|
+
throw new Error(`PLYWriter: ${attributeName} attribute is required`);
|
|
113
|
+
}
|
|
114
|
+
return attribute;
|
|
115
|
+
}
|
|
116
|
+
function getPLYHeader(vertexCount, faceCount, hasNormals, hasTextureCoordinates, hasColors, customScalarAttributes) {
|
|
117
|
+
const header = [
|
|
118
|
+
"ply",
|
|
119
|
+
"format ascii 1.0",
|
|
120
|
+
"comment generated by loaders.gl",
|
|
121
|
+
`element vertex ${vertexCount}`,
|
|
122
|
+
"property float x",
|
|
123
|
+
"property float y",
|
|
124
|
+
"property float z"
|
|
125
|
+
];
|
|
126
|
+
if (hasNormals) {
|
|
127
|
+
header.push("property float nx", "property float ny", "property float nz");
|
|
128
|
+
}
|
|
129
|
+
if (hasTextureCoordinates) {
|
|
130
|
+
header.push("property float s", "property float t");
|
|
131
|
+
}
|
|
132
|
+
if (hasColors) {
|
|
133
|
+
header.push("property uchar red", "property uchar green", "property uchar blue");
|
|
134
|
+
}
|
|
135
|
+
for (const [attributeName] of customScalarAttributes) {
|
|
136
|
+
header.push(`property float ${attributeName}`);
|
|
137
|
+
}
|
|
138
|
+
if (faceCount > 0) {
|
|
139
|
+
header.push(`element face ${faceCount}`, "property list uchar int vertex_indices");
|
|
140
|
+
}
|
|
141
|
+
header.push("end_header");
|
|
142
|
+
return header;
|
|
143
|
+
}
|
|
144
|
+
function getCustomScalarAttributes(mesh) {
|
|
145
|
+
const reservedAttributeNames = /* @__PURE__ */ new Set(["POSITION", "NORMAL", "TEXCOORD_0", "COLOR_0"]);
|
|
146
|
+
return Object.entries(mesh.attributes).filter(
|
|
147
|
+
([attributeName, attribute]) => !reservedAttributeNames.has(attributeName) && attribute.size === 1
|
|
148
|
+
);
|
|
149
|
+
}
|
|
150
|
+
function getComponent(attribute, vertexIndex, componentIndex) {
|
|
151
|
+
return attribute.value[vertexIndex * attribute.size + componentIndex] || 0;
|
|
152
|
+
}
|
|
153
|
+
function getColorByte(attribute, vertexIndex, componentIndex) {
|
|
154
|
+
const value = getComponent(attribute, vertexIndex, componentIndex);
|
|
155
|
+
const byteValue = attribute.normalized || value <= 1 ? value * 255 : value;
|
|
156
|
+
return Math.max(0, Math.min(255, Math.round(byteValue)));
|
|
157
|
+
}
|
|
158
|
+
function getTriangleIndices(mesh, vertexCount) {
|
|
159
|
+
if (mesh.indices?.value?.length) {
|
|
160
|
+
return Array.from(mesh.indices.value);
|
|
161
|
+
}
|
|
162
|
+
if (mesh.mode !== 4 && mesh.topology !== "triangle-list") {
|
|
163
|
+
return [];
|
|
164
|
+
}
|
|
165
|
+
const triangleIndices = [];
|
|
166
|
+
for (let vertexIndex = 0; vertexIndex + 2 < vertexCount; vertexIndex += 3) {
|
|
167
|
+
triangleIndices.push(vertexIndex, vertexIndex + 1, vertexIndex + 2);
|
|
168
|
+
}
|
|
169
|
+
return triangleIndices;
|
|
170
|
+
}
|
|
171
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
172
|
+
0 && (module.exports = {
|
|
173
|
+
PLYWriter
|
|
174
|
+
});
|
|
175
|
+
//# sourceMappingURL=ply-writer.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ply/ply-writer.ts"],
|
|
4
|
+
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Table} from 'apache-arrow';\nimport type {WriterOptions, WriterWithEncoder} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable, MeshAttribute} from '@loaders.gl/core/schema';\nimport {convertMeshToArrowTableWrapper, convertTableToMesh} from '@loaders.gl/core/schema-utils';\nimport {PLYFormat} from './ply-format';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** Options for `PLYWriter`. */\nexport type PLYWriterOptions = WriterOptions & {\n /** Reserved for future PLY writer options. */\n ply?: Record<string, never>;\n};\n\n/**\n * Writer for the PLY geometry format.\n */\nexport const PLYWriter = {\n ...PLYFormat,\n dataType: null as unknown as Mesh | MeshArrowTable | Table,\n batchType: null as never,\n version: VERSION,\n options: {\n ply: {}\n },\n text: true,\n encode: async (data, options) => encodePLYSync(data, options),\n encodeSync: encodePLYSync,\n encodeTextSync: encodePLY\n} as const satisfies WriterWithEncoder<Mesh | MeshArrowTable | Table, never, PLYWriterOptions>;\n\n/** Encode mesh category data as PLY bytes. */\nfunction encodePLYSync(\n data: Mesh | MeshArrowTable | Table,\n options?: PLYWriterOptions\n): ArrayBuffer {\n const text = encodePLY(data, options);\n return new TextEncoder().encode(text).buffer;\n}\n\n/** Encode mesh category data as ASCII PLY text. */\nfunction encodePLY(data: Mesh | MeshArrowTable | Table, options?: PLYWriterOptions): string {\n const mesh = convertTableToMesh(normalizeMeshArrowTable(data));\n const positionAttribute = getRequiredAttribute(mesh, 'POSITION');\n const normalAttribute = mesh.attributes.NORMAL;\n const textureCoordinateAttribute = mesh.attributes.TEXCOORD_0;\n const colorAttribute = mesh.attributes.COLOR_0;\n const customScalarAttributes = getCustomScalarAttributes(mesh);\n const vertexCount = positionAttribute.value.length / positionAttribute.size;\n const triangleIndices = getTriangleIndices(mesh, vertexCount);\n const header = getPLYHeader(\n vertexCount,\n triangleIndices.length / 3,\n Boolean(normalAttribute),\n Boolean(textureCoordinateAttribute),\n Boolean(colorAttribute),\n customScalarAttributes\n );\n const rows: string[] = [];\n\n for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {\n const row = [\n getComponent(positionAttribute, vertexIndex, 0),\n getComponent(positionAttribute, vertexIndex, 1),\n getComponent(positionAttribute, vertexIndex, 2)\n ];\n\n if (normalAttribute) {\n row.push(\n getComponent(normalAttribute, vertexIndex, 0),\n getComponent(normalAttribute, vertexIndex, 1),\n getComponent(normalAttribute, vertexIndex, 2)\n );\n }\n\n if (textureCoordinateAttribute) {\n row.push(\n getComponent(textureCoordinateAttribute, vertexIndex, 0),\n getComponent(textureCoordinateAttribute, vertexIndex, 1)\n );\n }\n\n if (colorAttribute) {\n row.push(\n getColorByte(colorAttribute, vertexIndex, 0),\n getColorByte(colorAttribute, vertexIndex, 1),\n getColorByte(colorAttribute, vertexIndex, 2)\n );\n }\n\n for (const [, attribute] of customScalarAttributes) {\n row.push(getComponent(attribute, vertexIndex, 0));\n }\n\n rows.push(row.join(' '));\n }\n\n for (let triangleIndex = 0; triangleIndex < triangleIndices.length; triangleIndex += 3) {\n rows.push(\n `3 ${triangleIndices[triangleIndex]} ${triangleIndices[triangleIndex + 1]} ${\n triangleIndices[triangleIndex + 2]\n }`\n );\n }\n\n return `${header.concat(rows).join('\\n')}\\n`;\n}\n\n/** Return mesh data as a MeshArrowTable, converting plain Mesh data first. */\nfunction normalizeMeshArrowTable(data: Mesh | MeshArrowTable | Table): MeshArrowTable | Table {\n if (!('attributes' in data)) {\n return data;\n }\n return convertMeshToArrowTableWrapper(data as Mesh);\n}\n\n/** Return a required mesh attribute or throw a format-specific error. */\nfunction getRequiredAttribute(mesh: Mesh, attributeName: string): MeshAttribute {\n const attribute = mesh.attributes[attributeName];\n if (!attribute) {\n throw new Error(`PLYWriter: ${attributeName} attribute is required`);\n }\n return attribute;\n}\n\n/** Return the ASCII PLY header lines. */\nfunction getPLYHeader(\n vertexCount: number,\n faceCount: number,\n hasNormals: boolean,\n hasTextureCoordinates: boolean,\n hasColors: boolean,\n customScalarAttributes: [string, MeshAttribute][]\n): string[] {\n const header = [\n 'ply',\n 'format ascii 1.0',\n 'comment generated by loaders.gl',\n `element vertex ${vertexCount}`,\n 'property float x',\n 'property float y',\n 'property float z'\n ];\n\n if (hasNormals) {\n header.push('property float nx', 'property float ny', 'property float nz');\n }\n\n if (hasTextureCoordinates) {\n header.push('property float s', 'property float t');\n }\n\n if (hasColors) {\n header.push('property uchar red', 'property uchar green', 'property uchar blue');\n }\n\n for (const [attributeName] of customScalarAttributes) {\n header.push(`property float ${attributeName}`);\n }\n\n if (faceCount > 0) {\n header.push(`element face ${faceCount}`, 'property list uchar int vertex_indices');\n }\n\n header.push('end_header');\n return header;\n}\n\n/** Return additional one-component attributes that can be represented as scalar PLY properties. */\nfunction getCustomScalarAttributes(mesh: Mesh): [string, MeshAttribute][] {\n const reservedAttributeNames = new Set(['POSITION', 'NORMAL', 'TEXCOORD_0', 'COLOR_0']);\n return Object.entries(mesh.attributes).filter(\n ([attributeName, attribute]) =>\n !reservedAttributeNames.has(attributeName) && attribute.size === 1\n );\n}\n\n/** Return a single attribute component with 0 as the missing component fallback. */\nfunction getComponent(\n attribute: MeshAttribute,\n vertexIndex: number,\n componentIndex: number\n): number {\n return attribute.value[vertexIndex * attribute.size + componentIndex] || 0;\n}\n\n/** Return one color component as an unsigned byte. */\nfunction getColorByte(\n attribute: MeshAttribute,\n vertexIndex: number,\n componentIndex: number\n): number {\n const value = getComponent(attribute, vertexIndex, componentIndex);\n const byteValue = attribute.normalized || value <= 1 ? value * 255 : value;\n return Math.max(0, Math.min(255, Math.round(byteValue)));\n}\n\n/** Return triangle indices for indexed or sequential triangle-list meshes. */\nfunction getTriangleIndices(mesh: Mesh, vertexCount: number): number[] {\n if (mesh.indices?.value?.length) {\n return Array.from(mesh.indices.value);\n }\n\n if (mesh.mode !== 4 && mesh.topology !== 'triangle-list') {\n return [];\n }\n\n const triangleIndices: number[] = [];\n for (let vertexIndex = 0; vertexIndex + 2 < vertexCount; vertexIndex += 3) {\n triangleIndices.push(vertexIndex, vertexIndex + 1, vertexIndex + 2);\n }\n return triangleIndices;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,0BAAiE;AACjE,wBAAwB;AAIxB,IAAM,UAAU,OAAqC,kBAAc;AAW5D,IAAM,YAAY;AAAA,EACvB,GAAG;AAAA,EACH,UAAU;AAAA,EACV,WAAW;AAAA,EACX,SAAS;AAAA,EACT,SAAS;AAAA,IACP,KAAK,CAAC;AAAA,EACR;AAAA,EACA,MAAM;AAAA,EACN,QAAQ,OAAO,MAAM,YAAY,cAAc,MAAM,OAAO;AAAA,EAC5D,YAAY;AAAA,EACZ,gBAAgB;AAClB;AAGA,SAAS,cACP,MACA,SACa;AACb,QAAM,OAAO,UAAU,MAAM,OAAO;AACpC,S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WAAO,KAAK,gBAAgB,SAAS,IAAI,wCAAwC;AAAA,EACnF;AAEA,SAAO,KAAK,YAAY;AACxB,SAAO;AACT;AAGA,SAAS,0BAA0B,MAAuC;AACxE,QAAM,yBAAyB,oBAAI,IAAI,CAAC,YAAY,UAAU,cAAc,SAAS,CAAC;AACtF,SAAO,OAAO,QAAQ,KAAK,UAAU,EAAE;AAAA,IACrC,CAAC,CAAC,eAAe,SAAS,MACxB,CAAC,uBAAuB,IAAI,aAAa,KAAK,UAAU,SAAS;AAAA,EACrE;AACF;AAGA,SAAS,aACP,WACA,aACA,gBACQ;AACR,SAAO,UAAU,MAAM,cAAc,UAAU,OAAO,cAAc,KAAK;AAC3E;AAGA,SAAS,aACP,WACA,aACA,gBACQ;AACR,QAAM,QAAQ,aAAa,WAAW,aAAa,cAAc;AACjE,QAAM,YAAY,UAAU,cAAc,SAAS,IAAI,QAAQ,MAAM;AACrE,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,KAAK,KAAK,MAAM,SAAS,CAAC,CAAC;AACzD;AAGA,SAAS,mBAAmB,MAAY,aAA+B;AACrE,MAAI,KAAK,SAAS,OAAO,QAAQ;AAC/B,WAAO,MAAM,KAAK,KAAK,QAAQ,KAAK;AAAA,EACtC;AAEA,MAAI,KAAK,SAAS,KAAK,KAAK,aAAa,iBAAiB;AACxD,WAAO,CAAC;AAAA,EACV;AAEA,QAAM,kBAA4B,CAAC;AACnC,WAAS,cAAc,GAAG,cAAc,IAAI,aAAa,eAAe,GAAG;AACzE,oBAAgB,KAAK,aAAa,cAAc,GAAG,cAAc,CAAC;AAAA,EACpE;AACA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Table } from 'apache-arrow';
|
|
2
|
+
import type { WriterOptions } from '@loaders.gl/core/loader-utils';
|
|
3
|
+
import type { Mesh, MeshArrowTable } from '@loaders.gl/core/schema';
|
|
4
|
+
/** Options for `PLYWriter`. */
|
|
5
|
+
export type PLYWriterOptions = WriterOptions & {
|
|
6
|
+
/** Reserved for future PLY writer options. */
|
|
7
|
+
ply?: Record<string, never>;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Writer for the PLY geometry format.
|
|
11
|
+
*/
|
|
12
|
+
export declare const PLYWriter: {
|
|
13
|
+
readonly dataType: Mesh | MeshArrowTable | Table;
|
|
14
|
+
readonly batchType: never;
|
|
15
|
+
readonly version: any;
|
|
16
|
+
readonly options: {
|
|
17
|
+
readonly ply: {};
|
|
18
|
+
};
|
|
19
|
+
readonly text: true;
|
|
20
|
+
readonly encode: (data: Mesh | Table<any> | MeshArrowTable, options: PLYWriterOptions | undefined) => Promise<ArrayBuffer>;
|
|
21
|
+
readonly encodeSync: typeof encodePLYSync;
|
|
22
|
+
readonly encodeTextSync: typeof encodePLY;
|
|
23
|
+
readonly name: "PLY";
|
|
24
|
+
readonly id: "ply";
|
|
25
|
+
readonly module: "pointclouds";
|
|
26
|
+
readonly encoding: "text";
|
|
27
|
+
readonly format: "ply";
|
|
28
|
+
readonly extensions: ["ply"];
|
|
29
|
+
readonly mimeTypes: ["text/plain", "application/octet-stream"];
|
|
30
|
+
readonly binary: true;
|
|
31
|
+
readonly tests: ["ply"];
|
|
32
|
+
};
|
|
33
|
+
/** Encode mesh category data as PLY bytes. */
|
|
34
|
+
declare function encodePLYSync(data: Mesh | MeshArrowTable | Table, options?: PLYWriterOptions): ArrayBuffer;
|
|
35
|
+
/** Encode mesh category data as ASCII PLY text. */
|
|
36
|
+
declare function encodePLY(data: Mesh | MeshArrowTable | Table, options?: PLYWriterOptions): string;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=ply-writer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ply-writer.d.ts","sourceRoot":"","sources":["../../src/ply/ply-writer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,EAAC,aAAa,EAAoB,MAAM,+BAA+B,CAAC;AACpF,OAAO,KAAK,EAAC,IAAI,EAAE,cAAc,EAAgB,MAAM,yBAAyB,CAAC;AAQjF,+BAA+B;AAC/B,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,8CAA8C;IAC9C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;CAC7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS;uBAES,IAAI,GAAG,cAAc,GAAG,KAAK;wBACvC,KAAK;;;;;;;;;;;;;;;;;;CASoE,CAAC;AAE/F,8CAA8C;AAC9C,iBAAS,aAAa,CACpB,IAAI,EAAE,IAAI,GAAG,cAAc,GAAG,KAAK,EACnC,OAAO,CAAC,EAAE,gBAAgB,GACzB,WAAW,CAGb;AAED,mDAAmD;AACnD,iBAAS,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,cAAc,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAiE1F"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { convertMeshToArrowTableWrapper, convertTableToMesh } from '@loaders.gl/core/schema-utils';
|
|
5
|
+
import { PLYFormat } from "./ply-format.js";
|
|
6
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
7
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
8
|
+
const VERSION = typeof "5.0.0-beta.10" !== 'undefined' ? "5.0.0-beta.10" : 'latest';
|
|
9
|
+
/**
|
|
10
|
+
* Writer for the PLY geometry format.
|
|
11
|
+
*/
|
|
12
|
+
export const PLYWriter = {
|
|
13
|
+
...PLYFormat,
|
|
14
|
+
dataType: null,
|
|
15
|
+
batchType: null,
|
|
16
|
+
version: VERSION,
|
|
17
|
+
options: {
|
|
18
|
+
ply: {}
|
|
19
|
+
},
|
|
20
|
+
text: true,
|
|
21
|
+
encode: async (data, options) => encodePLYSync(data, options),
|
|
22
|
+
encodeSync: encodePLYSync,
|
|
23
|
+
encodeTextSync: encodePLY
|
|
24
|
+
};
|
|
25
|
+
/** Encode mesh category data as PLY bytes. */
|
|
26
|
+
function encodePLYSync(data, options) {
|
|
27
|
+
const text = encodePLY(data, options);
|
|
28
|
+
return new TextEncoder().encode(text).buffer;
|
|
29
|
+
}
|
|
30
|
+
/** Encode mesh category data as ASCII PLY text. */
|
|
31
|
+
function encodePLY(data, options) {
|
|
32
|
+
const mesh = convertTableToMesh(normalizeMeshArrowTable(data));
|
|
33
|
+
const positionAttribute = getRequiredAttribute(mesh, 'POSITION');
|
|
34
|
+
const normalAttribute = mesh.attributes.NORMAL;
|
|
35
|
+
const textureCoordinateAttribute = mesh.attributes.TEXCOORD_0;
|
|
36
|
+
const colorAttribute = mesh.attributes.COLOR_0;
|
|
37
|
+
const customScalarAttributes = getCustomScalarAttributes(mesh);
|
|
38
|
+
const vertexCount = positionAttribute.value.length / positionAttribute.size;
|
|
39
|
+
const triangleIndices = getTriangleIndices(mesh, vertexCount);
|
|
40
|
+
const header = getPLYHeader(vertexCount, triangleIndices.length / 3, Boolean(normalAttribute), Boolean(textureCoordinateAttribute), Boolean(colorAttribute), customScalarAttributes);
|
|
41
|
+
const rows = [];
|
|
42
|
+
for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {
|
|
43
|
+
const row = [
|
|
44
|
+
getComponent(positionAttribute, vertexIndex, 0),
|
|
45
|
+
getComponent(positionAttribute, vertexIndex, 1),
|
|
46
|
+
getComponent(positionAttribute, vertexIndex, 2)
|
|
47
|
+
];
|
|
48
|
+
if (normalAttribute) {
|
|
49
|
+
row.push(getComponent(normalAttribute, vertexIndex, 0), getComponent(normalAttribute, vertexIndex, 1), getComponent(normalAttribute, vertexIndex, 2));
|
|
50
|
+
}
|
|
51
|
+
if (textureCoordinateAttribute) {
|
|
52
|
+
row.push(getComponent(textureCoordinateAttribute, vertexIndex, 0), getComponent(textureCoordinateAttribute, vertexIndex, 1));
|
|
53
|
+
}
|
|
54
|
+
if (colorAttribute) {
|
|
55
|
+
row.push(getColorByte(colorAttribute, vertexIndex, 0), getColorByte(colorAttribute, vertexIndex, 1), getColorByte(colorAttribute, vertexIndex, 2));
|
|
56
|
+
}
|
|
57
|
+
for (const [, attribute] of customScalarAttributes) {
|
|
58
|
+
row.push(getComponent(attribute, vertexIndex, 0));
|
|
59
|
+
}
|
|
60
|
+
rows.push(row.join(' '));
|
|
61
|
+
}
|
|
62
|
+
for (let triangleIndex = 0; triangleIndex < triangleIndices.length; triangleIndex += 3) {
|
|
63
|
+
rows.push(`3 ${triangleIndices[triangleIndex]} ${triangleIndices[triangleIndex + 1]} ${triangleIndices[triangleIndex + 2]}`);
|
|
64
|
+
}
|
|
65
|
+
return `${header.concat(rows).join('\n')}\n`;
|
|
66
|
+
}
|
|
67
|
+
/** Return mesh data as a MeshArrowTable, converting plain Mesh data first. */
|
|
68
|
+
function normalizeMeshArrowTable(data) {
|
|
69
|
+
if (!('attributes' in data)) {
|
|
70
|
+
return data;
|
|
71
|
+
}
|
|
72
|
+
return convertMeshToArrowTableWrapper(data);
|
|
73
|
+
}
|
|
74
|
+
/** Return a required mesh attribute or throw a format-specific error. */
|
|
75
|
+
function getRequiredAttribute(mesh, attributeName) {
|
|
76
|
+
const attribute = mesh.attributes[attributeName];
|
|
77
|
+
if (!attribute) {
|
|
78
|
+
throw new Error(`PLYWriter: ${attributeName} attribute is required`);
|
|
79
|
+
}
|
|
80
|
+
return attribute;
|
|
81
|
+
}
|
|
82
|
+
/** Return the ASCII PLY header lines. */
|
|
83
|
+
function getPLYHeader(vertexCount, faceCount, hasNormals, hasTextureCoordinates, hasColors, customScalarAttributes) {
|
|
84
|
+
const header = [
|
|
85
|
+
'ply',
|
|
86
|
+
'format ascii 1.0',
|
|
87
|
+
'comment generated by loaders.gl',
|
|
88
|
+
`element vertex ${vertexCount}`,
|
|
89
|
+
'property float x',
|
|
90
|
+
'property float y',
|
|
91
|
+
'property float z'
|
|
92
|
+
];
|
|
93
|
+
if (hasNormals) {
|
|
94
|
+
header.push('property float nx', 'property float ny', 'property float nz');
|
|
95
|
+
}
|
|
96
|
+
if (hasTextureCoordinates) {
|
|
97
|
+
header.push('property float s', 'property float t');
|
|
98
|
+
}
|
|
99
|
+
if (hasColors) {
|
|
100
|
+
header.push('property uchar red', 'property uchar green', 'property uchar blue');
|
|
101
|
+
}
|
|
102
|
+
for (const [attributeName] of customScalarAttributes) {
|
|
103
|
+
header.push(`property float ${attributeName}`);
|
|
104
|
+
}
|
|
105
|
+
if (faceCount > 0) {
|
|
106
|
+
header.push(`element face ${faceCount}`, 'property list uchar int vertex_indices');
|
|
107
|
+
}
|
|
108
|
+
header.push('end_header');
|
|
109
|
+
return header;
|
|
110
|
+
}
|
|
111
|
+
/** Return additional one-component attributes that can be represented as scalar PLY properties. */
|
|
112
|
+
function getCustomScalarAttributes(mesh) {
|
|
113
|
+
const reservedAttributeNames = new Set(['POSITION', 'NORMAL', 'TEXCOORD_0', 'COLOR_0']);
|
|
114
|
+
return Object.entries(mesh.attributes).filter(([attributeName, attribute]) => !reservedAttributeNames.has(attributeName) && attribute.size === 1);
|
|
115
|
+
}
|
|
116
|
+
/** Return a single attribute component with 0 as the missing component fallback. */
|
|
117
|
+
function getComponent(attribute, vertexIndex, componentIndex) {
|
|
118
|
+
return attribute.value[vertexIndex * attribute.size + componentIndex] || 0;
|
|
119
|
+
}
|
|
120
|
+
/** Return one color component as an unsigned byte. */
|
|
121
|
+
function getColorByte(attribute, vertexIndex, componentIndex) {
|
|
122
|
+
const value = getComponent(attribute, vertexIndex, componentIndex);
|
|
123
|
+
const byteValue = attribute.normalized || value <= 1 ? value * 255 : value;
|
|
124
|
+
return Math.max(0, Math.min(255, Math.round(byteValue)));
|
|
125
|
+
}
|
|
126
|
+
/** Return triangle indices for indexed or sequential triangle-list meshes. */
|
|
127
|
+
function getTriangleIndices(mesh, vertexCount) {
|
|
128
|
+
if (mesh.indices?.value?.length) {
|
|
129
|
+
return Array.from(mesh.indices.value);
|
|
130
|
+
}
|
|
131
|
+
if (mesh.mode !== 4 && mesh.topology !== 'triangle-list') {
|
|
132
|
+
return [];
|
|
133
|
+
}
|
|
134
|
+
const triangleIndices = [];
|
|
135
|
+
for (let vertexIndex = 0; vertexIndex + 2 < vertexCount; vertexIndex += 3) {
|
|
136
|
+
triangleIndices.push(vertexIndex, vertexIndex + 1, vertexIndex + 2);
|
|
137
|
+
}
|
|
138
|
+
return triangleIndices;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=ply-writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ply-writer.js","sourceRoot":"","sources":["../../src/ply/ply-writer.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAKpC,OAAO,EAAC,8BAA8B,EAAE,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAAC,SAAS,EAAC,wBAAqB;AAEvC,yDAAyD;AACzD,qDAAqD;AACrD,MAAM,OAAO,GAAG,sBAAkB,KAAK,WAAW,CAAC,CAAC,iBAAa,CAAC,CAAC,QAAQ,CAAC;AAQ5E;;GAEG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,SAAS;IACZ,QAAQ,EAAE,IAAgD;IAC1D,SAAS,EAAE,IAAa;IACxB,OAAO,EAAE,OAAO;IAChB,OAAO,EAAE;QACP,GAAG,EAAE,EAAE;KACR;IACD,IAAI,EAAE,IAAI;IACV,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC;IAC7D,UAAU,EAAE,aAAa;IACzB,cAAc,EAAE,SAAS;CACmE,CAAC;AAE/F,8CAA8C;AAC9C,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G,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3E,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,8EAA8E;AAC9E,SAAS,kBAAkB,CAAC,IAAU,EAAE,WAAmB;IACzD,IAAI,IAAI,CAAC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,KAAK,eAAe,EAAE,CAAC;QACzD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,eAAe,GAAa,EAAE,CAAC;IACrC,KAAK,IAAI,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,GAAG,WAAW,EAAE,WAAW,IAAI,CAAC,EAAE,CAAC;QAC1E,eAAe,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,CAAC,EAAE,WAAW,GAAG,CAAC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,eAAe,CAAC;AACzB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ply/unbundled.ts
|
|
21
|
+
var unbundled_exports = {};
|
|
22
|
+
__export(unbundled_exports, {
|
|
23
|
+
PLYLoader: () => import_ply_loader_types.PLYLoader
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(unbundled_exports);
|
|
26
|
+
var import_ply_loader_types = require("./ply-loader-types.cjs");
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
PLYLoader
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=unbundled.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/ply/unbundled.ts"],
|
|
4
|
+
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport type {PLYLoaderOptions} from './ply-loader-types';\nexport {PLYLoader} from './ply-loader-types';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,8BAAwB;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unbundled.d.ts","sourceRoot":"","sources":["../../src/ply/unbundled.ts"],"names":[],"mappings":"AAIA,YAAY,EAAC,gBAAgB,EAAC,8BAA2B;AACzD,OAAO,EAAC,SAAS,EAAC,8BAA2B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unbundled.js","sourceRoot":"","sources":["../../src/ply/unbundled.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,SAAS,EAAC,8BAA2B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// src/ply/workers/ply-worker.ts
|
|
4
|
+
var import_loader_utils = require("@loaders.gl/core/loader-utils");
|
|
5
|
+
var import_schema_utils = require("@loaders.gl/core/schema-utils");
|
|
6
|
+
var import_ply_loader = require("../ply-loader.cjs");
|
|
7
|
+
(0, import_loader_utils.createLoaderWorker)({
|
|
8
|
+
...import_ply_loader.PLYColumnLoader,
|
|
9
|
+
/** Always returns columnar data; legacy mesh conversion runs on the caller. */
|
|
10
|
+
parse(input, options) {
|
|
11
|
+
return import_ply_loader.PLYColumnLoader.parse(input, {
|
|
12
|
+
...options,
|
|
13
|
+
ply: { ...options?.ply, shape: "arrow" }
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
/** Preserves full-mesh parsing while streaming point-cloud vertices as Arrow batches. */
|
|
17
|
+
async *parseInBatches(input, options) {
|
|
18
|
+
const parseMesh = options?.ply?.shape === "mesh" && !options?.ply?.pointCloud;
|
|
19
|
+
const parserOptions = parseMesh ? options : { ...options, ply: { ...options?.ply, shape: "arrow" } };
|
|
20
|
+
for await (const batch of import_ply_loader.PLYColumnLoader.parseInBatches(input, parserOptions)) {
|
|
21
|
+
if ("shape" in batch && batch.shape === "arrow-table") {
|
|
22
|
+
yield batch;
|
|
23
|
+
} else {
|
|
24
|
+
const mesh = batch;
|
|
25
|
+
yield (0, import_loader_utils.makeTableScanBatch)({
|
|
26
|
+
...(0, import_schema_utils.convertMeshToArrowTableWrapper)(mesh),
|
|
27
|
+
loader: mesh.loader,
|
|
28
|
+
loaderData: mesh.loaderData
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=ply-worker.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ply/workers/ply-worker.ts"],
|
|
4
|
+
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport {createLoaderWorker, makeTableScanBatch} from '@loaders.gl/core/loader-utils';\nimport type {MeshArrowTable} from '@loaders.gl/core/schema';\nimport {convertMeshToArrowTableWrapper} from '@loaders.gl/core/schema-utils';\nimport type {PLYMesh} from '../lib/ply-types';\nimport type {PLYLoaderOptions} from '../ply-loader-types';\nimport {PLYColumnLoader} from '../ply-loader';\n\ncreateLoaderWorker({\n ...PLYColumnLoader,\n /** Always returns columnar data; legacy mesh conversion runs on the caller. */\n parse(input, options) {\n return PLYColumnLoader.parse(input, {\n ...options,\n ply: {...options?.ply, shape: 'arrow'}\n });\n },\n /** Preserves full-mesh parsing while streaming point-cloud vertices as Arrow batches. */\n async *parseInBatches(input, options?: PLYLoaderOptions) {\n const parseMesh = options?.ply?.shape === 'mesh' && !options?.ply?.pointCloud;\n const parserOptions = parseMesh\n ? options\n : {...options, ply: {...options?.ply, shape: 'arrow' as const}};\n for await (const batch of PLYColumnLoader.parseInBatches(input, parserOptions)) {\n if ('shape' in batch && batch.shape === 'arrow-table') {\n yield batch;\n } else {\n const mesh = batch as PLYMesh;\n yield makeTableScanBatch({\n ...convertMeshToArrowTableWrapper(mesh),\n loader: mesh.loader,\n loaderData: mesh.loaderData\n } as MeshArrowTable);\n }\n }\n }\n});\n"],
|
|
5
|
+
"mappings": ";;;AAIA,0BAAqD;AAErD,0BAA6C;AAG7C,wBAA8B;AAAA,IAE9B,wCAAmB;AAAA,EACjB,GAAG;AAAA;AAAA,EAEH,MAAM,OAAO,SAAS;AACpB,WAAO,kCAAgB,MAAM,OAAO;AAAA,MAClC,GAAG;AAAA,MACH,KAAK,EAAC,GAAG,SAAS,KAAK,OAAO,QAAO;AAAA,IACvC,CAAC;AAAA,EACH;AAAA;AAAA,EAEA,OAAO,eAAe,OAAO,SAA4B;AACvD,UAAM,YAAY,SAAS,KAAK,UAAU,UAAU,CAAC,SAAS,KAAK;AACnE,UAAM,gBAAgB,YAClB,UACA,EAAC,GAAG,SAAS,KAAK,EAAC,GAAG,SAAS,KAAK,OAAO,QAAgB,EAAC;AAChE,qBAAiB,SAAS,kCAAgB,eAAe,OAAO,aAAa,GAAG;AAC9E,UAAI,WAAW,SAAS,MAAM,UAAU,eAAe;AACrD,cAAM;AAAA,MACR,OAAO;AACL,cAAM,OAAO;AACb,kBAAM,wCAAmB;AAAA,UACvB,OAAG,oDAA+B,IAAI;AAAA,UACtC,QAAQ,KAAK;AAAA,UACb,YAAY,KAAK;AAAA,QACnB,CAAmB;AAAA,MACrB;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ply-worker.d.ts","sourceRoot":"","sources":["../../../src/ply/workers/ply-worker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { createLoaderWorker, makeTableScanBatch } from '@loaders.gl/core/loader-utils';
|
|
5
|
+
import { convertMeshToArrowTableWrapper } from '@loaders.gl/core/schema-utils';
|
|
6
|
+
import { PLYColumnLoader } from "../ply-loader.js";
|
|
7
|
+
createLoaderWorker({
|
|
8
|
+
...PLYColumnLoader,
|
|
9
|
+
/** Always returns columnar data; legacy mesh conversion runs on the caller. */
|
|
10
|
+
parse(input, options) {
|
|
11
|
+
return PLYColumnLoader.parse(input, {
|
|
12
|
+
...options,
|
|
13
|
+
ply: { ...options?.ply, shape: 'arrow' }
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
/** Preserves full-mesh parsing while streaming point-cloud vertices as Arrow batches. */
|
|
17
|
+
async *parseInBatches(input, options) {
|
|
18
|
+
const parseMesh = options?.ply?.shape === 'mesh' && !options?.ply?.pointCloud;
|
|
19
|
+
const parserOptions = parseMesh
|
|
20
|
+
? options
|
|
21
|
+
: { ...options, ply: { ...options?.ply, shape: 'arrow' } };
|
|
22
|
+
for await (const batch of PLYColumnLoader.parseInBatches(input, parserOptions)) {
|
|
23
|
+
if ('shape' in batch && batch.shape === 'arrow-table') {
|
|
24
|
+
yield batch;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
const mesh = batch;
|
|
28
|
+
yield makeTableScanBatch({
|
|
29
|
+
...convertMeshToArrowTableWrapper(mesh),
|
|
30
|
+
loader: mesh.loader,
|
|
31
|
+
loaderData: mesh.loaderData
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=ply-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ply-worker.js","sourceRoot":"","sources":["../../../src/ply/workers/ply-worker.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,kBAAkB,EAAE,kBAAkB,EAAC,MAAM,+BAA+B,CAAC;AAErF,OAAO,EAAC,8BAA8B,EAAC,MAAM,+BAA+B,CAAC;AAG7E,OAAO,EAAC,eAAe,EAAC,yBAAsB;AAE9C,kBAAkB,CAAC;IACjB,GAAG,eAAe;IAClB,+EAA+E;IAC/E,KAAK,CAAC,KAAK,EAAE,OAAO;QAClB,OAAO,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE;YAClC,GAAG,OAAO;YACV,GAAG,EAAE,EAAC,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAO,EAAC;SACvC,CAAC,CAAC;IACL,CAAC;IACD,yFAAyF;IACzF,KAAK,CAAC,CAAC,cAAc,CAAC,KAAK,EAAE,OAA0B;QACrD,MAAM,SAAS,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK,KAAK,MAAM,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,UAAU,CAAC;QAC9E,MAAM,aAAa,GAAG,SAAS;YAC7B,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,EAAC,GAAG,OAAO,EAAE,GAAG,EAAE,EAAC,GAAG,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,OAAgB,EAAC,EAAC,CAAC;QAClE,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,eAAe,CAAC,cAAc,CAAC,KAAK,EAAE,aAAa,CAAC,EAAE,CAAC;YAC/E,IAAI,OAAO,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,KAAK,aAAa,EAAE,CAAC;gBACtD,MAAM,KAAK,CAAC;YACd,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,GAAG,KAAgB,CAAC;gBAC9B,MAAM,kBAAkB,CAAC;oBACvB,GAAG,8BAA8B,CAAC,IAAI,CAAC;oBACvC,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,UAAU,EAAE,IAAI,CAAC,UAAU;iBACV,CAAC,CAAC;YACvB,CAAC;QACH,CAAC;IACH,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/ply-loader-types.ts
|
|
31
|
+
var ply_loader_types_exports = {};
|
|
32
|
+
__export(ply_loader_types_exports, {
|
|
33
|
+
PLYLoader: () => PLYLoader
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(ply_loader_types_exports);
|
|
36
|
+
|
|
37
|
+
// src/ply/ply-loader-types.ts
|
|
38
|
+
var import_ply_format = require("./ply-format.cjs");
|
|
39
|
+
var import_arrow_worker_transport = require("@loaders.gl/core/arrow-worker-transport");
|
|
40
|
+
var VERSION = true ? "5.0.0-beta.10" : "latest";
|
|
41
|
+
async function preload() {
|
|
42
|
+
const { PLYLoaderWithParser } = await import("@loaders.gl/pointclouds/ply-loader");
|
|
43
|
+
return PLYLoaderWithParser;
|
|
44
|
+
}
|
|
45
|
+
var PLYLoader = {
|
|
46
|
+
defaultShape: "arrow",
|
|
47
|
+
supportsNativeArrow: true,
|
|
48
|
+
dataType: null,
|
|
49
|
+
batchType: null,
|
|
50
|
+
...import_ply_format.PLYFormat,
|
|
51
|
+
// shapes: ['mesh', 'gltf', 'columnar-table'],
|
|
52
|
+
version: VERSION,
|
|
53
|
+
worker: true,
|
|
54
|
+
/** Enables the stateful input/output batch protocol on the built-in worker. */
|
|
55
|
+
workerInBatches: true,
|
|
56
|
+
serializeWorkerResult: import_arrow_worker_transport.serializeArrowWorkerTable,
|
|
57
|
+
options: {
|
|
58
|
+
ply: { shape: "arrow", colorFormat: "uint8norm" }
|
|
59
|
+
},
|
|
60
|
+
preload
|
|
61
|
+
};
|
|
62
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
63
|
+
0 && (module.exports = {
|
|
64
|
+
PLYLoader
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=ply-loader-types.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ply-loader-types.ts", "../src/ply/ply-loader-types.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './ply/ply-loader-types.js';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// PLY Loader\nimport type {Table, RecordBatch} from 'apache-arrow';\nimport type {Loader, LoaderOptions} from '@loaders.gl/core/loader-utils';\nimport type {PLYMesh} from './lib/ply-types';\nimport type {ParsePLYOptions} from './lib/parse-ply';\nimport {PLYFormat} from './ply-format';\nimport {serializeArrowWorkerTable} from '@loaders.gl/core/arrow-worker-transport';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type PLYLoaderOptions = LoaderOptions & {\n ply?: ParsePLYOptions & {\n /** Output shape. Defaults to a Mesh Arrow table. */\n shape?: 'mesh' | 'arrow';\n /** Color storage format. Defaults to uint8norm for backwards compatibility. */\n colorFormat?: 'uint8norm' | 'float16' | 'float32';\n /** Treat PLY data as a point cloud by reading only the leading vertex element. */\n pointCloud?: boolean;\n /** Override the URL to the worker bundle (by default loads from unpkg.com) */\n workerUrl?: string;\n };\n};\n\n/**\n * Preloads the parser-bearing PLY loader implementation.\n */\nasync function preload() {\n const {PLYLoaderWithParser} = await import('@loaders.gl/pointclouds/ply-loader');\n return PLYLoaderWithParser;\n}\n\n/**\n * Metadata-only worker loader for PLY - Polygon File Format (aka Stanford Triangle Format)'\n * links: ['http://paulbourke.net/dataformats/ply/',\n * 'https://en.wikipedia.org/wiki/PLY_(file_format)']\n */\nexport const PLYLoader = {\n defaultShape: 'arrow',\n supportsNativeArrow: true,\n dataType: null as unknown as PLYMesh | Table,\n batchType: null as unknown as PLYMesh | RecordBatch,\n\n ...PLYFormat,\n // shapes: ['mesh', 'gltf', 'columnar-table'],\n version: VERSION,\n worker: true,\n /** Enables the stateful input/output batch protocol on the built-in worker. */\n workerInBatches: true,\n serializeWorkerResult: serializeArrowWorkerTable,\n options: {\n ply: {shape: 'arrow', colorFormat: 'uint8norm'}\n },\n preload\n} as const satisfies Loader<PLYMesh | Table, PLYMesh | RecordBatch, LoaderOptions>;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACSA,wBAAwB;AACxB,oCAAwC;AAIxC,IAAM,UAAU,OAAqC,kBAAc;AAkBnE,eAAe,UAAU;AACvB,QAAM,EAAC,oBAAmB,IAAI,MAAM,OAAO,oCAAoC;AAC/E,SAAO;AACT;AAOO,IAAM,YAAY;AAAA,EACvB,cAAc;AAAA,EACd,qBAAqB;AAAA,EACrB,UAAU;AAAA,EACV,WAAW;AAAA,EAEX,GAAG;AAAA;AAAA,EAEH,SAAS;AAAA,EACT,QAAQ;AAAA;AAAA,EAER,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,SAAS;AAAA,IACP,KAAK,EAAC,OAAO,SAAS,aAAa,YAAW;AAAA,EAChD;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ply-loader-types.d.ts","sourceRoot":"","sources":["../src/ply-loader-types.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|