{"_id":"@bitruvius/tiles3d-points","_rev":"8-28ad9260b0e4b06981999eff6ea9ae3b","name":"@bitruvius/tiles3d-points","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.0":{"name":"@bitruvius/tiles3d-points","version":"0.3.0","keywords":["bitruvius","geospatial","3d-tiles","point-cloud","pnts","draco","worker","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/tiles3d-points@0.3.0","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"d344197a563b0039ce3ec1f5601753c431be6db6","tarball":"https://registry.npmjs.org/@bitruvius/tiles3d-points/-/tiles3d-points-0.3.0.tgz","fileCount":11,"integrity":"sha512-7lMCZ2fPyyuQq6UtfixyuelNFtYxYEmjP4+3csLfwT9kN3nbTSfhH8wIhaOExKXiGJb8nEYA62NM8Pr2noz/fA==","signatures":[{"sig":"MEQCIAZDf/zwlPiQNcVI6AK2gOiGDNrIQdn4cCMEn0NWhodTAiBThIxF18I71ee40i4sQSojVw49Gfa+pdInSkfa2WXPXQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":30847},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"d344197a563b0039ce3ec1f5601753c431be6db6","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/point-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-7lMCZ2fPyyuQq6UtfixyuelNFtYxYEmjP4+3csLfwT9kN3nbTSfhH8wIhaOExKXiGJb8nEYA62NM8Pr2noz/fA==","_npmVersion":"10.8.3","description":"Composed off-main-thread decoder for OGC 3D-Tiles point clouds (v1.0 .pnts + v1.1 glTF POINTS): wires @bitruvius/gltf + draco into a worker-pooled CesiumPointDecoder","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/gltf":"^0.3.0","@bitruvius/draco":"^0.3.0","@bitruvius/geo-core":"^0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tiles3d-points_0.3.0_1785722187460_0.46440000463924447","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@bitruvius/tiles3d-points","version":"0.3.1","keywords":["bitruvius","geospatial","3d-tiles","point-cloud","pnts","draco","worker","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/tiles3d-points@0.3.1","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"ac52637af382ac61b02687c75d44129468141d59","tarball":"https://registry.npmjs.org/@bitruvius/tiles3d-points/-/tiles3d-points-0.3.1.tgz","fileCount":11,"integrity":"sha512-Qvs/leDq6Mc29TK9NvOUk8YXOp6byXOvK7pQntUtNH51EdRT9CYUfqRJA0U8hmwXwtzY6d/Z7DDSnbcNooCSYw==","signatures":[{"sig":"MEUCIAyF5TvbLq2knafbDJ9K3NnAGqnxTZd1c0ZVzdiwZOSXAiEAqhzbL6SIoxa24GeyDNc+n8FbycJ0CNokA3j4Wf6Pv9g=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31139},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"ac52637af382ac61b02687c75d44129468141d59","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/point-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-Qvs/leDq6Mc29TK9NvOUk8YXOp6byXOvK7pQntUtNH51EdRT9CYUfqRJA0U8hmwXwtzY6d/Z7DDSnbcNooCSYw==","_npmVersion":"10.8.3","description":"Composed off-main-thread decoder for OGC 3D-Tiles point clouds (v1.0 .pnts + v1.1 glTF POINTS): wires @bitruvius/gltf + draco into a worker-pooled CesiumPointDecoder","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/gltf":"^0.3.1","@bitruvius/draco":"^0.3.1","@bitruvius/geo-core":"^0.3.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tiles3d-points_0.3.1_1785725529082_0.5945709129316488","host":"s3://npm-registry-packages-npm-production"}},"0.3.2":{"name":"@bitruvius/tiles3d-points","version":"0.3.2","keywords":["bitruvius","geospatial","3d-tiles","point-cloud","pnts","draco","worker","decoder"],"license":"SEE LICENSE IN LICENSE","_id":"@bitruvius/tiles3d-points@0.3.2","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"homepage":"https://dev.bitruvius.com/sdks/js/","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"04ff6f7b6f0368929de4f8ab19445fc083c107b9","tarball":"https://registry.npmjs.org/@bitruvius/tiles3d-points/-/tiles3d-points-0.3.2.tgz","fileCount":11,"integrity":"sha512-EzmGfYQETC7MxC4zwMkFgvmb/yxfwSGK3ZNVjk0JPVAFJk0R9uURz74S45O6PlZvn0GKNRWZi5ftM7omlkBjNQ==","signatures":[{"sig":"MEYCIQCrK5EKT7RvBKQMJ0d7lz2eWXqQ2c0MguRjRE1W/Q+xZwIhAObwc3bq+SM66wjOzECo9yI6yzf3CKemFVfHzrzr2fL5","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":31139},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"04ff6f7b6f0368929de4f8ab19445fc083c107b9","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/point-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' && tsc --emitDeclarationOnly"},"_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"_integrity":"sha512-EzmGfYQETC7MxC4zwMkFgvmb/yxfwSGK3ZNVjk0JPVAFJk0R9uURz74S45O6PlZvn0GKNRWZi5ftM7omlkBjNQ==","_npmVersion":"10.8.3","description":"Composed off-main-thread decoder for OGC 3D-Tiles point clouds (v1.0 .pnts + v1.1 glTF POINTS): wires @bitruvius/gltf + draco into a worker-pooled CesiumPointDecoder","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/gltf":"^0.3.2","@bitruvius/draco":"^0.3.2","@bitruvius/geo-core":"^0.3.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/tiles3d-points_0.3.2_1785952495840_0.4414257957850447","host":"s3://npm-registry-packages-npm-production"}},"0.3.3":{"_id":"@bitruvius/tiles3d-points@0.3.3","bugs":{"url":"https://github.com/bitruvius/support"},"dist":{"shasum":"5c937e2254718ec4f4aeba67f6f4ff67c335505b","tarball":"https://registry.npmjs.org/@bitruvius/tiles3d-points/-/tiles3d-points-0.3.3.tgz","fileCount":11,"integrity":"sha512-Z3oAZz3+HOrmZ9f4Ky28MgqoClDMrb4eZ2HQa5hy6XORBYomk9xkUjkQGgSS4Y2qFT3XDZfoIDfLCmrYi/jRGg==","signatures":[{"sig":"MEQCIBH+FASNEAWl5T0Tg0fS9AhxnPctSsikXndJKUVCOmmQAiBRBang8Un1dJlh2btUF5eFvELcv9Mb4CkxcDVEoCe6fg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDQK/stITnDqSwDfPX0UvuoUt1VN44/Xnr9hbg9xeOdnQIgExjDrrdMac/FksPe8+nQoOnOFSFsCbbTM/JAXY2BcqQ="}],"unpackedSize":31139},"main":"./dist/index.js","name":"@bitruvius/tiles3d-points","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"5c937e2254718ec4f4aeba67f6f4ff67c335505b","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"license":"SEE LICENSE IN LICENSE","scripts":{"test":"bun test","build":"bun build ./src/index.ts ./src/point-decode-worker.ts --outdir dist --format esm --target browser --minify --external '@bitruvius/*' && tsc --emitDeclarationOnly"},"version":"0.3.3","_npmUser":{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},"homepage":"https://dev.bitruvius.com/sdks/js/","keywords":["bitruvius","geospatial","3d-tiles","point-cloud","pnts","draco","worker","decoder"],"_integrity":"sha512-Z3oAZz3+HOrmZ9f4Ky28MgqoClDMrb4eZ2HQa5hy6XORBYomk9xkUjkQGgSS4Y2qFT3XDZfoIDfLCmrYi/jRGg==","_npmVersion":"10.8.3","description":"Composed off-main-thread decoder for OGC 3D-Tiles point clouds (v1.0 .pnts + v1.1 glTF POINTS): wires @bitruvius/gltf + draco into a worker-pooled CesiumPointDecoder","directories":{},"maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"sideEffects":["./src/index.ts"],"_nodeVersion":"24.3.0","dependencies":{"@bitruvius/gltf":"^0.3.3","@bitruvius/draco":"^0.3.3","@bitruvius/geo-core":"^0.3.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tiles3d-points_0.3.3_1790299989512_0.4178261127155418"}}},"time":{"created":"2026-08-03T01:56:27.258Z","modified":"2026-09-25T01:33:09.767Z","0.1.0":"2026-07-24T21:36:28.367Z","0.3.0":"2026-08-03T01:56:27.594Z","0.3.1":"2026-08-03T02:52:09.211Z","0.3.2":"2026-08-05T17:54:56.081Z","0.3.3":"2026-09-25T01:33:09.614Z"},"bugs":{"url":"https://github.com/bitruvius/support"},"license":"SEE LICENSE IN LICENSE","homepage":"https://dev.bitruvius.com/sdks/js/","keywords":["bitruvius","geospatial","3d-tiles","point-cloud","pnts","draco","worker","decoder"],"description":"Composed off-main-thread decoder for OGC 3D-Tiles point clouds (v1.0 .pnts + v1.1 glTF POINTS): wires @bitruvius/gltf + draco into a worker-pooled CesiumPointDecoder","maintainers":[{"name":"geoffhtaylor3d","email":"geoffhtaylor3d@gmail.com"},{"name":"danrhedges","email":"danrhedges@gmail.com"}],"readme":"<p align=\"center\">\n  <a href=\"https://bitruvius.com\"><img src=\"https://cdn.bitruvius.com/brand/bitruvius-logo.png\" width=\"360\" alt=\"Bitruvius\"></a>\n</p>\n\n# @bitruvius/tiles3d-points\n\n**The composed OGC 3D Tiles point-cloud decoder: 1.0 `.pnts` and 1.1 glTF POINTS, uncompressed or Draco, decoded off the main thread.**\n\n> **Internal building block.** This package exists so that\n> [`@bitruvius/sdk-maplibre`](https://www.npmjs.com/package/@bitruvius/sdk-maplibre) and the\n> Bitruvius codecs can resolve their dependencies on npm. It has no standalone product story.\n> Unless you are deliberately building against it, install the SDK instead.\n\n## What it does\n\nHand it tile bytes and a georeference context. It sniffs the 4-byte magic and dispatches to the\n1.0 `.pnts` reader, the 1.1 glTF `POINTS` reader, or the first point-cloud inner of a `cmpt`\ncomposite, decodes Draco geometry where the tile is compressed, rebases the positions into the\nshared ENU meters frame, and returns a `PackedPointTile` the renderer uploads as it stands. By\ndefault all of that happens in a Web Worker pool.\n\nThe public surface is one interface: `CesiumPointDecoder` from\n[`@bitruvius/geo-core`](https://www.npmjs.com/package/@bitruvius/geo-core). Callers see `decode(buffer, ctx)`, `concurrency` and\n`dispose()`, and never see glTF, Draco or a worker.\n\n## Why it is its own package\n\n**Three packages meet here, and none of them is allowed to import another.**\n[`@bitruvius/gltf`](https://www.npmjs.com/package/@bitruvius/gltf) is a pure bytes-in parser with no wasm, so it takes compression\nthrough a seam (`Tiles3DPointDecoderSeams`). [`@bitruvius/draco`](https://www.npmjs.com/package/@bitruvius/draco) implements that seam\nand depends only on `@bitruvius/geo-core`, because I3S needs Draco too and never goes through the\nglTF parser. `@bitruvius/tiles3d`, the streaming engine, also depends on `@bitruvius/geo-core`\nalone and takes a `CesiumPointDecoder` by constructor injection. The wiring itself is three lines,\nand they are the only place the parser and the codec are named together:\n\n```ts\nimport { Tiles3DPointDecoder } from '@bitruvius/gltf';\nimport { DracoDecoder } from '@bitruvius/draco';\n\nnew Tiles3DPointDecoder({ draco: new DracoDecoder() });\n```\n\nThose lines have nowhere to live. Put them in the parser and every uncompressed tileset pays\nfor megabytes of wasm. Put them in the engine and streaming inherits a codec. Put them in the\nMapLibre layer and a custom renderer cannot reuse them. So the composition is a package, and it is\nthe only one in the chain that depends on both halves.\n\n**The worker chunk has to ship from here.** Draco point geometry plus packing millions of points\ninto the quantized ENU grid is heavy, and on the main thread it spends the map's frame budget. The\npool therefore spawns a published module worker,\n`new Worker(new URL('./point-decode-worker.js', import.meta.url))`. That worker entry imports the\nparser and the codec, so it can only be built and published by the package allowed to depend on\nboth. The chunk is as much the deliverable here as the API is.\n\n**Nothing in it knows about a renderer.** No MapLibre import, no GPU, no DOM. The MapLibre\npoint-cloud layer calls `createPointDecoder()` and injects the result, and a renderer of your own\nwith its own tile loop does exactly the same thing.\n\n## What is in it\n\n**`createPointDecoder(opts)`** builds the default decoder, Draco seam already wired.\n\n```ts\nimport { createPointDecoder } from '@bitruvius/tiles3d-points';\n\nconst decoder = createPointDecoder({ poolSize: 4 });\nconst tile = await decoder.decode(buffer, ctx);\n```\n\nIt runs a worker pool by default, sized from `navigator.hardwareConcurrency` and clamped to 1..4.\nPass `workers: false` for the main-thread path, which is also selected automatically where Web\nWorkers are unavailable, such as SSR and test environments.\n\n**`WorkerTiles3DPointDecoder`** is the pool itself, for the control the factory does not expose:\nexplicit Draco wasm bytes or an absolute `wasmUrl` for cross-origin and CDN hosting, or a custom\nworker factory. The pool spins up lazily on the first `decode`, so construction is cheap and\nside-effect free.\n\nThree behaviors are worth knowing before you build against it.\n\n**Transfers are zero-copy in both directions.** Tile bytes are transferred into the worker and\nconsumed, so do not reuse the buffer after calling `decode`. The packed tile transfers back out\nthe same way.\n\n**The Draco wasm URL is resolved on the main thread and forwarded per request**, because a worker\ncannot reliably resolve its package's sibling `wasm/` asset. Under a cross-origin CDN build the\nworker source is fetched once with a CORS GET and spawned from a same-origin Blob URL, since\n`new Worker(crossOriginUrl)` throws a synchronous `SecurityError`.\n\n**Degradation is reported, not silent.** If the pool cannot spawn (a blocked cross-origin worker,\nor a CSP without `worker-src blob:`) the decoder memoizes the failure, decodes on the main thread\nrather than handing the layer an empty scene, and calls `onDegraded` once. The MapLibre layer\nwires that to its `onError`. The memoization matters: `WorkerPool` spawns eagerly, so without it\nevery tile retries the spawn.\n\n## Who should depend on it\n\nIf you are putting 3D Tiles point clouds on a MapLibre map, install\n[`@bitruvius/sdk-maplibre`](https://www.npmjs.com/package/@bitruvius/sdk-maplibre) and let the\nlayer wire this for you. Depend on this package directly only when you are driving\n`@bitruvius/tiles3d`'s point engine, or your own tile loop, from a renderer of your own and want a\ndecoder that already covers both 3D Tiles versions.\n\nIts dependencies are `@bitruvius/geo-core`, `@bitruvius/gltf` and `@bitruvius/draco`, and nothing\nelse.\n\n## Trademarks\n\nCesium and 3D Tiles are trademarks of Cesium GS, Inc. glTF is a trademark of The Khronos Group\nInc. OGC is a trademark of the Open Geospatial Consortium. Google and Draco are trademarks of\nGoogle LLC. Esri and I3S are trademarks of Environmental Systems Research Institute, Inc.\nMapLibre is a trademark of the MapLibre organization. All other marks are the property of their\nrespective owners.\n\nThese names are used solely to describe the data formats this software interoperates with.\nBitruvius is not affiliated with, sponsored by, or endorsed by any of them, and no such\nrelationship is implied. Implementing a published specification is not a claim of certification: Bitruvius has not undergone OGC compliance testing for any standard.\n\n## License\n\nProprietary. The full terms ship as `LICENSE` inside this package, and are readable\nbefore installing at [cdn.bitruvius.com/legal/sdk-license-v1.txt](https://cdn.bitruvius.com/legal/sdk-license-v1.txt).\n\n© Bitruvius, Inc.\n","readmeFilename":"README.md"}