@loaders.gl/3d-tiles 4.0.4 → 4.1.0-alpha.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/dist/3d-tiles-archive/3d-tiles-archive-archive.d.ts.map +1 -1
- package/dist/3d-tiles-archive/3d-tiles-archive-archive.js.map +1 -1
- package/dist/3d-tiles-archive/3d-tiles-archive-parser.d.ts.map +1 -1
- package/dist/3d-tiles-archive/3d-tiles-archive-parser.js +2 -2
- package/dist/3d-tiles-archive/3d-tiles-archive-parser.js.map +1 -1
- package/dist/3d-tiles-archive-loader.d.ts.map +1 -1
- package/dist/3d-tiles-archive-loader.js +1 -1
- package/dist/3d-tiles-archive-loader.js.map +1 -1
- package/dist/cesium-ion-loader.d.ts.map +1 -1
- package/dist/cesium-ion-loader.js.map +1 -1
- package/dist/dist.dev.js +195 -58
- package/dist/index.cjs +31 -22
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/classes/helpers/tile-3d-accessor-utils.d.ts.map +1 -1
- package/dist/lib/classes/helpers/tile-3d-accessor-utils.js.map +1 -1
- package/dist/lib/classes/tile-3d-batch-table-hierarchy.d.ts.map +1 -1
- package/dist/lib/classes/tile-3d-batch-table-hierarchy.js.map +1 -1
- package/dist/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
- package/dist/lib/classes/tile-3d-batch-table.js.map +1 -1
- package/dist/lib/classes/tile-3d-feature-table.d.ts.map +1 -1
- package/dist/lib/classes/tile-3d-feature-table.js.map +1 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/dist/lib/constants.js.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-batched-model.d.ts.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-batched-model.js.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-composite.d.ts.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-composite.js.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-instanced-model.d.ts.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-instanced-model.js.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-point-cloud.d.ts.map +1 -1
- package/dist/lib/encoders/encode-3d-tile-point-cloud.js.map +1 -1
- package/dist/lib/encoders/encode-3d-tile.d.ts.map +1 -1
- package/dist/lib/encoders/encode-3d-tile.js.map +1 -1
- package/dist/lib/encoders/helpers/encode-3d-tile-header.d.ts.map +1 -1
- package/dist/lib/encoders/helpers/encode-3d-tile-header.js.map +1 -1
- package/dist/lib/filesystems/tiles-3d-archive-file-system.d.ts.map +1 -1
- package/dist/lib/filesystems/tiles-3d-archive-file-system.js +2 -2
- package/dist/lib/filesystems/tiles-3d-archive-file-system.js.map +1 -1
- package/dist/lib/ion/ion.d.ts.map +1 -1
- package/dist/lib/ion/ion.js.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-colors.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-colors.js.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-normals.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-normals.js.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-positions.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/normalize-3d-tile-positions.js.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +21 -19
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-gltf-view.js.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-header.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-header.js.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts +9 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +3 -2
- package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-tables.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-tile-tables.js.map +1 -1
- package/dist/lib/parsers/helpers/parse-utils.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-utils.js.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-batched-model.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-batched-model.js.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-composite.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-composite.js.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-header.js +6 -5
- package/dist/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-instanced-model.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-instanced-model.js.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-point-cloud.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-point-cloud.js.map +1 -1
- package/dist/lib/parsers/parse-3d-tile.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile.js.map +1 -1
- package/dist/lib/utils/obb/s2-corners-to-obb.d.ts.map +1 -1
- package/dist/lib/utils/obb/s2-corners-to-obb.js.map +1 -1
- package/dist/lib/utils/s2/converters/s2-to-boundary.d.ts.map +1 -1
- package/dist/lib/utils/s2/converters/s2-to-boundary.js.map +1 -1
- package/dist/lib/utils/s2/converters/s2-to-obb-points.d.ts.map +1 -1
- package/dist/lib/utils/s2/converters/s2-to-obb-points.js.map +1 -1
- package/dist/lib/utils/s2/converters/s2-to-region.d.ts.map +1 -1
- package/dist/lib/utils/s2/converters/s2-to-region.js.map +1 -1
- package/dist/lib/utils/s2/index.d.ts.map +1 -1
- package/dist/lib/utils/s2/index.js.map +1 -1
- package/dist/lib/utils/s2/s2-geometry-functions.d.ts.map +1 -1
- package/dist/lib/utils/s2/s2-geometry-functions.js.map +1 -1
- package/dist/lib/utils/s2/s2-token-functions.d.ts.map +1 -1
- package/dist/lib/utils/s2/s2-token-functions.js.map +1 -1
- package/dist/lib/utils/s2/s2geometry/s2-cell-utils.d.ts.map +1 -1
- package/dist/lib/utils/s2/s2geometry/s2-cell-utils.js.map +1 -1
- package/dist/lib/utils/s2/s2geometry/s2-geometry.d.ts.map +1 -1
- package/dist/lib/utils/s2/s2geometry/s2-geometry.js.map +1 -1
- package/dist/lib/utils/version.js +1 -1
- package/dist/lib/utils/version.js.map +1 -1
- package/dist/tile-3d-subtree-loader.d.ts.map +1 -1
- package/dist/tile-3d-subtree-loader.js.map +1 -1
- package/dist/tile-3d-writer.d.ts.map +1 -1
- package/dist/tile-3d-writer.js.map +1 -1
- package/dist/tiles-3d-loader.d.ts.map +1 -1
- package/dist/tiles-3d-loader.js.map +1 -1
- package/dist/types.d.ts +4 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +15 -12
- package/src/3d-tiles-archive/3d-tiles-archive-archive.ts +4 -0
- package/src/3d-tiles-archive/3d-tiles-archive-parser.ts +6 -2
- package/src/3d-tiles-archive-loader.ts +4 -0
- package/src/cesium-ion-loader.ts +4 -0
- package/src/index.ts +4 -0
- package/src/lib/classes/helpers/tile-3d-accessor-utils.ts +4 -0
- package/src/lib/classes/tile-3d-batch-table-hierarchy.ts +4 -0
- package/src/lib/classes/tile-3d-batch-table.ts +4 -0
- package/src/lib/classes/tile-3d-feature-table.ts +4 -0
- package/src/lib/constants.ts +4 -0
- package/src/lib/encoders/encode-3d-tile-batched-model.ts +4 -0
- package/src/lib/encoders/encode-3d-tile-composite.ts +4 -0
- package/src/lib/encoders/encode-3d-tile-instanced-model.ts +4 -0
- package/src/lib/encoders/encode-3d-tile-point-cloud.ts +4 -0
- package/src/lib/encoders/encode-3d-tile.ts +4 -0
- package/src/lib/encoders/helpers/encode-3d-tile-header.ts +4 -0
- package/src/lib/filesystems/tiles-3d-archive-file-system.ts +6 -2
- package/src/lib/ion/ion.ts +4 -0
- package/src/lib/parsers/helpers/normalize-3d-tile-colors.ts +4 -0
- package/src/lib/parsers/helpers/normalize-3d-tile-normals.ts +4 -0
- package/src/lib/parsers/helpers/normalize-3d-tile-positions.ts +4 -0
- package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +25 -16
- package/src/lib/parsers/helpers/parse-3d-tile-gltf-view.ts +4 -0
- package/src/lib/parsers/helpers/parse-3d-tile-header.ts +4 -0
- package/src/lib/parsers/helpers/parse-3d-tile-subtree.ts +11 -2
- package/src/lib/parsers/helpers/parse-3d-tile-tables.ts +4 -0
- package/src/lib/parsers/helpers/parse-utils.ts +4 -0
- package/src/lib/parsers/parse-3d-tile-batched-model.ts +4 -0
- package/src/lib/parsers/parse-3d-tile-composite.ts +4 -0
- package/src/lib/parsers/parse-3d-tile-gltf.ts +2 -1
- package/src/lib/parsers/parse-3d-tile-header.ts +11 -3
- package/src/lib/parsers/parse-3d-tile-instanced-model.ts +4 -0
- package/src/lib/parsers/parse-3d-tile-point-cloud.ts +4 -0
- package/src/lib/parsers/parse-3d-tile.ts +4 -0
- package/src/lib/utils/obb/s2-corners-to-obb.ts +4 -0
- package/src/lib/utils/s2/converters/s2-to-boundary.ts +4 -0
- package/src/lib/utils/s2/converters/s2-to-obb-points.ts +4 -0
- package/src/lib/utils/s2/converters/s2-to-region.ts +4 -0
- package/src/lib/utils/s2/index.ts +3 -1
- package/src/lib/utils/s2/s2-geometry-functions.ts +3 -1
- package/src/lib/utils/s2/s2-token-functions.ts +3 -2
- package/src/lib/utils/s2/s2geometry/s2-cell-utils.ts +3 -1
- package/src/lib/utils/s2/s2geometry/s2-geometry.ts +4 -1
- package/src/tile-3d-subtree-loader.ts +4 -0
- package/src/tile-3d-writer.ts +4 -0
- package/src/tiles-3d-loader.ts +4 -0
- package/src/types.ts +8 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-archive-archive.d.ts","sourceRoot":"","sources":["../../src/3d-tiles-archive/3d-tiles-archive-archive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"3d-tiles-archive-archive.d.ts","sourceRoot":"","sources":["../../src/3d-tiles-archive/3d-tiles-archive-archive.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAiBtD;;GAEG;AACH,qBAAa,cAAc;IACzB,uCAAuC;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,gBAAgB;IAChB,OAAO,CAAC,SAAS,CAAyB;IAE1C;;;;OAIG;gBACS,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAKzE;;;;OAIG;IACG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAcjD;;;;OAIG;YACW,YAAY;CAyB3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-archive-archive.js","names":["MD5Hash","DeflateCompression","NoCompression","parseZipLocalFileHeader","COMPRESSION_METHODS","data","decompress","raw","Tiles3DArchive","constructor","fileProvider","hashTable","getFile","path","getFileBytes","toLocaleLowerCase","Error","arrayBuffer","TextEncoder","encode","buffer","nameHash","hash","byteOffset","undefined","localFileHeader","compressedFile","slice","fileDataOffset","compressedSize","compressionMethod"],"sources":["../../src/3d-tiles-archive/3d-tiles-archive-archive.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"3d-tiles-archive-archive.js","names":["MD5Hash","DeflateCompression","NoCompression","parseZipLocalFileHeader","COMPRESSION_METHODS","data","decompress","raw","Tiles3DArchive","constructor","fileProvider","hashTable","getFile","path","getFileBytes","toLocaleLowerCase","Error","arrayBuffer","TextEncoder","encode","buffer","nameHash","hash","byteOffset","undefined","localFileHeader","compressedFile","slice","fileDataOffset","compressedSize","compressionMethod"],"sources":["../../src/3d-tiles-archive/3d-tiles-archive-archive.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport {FileProvider} from '@loaders.gl/loader-utils';\nimport {MD5Hash} from '@loaders.gl/crypto';\nimport {DeflateCompression, NoCompression} from '@loaders.gl/compression';\nimport {parseZipLocalFileHeader} from '@loaders.gl/zip';\n\ntype CompressionHandler = (compressedFile: ArrayBuffer) => Promise<ArrayBuffer>;\n\n/**\n * Handling different compression types in zip\n */\nconst COMPRESSION_METHODS: {[key: number]: CompressionHandler} = {\n /** No compression */\n 0: (data) => new NoCompression().decompress(data),\n /** Deflation */\n 8: (data) => new DeflateCompression({raw: true}).decompress(data)\n};\n\n/**\n * Class for handling information about 3tz file\n */\nexport class Tiles3DArchive {\n /** FileProvider with whe whole file */\n private fileProvider: FileProvider;\n /** hash info */\n private hashTable: Record<string, bigint>;\n\n /**\n * creates Tiles3DArchive handler\n * @param fileProvider - FileProvider with the whole file\n * @param hashTable - hash info\n */\n constructor(fileProvider: FileProvider, hashTable: Record<string, bigint>) {\n this.fileProvider = fileProvider;\n this.hashTable = hashTable;\n }\n\n /**\n * Returns file with the given path from 3tz archive\n * @param path - path inside the 3tz\n * @returns buffer with ready to use file\n */\n async getFile(path: string): Promise<ArrayBuffer> {\n // sometimes paths are not in lower case when hash file is created,\n // so first we're looking for lower case file name and then for original one\n let data = await this.getFileBytes(path.toLocaleLowerCase());\n if (!data) {\n data = await this.getFileBytes(path);\n }\n if (!data) {\n throw new Error(`No such file in the archive: ${path}`);\n }\n\n return data;\n }\n\n /**\n * Trying to get raw file data by adress\n * @param path - path inside the archive\n * @returns buffer with the raw file data\n */\n private async getFileBytes(path: string): Promise<ArrayBuffer | null> {\n const arrayBuffer = new TextEncoder().encode(path).buffer;\n const nameHash = await new MD5Hash().hash(arrayBuffer, 'hex');\n const byteOffset = this.hashTable[nameHash];\n if (byteOffset === undefined) {\n return null;\n }\n\n const localFileHeader = await parseZipLocalFileHeader(byteOffset, this.fileProvider);\n if (!localFileHeader) {\n return null;\n }\n\n const compressedFile = await this.fileProvider.slice(\n localFileHeader.fileDataOffset,\n localFileHeader.fileDataOffset + localFileHeader.compressedSize\n );\n\n const compressionMethod = COMPRESSION_METHODS[localFileHeader.compressionMethod];\n if (!compressionMethod) {\n throw Error('Only Deflation compression is supported');\n }\n\n return compressionMethod(compressedFile);\n }\n}\n"],"mappings":"AAKA,SAAQA,OAAO,QAAO,oBAAoB;AAC1C,SAAQC,kBAAkB,EAAEC,aAAa,QAAO,yBAAyB;AACzE,SAAQC,uBAAuB,QAAO,iBAAiB;AAOvD,MAAMC,mBAAwD,GAAG;EAE/D,CAAC,EAAGC,IAAI,IAAK,IAAIH,aAAa,CAAC,CAAC,CAACI,UAAU,CAACD,IAAI,CAAC;EAEjD,CAAC,EAAGA,IAAI,IAAK,IAAIJ,kBAAkB,CAAC;IAACM,GAAG,EAAE;EAAI,CAAC,CAAC,CAACD,UAAU,CAACD,IAAI;AAClE,CAAC;AAKD,OAAO,MAAMG,cAAc,CAAC;EAW1BC,WAAWA,CAACC,YAA0B,EAAEC,SAAiC,EAAE;IAAA,KATnED,YAAY;IAAA,KAEZC,SAAS;IAQf,IAAI,CAACD,YAAY,GAAGA,YAAY;IAChC,IAAI,CAACC,SAAS,GAAGA,SAAS;EAC5B;EAOA,MAAMC,OAAOA,CAACC,IAAY,EAAwB;IAGhD,IAAIR,IAAI,GAAG,MAAM,IAAI,CAACS,YAAY,CAACD,IAAI,CAACE,iBAAiB,CAAC,CAAC,CAAC;IAC5D,IAAI,CAACV,IAAI,EAAE;MACTA,IAAI,GAAG,MAAM,IAAI,CAACS,YAAY,CAACD,IAAI,CAAC;IACtC;IACA,IAAI,CAACR,IAAI,EAAE;MACT,MAAM,IAAIW,KAAK,CAAE,gCAA+BH,IAAK,EAAC,CAAC;IACzD;IAEA,OAAOR,IAAI;EACb;EAOA,MAAcS,YAAYA,CAACD,IAAY,EAA+B;IACpE,MAAMI,WAAW,GAAG,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACN,IAAI,CAAC,CAACO,MAAM;IACzD,MAAMC,QAAQ,GAAG,MAAM,IAAIrB,OAAO,CAAC,CAAC,CAACsB,IAAI,CAACL,WAAW,EAAE,KAAK,CAAC;IAC7D,MAAMM,UAAU,GAAG,IAAI,CAACZ,SAAS,CAACU,QAAQ,CAAC;IAC3C,IAAIE,UAAU,KAAKC,SAAS,EAAE;MAC5B,OAAO,IAAI;IACb;IAEA,MAAMC,eAAe,GAAG,MAAMtB,uBAAuB,CAACoB,UAAU,EAAE,IAAI,CAACb,YAAY,CAAC;IACpF,IAAI,CAACe,eAAe,EAAE;MACpB,OAAO,IAAI;IACb;IAEA,MAAMC,cAAc,GAAG,MAAM,IAAI,CAAChB,YAAY,CAACiB,KAAK,CAClDF,eAAe,CAACG,cAAc,EAC9BH,eAAe,CAACG,cAAc,GAAGH,eAAe,CAACI,cACnD,CAAC;IAED,MAAMC,iBAAiB,GAAG1B,mBAAmB,CAACqB,eAAe,CAACK,iBAAiB,CAAC;IAChF,IAAI,CAACA,iBAAiB,EAAE;MACtB,MAAMd,KAAK,CAAC,yCAAyC,CAAC;IACxD;IAEA,OAAOc,iBAAiB,CAACJ,cAAc,CAAC;EAC1C;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-archive-parser.d.ts","sourceRoot":"","sources":["../../src/3d-tiles-archive/3d-tiles-archive-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"3d-tiles-archive-parser.d.ts","sourceRoot":"","sources":["../../src/3d-tiles-archive/3d-tiles-archive-parser.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,YAAY,EAAC,MAAM,0BAA0B,CAAC;AAStD,OAAO,EAAC,cAAc,EAAC,MAAM,4BAA4B,CAAC;AAE1D;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,iBAChB,YAAY,cACf,MAAM,KAAK,IAAI,kBACzB,QAAQ,cAAc,CA+BxB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CD_HEADER_SIGNATURE, makeHashTableFromZipHeaders, parseHashTable, parseZipCDFileHeader, parseZipLocalFileHeader, searchFromTheEnd } from '@loaders.gl/zip';
|
|
2
2
|
import { Tiles3DArchive } from "./3d-tiles-archive-archive.js";
|
|
3
3
|
export const parse3DTilesArchive = async (fileProvider, cb) => {
|
|
4
|
-
const hashCDOffset = await searchFromTheEnd(fileProvider,
|
|
4
|
+
const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);
|
|
5
5
|
const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);
|
|
6
6
|
let hashTable;
|
|
7
7
|
if ((cdFileHeader === null || cdFileHeader === void 0 ? void 0 : cdFileHeader.fileName) !== '@3dtilesIndex1@') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-archive-parser.js","names":["
|
|
1
|
+
{"version":3,"file":"3d-tiles-archive-parser.js","names":["CD_HEADER_SIGNATURE","makeHashTableFromZipHeaders","parseHashTable","parseZipCDFileHeader","parseZipLocalFileHeader","searchFromTheEnd","Tiles3DArchive","parse3DTilesArchive","fileProvider","cb","hashCDOffset","cdFileHeader","hashTable","fileName","localFileHeader","localHeaderOffset","Error","fileDataOffset","hashFile","slice","compressedSize"],"sources":["../../src/3d-tiles-archive/3d-tiles-archive-parser.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport {FileProvider} from '@loaders.gl/loader-utils';\nimport {\n CD_HEADER_SIGNATURE,\n makeHashTableFromZipHeaders,\n parseHashTable,\n parseZipCDFileHeader,\n parseZipLocalFileHeader,\n searchFromTheEnd\n} from '@loaders.gl/zip';\nimport {Tiles3DArchive} from './3d-tiles-archive-archive';\n\n/**\n * Creates 3tz file handler from raw file\n * @param fileProvider raw file data\n * @param cb is called with information message during parsing\n * @returns 3tz file handler\n */\nexport const parse3DTilesArchive = async (\n fileProvider: FileProvider,\n cb?: (msg: string) => void\n): Promise<Tiles3DArchive> => {\n const hashCDOffset = await searchFromTheEnd(fileProvider, CD_HEADER_SIGNATURE);\n\n const cdFileHeader = await parseZipCDFileHeader(hashCDOffset, fileProvider);\n\n let hashTable: Record<string, bigint>;\n if (cdFileHeader?.fileName !== '@3dtilesIndex1@') {\n hashTable = await makeHashTableFromZipHeaders(fileProvider);\n cb?.(\n '3tz doesnt contain hash file, hash info has been composed according to zip archive headers'\n );\n } else {\n // cb?.('3tz contains hash file');\n const localFileHeader = await parseZipLocalFileHeader(\n cdFileHeader.localHeaderOffset,\n fileProvider\n );\n if (!localFileHeader) {\n throw new Error('corrupted 3tz zip archive');\n }\n\n const fileDataOffset = localFileHeader.fileDataOffset;\n const hashFile = await fileProvider.slice(\n fileDataOffset,\n fileDataOffset + localFileHeader.compressedSize\n );\n\n hashTable = parseHashTable(hashFile);\n }\n\n return new Tiles3DArchive(fileProvider, hashTable);\n};\n"],"mappings":"AAKA,SACEA,mBAAmB,EACnBC,2BAA2B,EAC3BC,cAAc,EACdC,oBAAoB,EACpBC,uBAAuB,EACvBC,gBAAgB,QACX,iBAAiB;AAAC,SACjBC,cAAc;AAQtB,OAAO,MAAMC,mBAAmB,GAAG,MAAAA,CACjCC,YAA0B,EAC1BC,EAA0B,KACE;EAC5B,MAAMC,YAAY,GAAG,MAAML,gBAAgB,CAACG,YAAY,EAAER,mBAAmB,CAAC;EAE9E,MAAMW,YAAY,GAAG,MAAMR,oBAAoB,CAACO,YAAY,EAAEF,YAAY,CAAC;EAE3E,IAAII,SAAiC;EACrC,IAAI,CAAAD,YAAY,aAAZA,YAAY,uBAAZA,YAAY,CAAEE,QAAQ,MAAK,iBAAiB,EAAE;IAChDD,SAAS,GAAG,MAAMX,2BAA2B,CAACO,YAAY,CAAC;IAC3DC,EAAE,aAAFA,EAAE,uBAAFA,EAAE,CACA,4FACF,CAAC;EACH,CAAC,MAAM;IAEL,MAAMK,eAAe,GAAG,MAAMV,uBAAuB,CACnDO,YAAY,CAACI,iBAAiB,EAC9BP,YACF,CAAC;IACD,IAAI,CAACM,eAAe,EAAE;MACpB,MAAM,IAAIE,KAAK,CAAC,2BAA2B,CAAC;IAC9C;IAEA,MAAMC,cAAc,GAAGH,eAAe,CAACG,cAAc;IACrD,MAAMC,QAAQ,GAAG,MAAMV,YAAY,CAACW,KAAK,CACvCF,cAAc,EACdA,cAAc,GAAGH,eAAe,CAACM,cACnC,CAAC;IAEDR,SAAS,GAAGV,cAAc,CAACgB,QAAQ,CAAC;EACtC;EAEA,OAAO,IAAIZ,cAAc,CAACE,YAAY,EAAEI,SAAS,CAAC;AACpD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-archive-loader.d.ts","sourceRoot":"","sources":["../src/3d-tiles-archive-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"3d-tiles-archive-loader.d.ts","sourceRoot":"","sources":["../src/3d-tiles-archive-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAQ9E,oCAAoC;AACpC,MAAM,MAAM,+BAA+B,GAAG,aAAa,GAAG;IAC5D,kBAAkB,CAAC,EAAE;QACnB,kCAAkC;QAClC,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,gBAAgB,CACrD,WAAW,EACX,KAAK,EACL,+BAA+B,CAUhC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DataViewFile } from '@loaders.gl/loader-utils';
|
|
2
2
|
import { parse3DTilesArchive as parse3DTilesArchiveFromProvider } from "./3d-tiles-archive/3d-tiles-archive-parser.js";
|
|
3
|
-
const VERSION = typeof
|
|
3
|
+
const VERSION = typeof "4.1.0-alpha.10" !== 'undefined' ? "4.1.0-alpha.10" : 'latest';
|
|
4
4
|
export const Tiles3DArchiveFileLoader = {
|
|
5
5
|
name: '3tz',
|
|
6
6
|
id: '3tz',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"3d-tiles-archive-loader.js","names":["DataViewFile","parse3DTilesArchive","parse3DTilesArchiveFromProvider","VERSION","
|
|
1
|
+
{"version":3,"file":"3d-tiles-archive-loader.js","names":["DataViewFile","parse3DTilesArchive","parse3DTilesArchiveFromProvider","VERSION","Tiles3DArchiveFileLoader","name","id","module","version","mimeTypes","parse","extensions","options","data","_options$3dTilesArc","_options$3dTilesArc2","arguments","length","undefined","archive","DataView","getFile","path"],"sources":["../src/3d-tiles-archive-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {DataViewFile} from '@loaders.gl/loader-utils';\nimport {parse3DTilesArchive as parse3DTilesArchiveFromProvider} from './3d-tiles-archive/3d-tiles-archive-parser';\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 to load data from 3tz */\nexport type Tiles3DArchiveFileLoaderOptions = LoaderOptions & {\n '3d-tiles-archive'?: {\n /** path inside the 3tz archive */\n path?: string;\n };\n};\n\n/**\n * Loader for 3tz packages\n */\nexport const Tiles3DArchiveFileLoader: LoaderWithParser<\n ArrayBuffer,\n never,\n Tiles3DArchiveFileLoaderOptions\n> = {\n name: '3tz',\n id: '3tz',\n module: '3d-tiles',\n version: VERSION,\n mimeTypes: ['application/octet-stream', 'application/vnd.maxar.archive.3tz+zip'],\n parse: parse3DTilesArchive,\n extensions: ['3tz'],\n options: {}\n};\n\n/**\n * returns a single file from the 3tz archive\n * @param data 3tz archive data\n * @param options options\n * @returns requested file\n */\nasync function parse3DTilesArchive(\n data: ArrayBuffer,\n options: Tiles3DArchiveFileLoaderOptions = {}\n): Promise<ArrayBuffer> {\n const archive = await parse3DTilesArchiveFromProvider(new DataViewFile(new DataView(data)));\n return archive.getFile(options['3d-tiles-archive']?.path ?? '');\n}\n"],"mappings":"AAKA,SAAQA,YAAY,QAAO,0BAA0B;AAAC,SAC9CC,mBAAmB,IAAIC,+BAA+B;AAI9D,MAAMC,OAAO,GAAG,uBAAkB,KAAK,WAAW,sBAAiB,QAAQ;AAa3E,OAAO,MAAMC,wBAIZ,GAAG;EACFC,IAAI,EAAE,KAAK;EACXC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,UAAU;EAClBC,OAAO,EAAEL,OAAO;EAChBM,SAAS,EAAE,CAAC,0BAA0B,EAAE,uCAAuC,CAAC;EAChFC,KAAK,EAAET,mBAAmB;EAC1BU,UAAU,EAAE,CAAC,KAAK,CAAC;EACnBC,OAAO,EAAE,CAAC;AACZ,CAAC;AAQD,eAAeX,mBAAmBA,CAChCY,IAAiB,EAEK;EAAA,IAAAC,mBAAA,EAAAC,oBAAA;EAAA,IADtBH,OAAwC,GAAAI,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE7C,MAAMG,OAAO,GAAG,MAAMjB,+BAA+B,CAAC,IAAIF,YAAY,CAAC,IAAIoB,QAAQ,CAACP,IAAI,CAAC,CAAC,CAAC;EAC3F,OAAOM,OAAO,CAACE,OAAO,EAAAP,mBAAA,IAAAC,oBAAA,GAACH,OAAO,CAAC,kBAAkB,CAAC,cAAAG,oBAAA,uBAA3BA,oBAAA,CAA6BO,IAAI,cAAAR,mBAAA,cAAAA,mBAAA,GAAI,EAAE,CAAC;AACjE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cesium-ion-loader.d.ts","sourceRoot":"","sources":["../src/cesium-ion-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cesium-ion-loader.d.ts","sourceRoot":"","sources":["../src/cesium-ion-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAiB9E;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,aAAa,CAmB3E,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cesium-ion-loader.js","names":["Tiles3DLoader","getIonTilesetMetadata","preload","url","options","arguments","length","undefined","accessToken","assetId","Number","isFinite","matched","match","CesiumIonLoader","id","name","parse","data","context","loader"],"sources":["../src/cesium-ion-loader.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"cesium-ion-loader.js","names":["Tiles3DLoader","getIonTilesetMetadata","preload","url","options","arguments","length","undefined","accessToken","assetId","Number","isFinite","matched","match","CesiumIonLoader","id","name","parse","data","context","loader"],"sources":["../src/cesium-ion-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright vis.gl contributors\n\nimport type {LoaderOptions, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport {Tiles3DLoader} from './tiles-3d-loader';\nimport {getIonTilesetMetadata} from './lib/ion/ion';\n\nasync function preload(url, options = {}) {\n options = options['cesium-ion'] || {};\n // @ts-ignore\n const {accessToken} = options;\n // @ts-ignore\n let assetId = options.assetId;\n if (!Number.isFinite(assetId)) {\n const matched = url.match(/\\/([0-9]+)\\/tileset.json/);\n assetId = matched && matched[1];\n }\n return getIonTilesetMetadata(accessToken, assetId);\n}\n\n/**\n * Loader for 3D tiles from Cesium ION\n */\nexport const CesiumIonLoader: LoaderWithParser<unknown, never, LoaderOptions> = {\n ...Tiles3DLoader,\n id: 'cesium-ion',\n name: 'Cesium Ion',\n // @ts-ignore\n preload,\n parse: async (data, options?, context?) => {\n options = {...options};\n options['3d-tiles'] = options['cesium-ion'];\n // @ts-ignore\n options.loader = CesiumIonLoader;\n return Tiles3DLoader.parse(data, options, context); // , loader);\n },\n options: {\n 'cesium-ion': {\n ...Tiles3DLoader.options['3d-tiles'],\n accessToken: null\n }\n }\n};\n"],"mappings":"SAKQA,aAAa;AAAA,SACbC,qBAAqB;AAE7B,eAAeC,OAAOA,CAACC,GAAG,EAAgB;EAAA,IAAdC,OAAO,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACtCD,OAAO,GAAGA,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;EAErC,MAAM;IAACI;EAAW,CAAC,GAAGJ,OAAO;EAE7B,IAAIK,OAAO,GAAGL,OAAO,CAACK,OAAO;EAC7B,IAAI,CAACC,MAAM,CAACC,QAAQ,CAACF,OAAO,CAAC,EAAE;IAC7B,MAAMG,OAAO,GAAGT,GAAG,CAACU,KAAK,CAAC,0BAA0B,CAAC;IACrDJ,OAAO,GAAGG,OAAO,IAAIA,OAAO,CAAC,CAAC,CAAC;EACjC;EACA,OAAOX,qBAAqB,CAACO,WAAW,EAAEC,OAAO,CAAC;AACpD;AAKA,OAAO,MAAMK,eAAgE,GAAG;EAC9E,GAAGd,aAAa;EAChBe,EAAE,EAAE,YAAY;EAChBC,IAAI,EAAE,YAAY;EAElBd,OAAO;EACPe,KAAK,EAAE,MAAAA,CAAOC,IAAI,EAAEd,OAAQ,EAAEe,OAAQ,KAAK;IACzCf,OAAO,GAAG;MAAC,GAAGA;IAAO,CAAC;IACtBA,OAAO,CAAC,UAAU,CAAC,GAAGA,OAAO,CAAC,YAAY,CAAC;IAE3CA,OAAO,CAACgB,MAAM,GAAGN,eAAe;IAChC,OAAOd,aAAa,CAACiB,KAAK,CAACC,IAAI,EAAEd,OAAO,EAAEe,OAAO,CAAC;EACpD,CAAC;EACDf,OAAO,EAAE;IACP,YAAY,EAAE;MACZ,GAAGJ,aAAa,CAACI,OAAO,CAAC,UAAU,CAAC;MACpCI,WAAW,EAAE;IACf;EACF;AACF,CAAC"}
|
package/dist/dist.dev.js
CHANGED
|
@@ -4302,15 +4302,14 @@ var __exports__ = (() => {
|
|
|
4302
4302
|
var nodeVersion = matches && parseFloat(matches[1]) || 0;
|
|
4303
4303
|
|
|
4304
4304
|
// ../worker-utils/src/lib/env-utils/version.ts
|
|
4305
|
-
var NPM_TAG = "latest";
|
|
4306
4305
|
function getVersion() {
|
|
4307
4306
|
if (!globalThis._loadersgl_?.version) {
|
|
4308
4307
|
globalThis._loadersgl_ = globalThis._loadersgl_ || {};
|
|
4309
|
-
if (
|
|
4308
|
+
if (false) {
|
|
4310
4309
|
console.warn("loaders.gl: The __VERSION__ variable is not injected using babel plugin. Latest unstable workers would be fetched from the CDN.");
|
|
4311
4310
|
globalThis._loadersgl_.version = NPM_TAG;
|
|
4312
4311
|
} else {
|
|
4313
|
-
globalThis._loadersgl_.version =
|
|
4312
|
+
globalThis._loadersgl_.version = "4.1.0-alpha.10";
|
|
4314
4313
|
}
|
|
4315
4314
|
}
|
|
4316
4315
|
return globalThis._loadersgl_.version;
|
|
@@ -4472,6 +4471,9 @@ var __exports__ = (() => {
|
|
|
4472
4471
|
return true;
|
|
4473
4472
|
}
|
|
4474
4473
|
function concatenateArrayBuffers(...sources) {
|
|
4474
|
+
return concatenateArrayBuffersFromArray(sources);
|
|
4475
|
+
}
|
|
4476
|
+
function concatenateArrayBuffersFromArray(sources) {
|
|
4475
4477
|
const sourceArrays = sources.map((source2) => source2 instanceof ArrayBuffer ? new Uint8Array(source2) : source2);
|
|
4476
4478
|
const byteLength = sourceArrays.reduce((length4, typedArray) => length4 + typedArray.byteLength, 0);
|
|
4477
4479
|
const result = new Uint8Array(byteLength);
|
|
@@ -4815,6 +4817,12 @@ var __exports__ = (() => {
|
|
|
4815
4817
|
async stat() {
|
|
4816
4818
|
throw NOT_IMPLEMENTED;
|
|
4817
4819
|
}
|
|
4820
|
+
async truncate(length4) {
|
|
4821
|
+
throw NOT_IMPLEMENTED;
|
|
4822
|
+
}
|
|
4823
|
+
async append(data) {
|
|
4824
|
+
throw NOT_IMPLEMENTED;
|
|
4825
|
+
}
|
|
4818
4826
|
async close() {
|
|
4819
4827
|
}
|
|
4820
4828
|
};
|
|
@@ -4826,9 +4834,14 @@ var __exports__ = (() => {
|
|
|
4826
4834
|
|
|
4827
4835
|
// ../loader-utils/src/lib/file-provider/file-handle-file.ts
|
|
4828
4836
|
var FileHandleFile = class {
|
|
4829
|
-
constructor(path) {
|
|
4830
|
-
this.file = new NodeFileFacade(path, "r");
|
|
4831
|
-
|
|
4837
|
+
constructor(path, append = false) {
|
|
4838
|
+
this.file = new NodeFileFacade(path, append ? "a+" : "r");
|
|
4839
|
+
}
|
|
4840
|
+
async truncate(length4) {
|
|
4841
|
+
await this.file.truncate(length4);
|
|
4842
|
+
}
|
|
4843
|
+
async append(buffer) {
|
|
4844
|
+
await this.file.append(buffer);
|
|
4832
4845
|
}
|
|
4833
4846
|
async destroy() {
|
|
4834
4847
|
await this.file.close();
|
|
@@ -4874,7 +4887,7 @@ var __exports__ = (() => {
|
|
|
4874
4887
|
return await this.file.read(startOffset, length4);
|
|
4875
4888
|
}
|
|
4876
4889
|
get length() {
|
|
4877
|
-
return this.
|
|
4890
|
+
return this.file.bigsize;
|
|
4878
4891
|
}
|
|
4879
4892
|
};
|
|
4880
4893
|
|
|
@@ -10073,7 +10086,7 @@ var __exports__ = (() => {
|
|
|
10073
10086
|
}({});
|
|
10074
10087
|
|
|
10075
10088
|
// src/lib/utils/version.ts
|
|
10076
|
-
var VERSION2 =
|
|
10089
|
+
var VERSION2 = true ? "4.1.0-alpha.10" : "latest";
|
|
10077
10090
|
|
|
10078
10091
|
// src/lib/constants.ts
|
|
10079
10092
|
var TILE3D_TYPE = {
|
|
@@ -10107,17 +10120,9 @@ var __exports__ = (() => {
|
|
|
10107
10120
|
}
|
|
10108
10121
|
|
|
10109
10122
|
// ../draco/src/lib/utils/version.ts
|
|
10110
|
-
var VERSION3 =
|
|
10123
|
+
var VERSION3 = true ? "4.1.0-alpha.10" : "latest";
|
|
10111
10124
|
|
|
10112
10125
|
// ../draco/src/draco-loader.ts
|
|
10113
|
-
var DEFAULT_DRACO_OPTIONS = {
|
|
10114
|
-
draco: {
|
|
10115
|
-
decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
|
|
10116
|
-
libraryPath: "libs/",
|
|
10117
|
-
extraAttributes: {},
|
|
10118
|
-
attributeNameEntry: void 0
|
|
10119
|
-
}
|
|
10120
|
-
};
|
|
10121
10126
|
var DracoLoader = {
|
|
10122
10127
|
name: "Draco",
|
|
10123
10128
|
id: "draco",
|
|
@@ -10128,7 +10133,14 @@ var __exports__ = (() => {
|
|
|
10128
10133
|
mimeTypes: ["application/octet-stream"],
|
|
10129
10134
|
binary: true,
|
|
10130
10135
|
tests: ["DRACO"],
|
|
10131
|
-
options:
|
|
10136
|
+
options: {
|
|
10137
|
+
draco: {
|
|
10138
|
+
decoderType: typeof WebAssembly === "object" ? "wasm" : "js",
|
|
10139
|
+
libraryPath: "libs/",
|
|
10140
|
+
extraAttributes: {},
|
|
10141
|
+
attributeNameEntry: void 0
|
|
10142
|
+
}
|
|
10143
|
+
}
|
|
10132
10144
|
};
|
|
10133
10145
|
|
|
10134
10146
|
// ../schema/src/lib/table/simple-table/data-type.ts
|
|
@@ -10827,11 +10839,6 @@ var __exports__ = (() => {
|
|
|
10827
10839
|
return octDecodeInRange(x, y, 255, result);
|
|
10828
10840
|
}
|
|
10829
10841
|
|
|
10830
|
-
// ../math/src/geometry/utils/coordinates.ts
|
|
10831
|
-
function emod(n2) {
|
|
10832
|
-
return (n2 % 1 + 1) % 1;
|
|
10833
|
-
}
|
|
10834
|
-
|
|
10835
10842
|
// src/lib/classes/tile-3d-feature-table.ts
|
|
10836
10843
|
var Tile3DFeatureTable = class {
|
|
10837
10844
|
featuresLength = 0;
|
|
@@ -11815,7 +11822,7 @@ var __exports__ = (() => {
|
|
|
11815
11822
|
});
|
|
11816
11823
|
|
|
11817
11824
|
// ../images/src/lib/utils/version.ts
|
|
11818
|
-
var VERSION4 =
|
|
11825
|
+
var VERSION4 = true ? "4.1.0-alpha.10" : "latest";
|
|
11819
11826
|
|
|
11820
11827
|
// ../images/src/lib/category-api/image-type.ts
|
|
11821
11828
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
|
@@ -12818,6 +12825,9 @@ var __exports__ = (() => {
|
|
|
12818
12825
|
};
|
|
12819
12826
|
|
|
12820
12827
|
// ../gltf/src/lib/extensions/utils/3d-tiles-utils.ts
|
|
12828
|
+
function emod(n2) {
|
|
12829
|
+
return (n2 % 1 + 1) % 1;
|
|
12830
|
+
}
|
|
12821
12831
|
var ATTRIBUTE_TYPE_TO_COMPONENTS2 = {
|
|
12822
12832
|
SCALAR: 1,
|
|
12823
12833
|
VEC2: 2,
|
|
@@ -13521,10 +13531,10 @@ var __exports__ = (() => {
|
|
|
13521
13531
|
}
|
|
13522
13532
|
|
|
13523
13533
|
// ../gltf/src/lib/utils/version.ts
|
|
13524
|
-
var VERSION5 =
|
|
13534
|
+
var VERSION5 = true ? "4.1.0-alpha.10" : "latest";
|
|
13525
13535
|
|
|
13526
13536
|
// ../textures/src/lib/utils/version.ts
|
|
13527
|
-
var VERSION6 =
|
|
13537
|
+
var VERSION6 = true ? "4.1.0-alpha.10" : "latest";
|
|
13528
13538
|
|
|
13529
13539
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
13530
13540
|
var BASIS_EXTERNAL_LIBRARIES = {
|
|
@@ -15909,7 +15919,8 @@ var __exports__ = (() => {
|
|
|
15909
15919
|
availabilityObject.explicitBitstream = new Uint8Array(data, bufferView.byteOffset, bufferView.byteLength);
|
|
15910
15920
|
return;
|
|
15911
15921
|
}
|
|
15912
|
-
|
|
15922
|
+
const bufferStart = subtree.buffers.slice(0, bufferView.buffer).reduce((offset, buf) => offset + buf.byteLength, 0);
|
|
15923
|
+
availabilityObject.explicitBitstream = new Uint8Array(internalBinaryBuffer.slice(bufferStart, bufferStart + buffer.byteLength), bufferView.byteOffset, bufferView.byteLength);
|
|
15913
15924
|
}
|
|
15914
15925
|
function parseUint64Value(buffer) {
|
|
15915
15926
|
const dataView = new DataView(buffer);
|
|
@@ -17661,11 +17672,11 @@ var __exports__ = (() => {
|
|
|
17661
17672
|
}
|
|
17662
17673
|
|
|
17663
17674
|
// src/lib/parsers/helpers/parse-3d-implicit-tiles.ts
|
|
17664
|
-
var
|
|
17665
|
-
var
|
|
17675
|
+
var QUADTREE_DIVISION_COUNT = 4;
|
|
17676
|
+
var OCTREE_DIVISION_COUNT = 8;
|
|
17666
17677
|
var SUBDIVISION_COUNT_MAP = {
|
|
17667
|
-
QUADTREE:
|
|
17668
|
-
OCTREE:
|
|
17678
|
+
QUADTREE: QUADTREE_DIVISION_COUNT,
|
|
17679
|
+
OCTREE: OCTREE_DIVISION_COUNT
|
|
17669
17680
|
};
|
|
17670
17681
|
function getChildS2VolumeBox(s2VolumeBox, index, subdivisionScheme) {
|
|
17671
17682
|
if (s2VolumeBox?.box) {
|
|
@@ -17707,19 +17718,19 @@ var __exports__ = (() => {
|
|
|
17707
17718
|
z: 0
|
|
17708
17719
|
},
|
|
17709
17720
|
childIndex = 0,
|
|
17721
|
+
s2VolumeBox,
|
|
17722
|
+
loaderOptions
|
|
17723
|
+
} = params;
|
|
17724
|
+
let {
|
|
17725
|
+
subtree,
|
|
17726
|
+
level = 0,
|
|
17710
17727
|
globalData = {
|
|
17711
17728
|
level: 0,
|
|
17712
17729
|
mortonIndex: 0,
|
|
17713
17730
|
x: 0,
|
|
17714
17731
|
y: 0,
|
|
17715
17732
|
z: 0
|
|
17716
|
-
}
|
|
17717
|
-
s2VolumeBox,
|
|
17718
|
-
loaderOptions
|
|
17719
|
-
} = params;
|
|
17720
|
-
let {
|
|
17721
|
-
subtree,
|
|
17722
|
-
level = 0
|
|
17733
|
+
}
|
|
17723
17734
|
} = params;
|
|
17724
17735
|
const {
|
|
17725
17736
|
subdivisionScheme,
|
|
@@ -17757,19 +17768,21 @@ var __exports__ = (() => {
|
|
|
17757
17768
|
if (level >= subtreeLevels) {
|
|
17758
17769
|
isChildSubtreeAvailable = getAvailabilityResult(subtree.childSubtreeAvailability, childTileMortonIndex);
|
|
17759
17770
|
}
|
|
17760
|
-
const x = concatBits(globalData.x, childTileX, level
|
|
17761
|
-
const y = concatBits(globalData.y, childTileY, level
|
|
17762
|
-
const z = concatBits(globalData.z, childTileZ, level
|
|
17771
|
+
const x = concatBits(globalData.x, childTileX, level);
|
|
17772
|
+
const y = concatBits(globalData.y, childTileY, level);
|
|
17773
|
+
const z = concatBits(globalData.z, childTileZ, level);
|
|
17763
17774
|
if (isChildSubtreeAvailable) {
|
|
17764
17775
|
const subtreePath = `${basePath}/${subtreesUriTemplate}`;
|
|
17765
17776
|
const childSubtreeUrl = replaceContentUrlTemplate(subtreePath, lev, x, y, z);
|
|
17766
17777
|
const childSubtree = await (0, import_core22.load)(childSubtreeUrl, Tile3DSubtreeLoader, loaderOptions);
|
|
17767
17778
|
subtree = childSubtree;
|
|
17768
|
-
globalData
|
|
17769
|
-
|
|
17770
|
-
|
|
17771
|
-
|
|
17772
|
-
|
|
17779
|
+
globalData = {
|
|
17780
|
+
mortonIndex: childTileMortonIndex,
|
|
17781
|
+
x: childTileX,
|
|
17782
|
+
y: childTileY,
|
|
17783
|
+
z: childTileZ,
|
|
17784
|
+
level
|
|
17785
|
+
};
|
|
17773
17786
|
childTileMortonIndex = 0;
|
|
17774
17787
|
tileAvailabilityIndex = 0;
|
|
17775
17788
|
childTileX = 0;
|
|
@@ -17950,7 +17963,7 @@ var __exports__ = (() => {
|
|
|
17950
17963
|
return refine;
|
|
17951
17964
|
}
|
|
17952
17965
|
}
|
|
17953
|
-
function resolveUri(uri
|
|
17966
|
+
function resolveUri(uri, basePath) {
|
|
17954
17967
|
const urlSchemeRegex = /^[a-z][0-9a-z+.-]*:/i;
|
|
17955
17968
|
if (urlSchemeRegex.test(basePath)) {
|
|
17956
17969
|
const url = new URL(uri, `${basePath}/`);
|
|
@@ -17967,7 +17980,9 @@ var __exports__ = (() => {
|
|
|
17967
17980
|
let tileContentUrl;
|
|
17968
17981
|
if (tile.content) {
|
|
17969
17982
|
const contentUri = tile.content.uri || tile.content?.url;
|
|
17970
|
-
|
|
17983
|
+
if (typeof contentUri !== "undefined") {
|
|
17984
|
+
tileContentUrl = resolveUri(contentUri, basePath);
|
|
17985
|
+
}
|
|
17971
17986
|
}
|
|
17972
17987
|
const tilePostprocessed = {
|
|
17973
17988
|
...tile,
|
|
@@ -18025,7 +18040,8 @@ var __exports__ = (() => {
|
|
|
18025
18040
|
const replacedUrlTemplate = replaceContentUrlTemplate(subtreesUriTemplate, 0, 0, 0, 0);
|
|
18026
18041
|
const subtreeUrl = resolveUri(replacedUrlTemplate, basePath);
|
|
18027
18042
|
const subtree = await (0, import_core23.load)(subtreeUrl, Tile3DSubtreeLoader, options);
|
|
18028
|
-
const
|
|
18043
|
+
const tileContentUri = tile.content?.uri;
|
|
18044
|
+
const contentUrlTemplate = tileContentUri ? resolveUri(tileContentUri, basePath) : "";
|
|
18029
18045
|
const refine = tileset?.root?.refine;
|
|
18030
18046
|
const rootLodMetricValue = tile.geometricError;
|
|
18031
18047
|
const s2VolumeInfo = tile.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];
|
|
@@ -18283,23 +18299,28 @@ var __exports__ = (() => {
|
|
|
18283
18299
|
const zipEoCDOffset = await searchFromTheEnd(file, eoCDSignature);
|
|
18284
18300
|
let cdRecordsNumber = BigInt(await file.getUint16(zipEoCDOffset + CD_RECORDS_NUMBER_OFFSET));
|
|
18285
18301
|
let cdStartOffset = BigInt(await file.getUint32(zipEoCDOffset + CD_START_OFFSET_OFFSET));
|
|
18286
|
-
|
|
18287
|
-
|
|
18288
|
-
|
|
18289
|
-
|
|
18290
|
-
|
|
18291
|
-
}
|
|
18292
|
-
const zip64EoCDOffset = await file.getBigUint64(zip64EoCDLocatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET);
|
|
18302
|
+
let zip64EoCDLocatorOffset = zipEoCDOffset - 20n;
|
|
18303
|
+
let zip64EoCDOffset = 0n;
|
|
18304
|
+
const magicBytes = await file.slice(zip64EoCDLocatorOffset, zip64EoCDLocatorOffset + 4n);
|
|
18305
|
+
if (compareArrayBuffers(magicBytes, zip64EoCDLocatorSignature)) {
|
|
18306
|
+
zip64EoCDOffset = await file.getBigUint64(zip64EoCDLocatorOffset + ZIP64_EOCD_START_OFFSET_OFFSET);
|
|
18293
18307
|
const endOfCDMagicBytes = await file.slice(zip64EoCDOffset, zip64EoCDOffset + 4n);
|
|
18294
18308
|
if (!compareArrayBuffers(endOfCDMagicBytes, zip64EoCDSignature.buffer)) {
|
|
18295
18309
|
throw new Error("zip64 EoCD not found");
|
|
18296
18310
|
}
|
|
18297
18311
|
cdRecordsNumber = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_RECORDS_NUMBER_OFFSET);
|
|
18298
18312
|
cdStartOffset = await file.getBigUint64(zip64EoCDOffset + ZIP64_CD_START_OFFSET_OFFSET);
|
|
18313
|
+
} else {
|
|
18314
|
+
zip64EoCDLocatorOffset = 0n;
|
|
18299
18315
|
}
|
|
18300
18316
|
return {
|
|
18301
18317
|
cdRecordsNumber,
|
|
18302
|
-
cdStartOffset
|
|
18318
|
+
cdStartOffset,
|
|
18319
|
+
offsets: {
|
|
18320
|
+
zip64EoCDOffset,
|
|
18321
|
+
zip64EoCDLocatorOffset,
|
|
18322
|
+
zipEoCDOffset
|
|
18323
|
+
}
|
|
18303
18324
|
};
|
|
18304
18325
|
};
|
|
18305
18326
|
|
|
@@ -18400,6 +18421,76 @@ var __exports__ = (() => {
|
|
|
18400
18421
|
}
|
|
18401
18422
|
return zip64dataList;
|
|
18402
18423
|
};
|
|
18424
|
+
var ZIP_HEADER_FIELDS = [{
|
|
18425
|
+
offset: 0,
|
|
18426
|
+
size: 4,
|
|
18427
|
+
default: new DataView(signature.buffer).getUint32(0, true)
|
|
18428
|
+
}, {
|
|
18429
|
+
offset: 4,
|
|
18430
|
+
size: 2,
|
|
18431
|
+
default: 45
|
|
18432
|
+
}, {
|
|
18433
|
+
offset: 6,
|
|
18434
|
+
size: 2,
|
|
18435
|
+
default: 45
|
|
18436
|
+
}, {
|
|
18437
|
+
offset: 8,
|
|
18438
|
+
size: 2,
|
|
18439
|
+
default: 0
|
|
18440
|
+
}, {
|
|
18441
|
+
offset: 10,
|
|
18442
|
+
size: 2,
|
|
18443
|
+
default: 0
|
|
18444
|
+
}, {
|
|
18445
|
+
offset: 12,
|
|
18446
|
+
size: 2,
|
|
18447
|
+
default: 0
|
|
18448
|
+
}, {
|
|
18449
|
+
offset: 14,
|
|
18450
|
+
size: 2,
|
|
18451
|
+
default: 0
|
|
18452
|
+
}, {
|
|
18453
|
+
offset: 16,
|
|
18454
|
+
size: 4,
|
|
18455
|
+
name: "crc32"
|
|
18456
|
+
}, {
|
|
18457
|
+
offset: 20,
|
|
18458
|
+
size: 4,
|
|
18459
|
+
name: "length"
|
|
18460
|
+
}, {
|
|
18461
|
+
offset: 24,
|
|
18462
|
+
size: 4,
|
|
18463
|
+
name: "length"
|
|
18464
|
+
}, {
|
|
18465
|
+
offset: 28,
|
|
18466
|
+
size: 2,
|
|
18467
|
+
name: "fnlength"
|
|
18468
|
+
}, {
|
|
18469
|
+
offset: 30,
|
|
18470
|
+
size: 2,
|
|
18471
|
+
default: 0,
|
|
18472
|
+
name: "extraLength"
|
|
18473
|
+
}, {
|
|
18474
|
+
offset: 32,
|
|
18475
|
+
size: 2,
|
|
18476
|
+
default: 0
|
|
18477
|
+
}, {
|
|
18478
|
+
offset: 34,
|
|
18479
|
+
size: 2,
|
|
18480
|
+
default: 0
|
|
18481
|
+
}, {
|
|
18482
|
+
offset: 36,
|
|
18483
|
+
size: 2,
|
|
18484
|
+
default: 0
|
|
18485
|
+
}, {
|
|
18486
|
+
offset: 38,
|
|
18487
|
+
size: 4,
|
|
18488
|
+
default: 0
|
|
18489
|
+
}, {
|
|
18490
|
+
offset: 42,
|
|
18491
|
+
size: 4,
|
|
18492
|
+
name: "offset"
|
|
18493
|
+
}];
|
|
18403
18494
|
|
|
18404
18495
|
// ../zip/src/parse-zip/local-file-header.ts
|
|
18405
18496
|
var COMPRESSION_METHOD_OFFSET = 8n;
|
|
@@ -18443,6 +18534,52 @@ var __exports__ = (() => {
|
|
|
18443
18534
|
compressionMethod
|
|
18444
18535
|
};
|
|
18445
18536
|
};
|
|
18537
|
+
var ZIP_HEADER_FIELDS2 = [{
|
|
18538
|
+
offset: 0,
|
|
18539
|
+
size: 4,
|
|
18540
|
+
default: new DataView(signature2.buffer).getUint32(0, true)
|
|
18541
|
+
}, {
|
|
18542
|
+
offset: 4,
|
|
18543
|
+
size: 2,
|
|
18544
|
+
default: 45
|
|
18545
|
+
}, {
|
|
18546
|
+
offset: 6,
|
|
18547
|
+
size: 2,
|
|
18548
|
+
default: 0
|
|
18549
|
+
}, {
|
|
18550
|
+
offset: 8,
|
|
18551
|
+
size: 2,
|
|
18552
|
+
default: 0
|
|
18553
|
+
}, {
|
|
18554
|
+
offset: 10,
|
|
18555
|
+
size: 2,
|
|
18556
|
+
default: 0
|
|
18557
|
+
}, {
|
|
18558
|
+
offset: 12,
|
|
18559
|
+
size: 2,
|
|
18560
|
+
default: 0
|
|
18561
|
+
}, {
|
|
18562
|
+
offset: 14,
|
|
18563
|
+
size: 4,
|
|
18564
|
+
name: "crc32"
|
|
18565
|
+
}, {
|
|
18566
|
+
offset: 18,
|
|
18567
|
+
size: 4,
|
|
18568
|
+
name: "length"
|
|
18569
|
+
}, {
|
|
18570
|
+
offset: 22,
|
|
18571
|
+
size: 4,
|
|
18572
|
+
name: "length"
|
|
18573
|
+
}, {
|
|
18574
|
+
offset: 26,
|
|
18575
|
+
size: 2,
|
|
18576
|
+
name: "fnlength"
|
|
18577
|
+
}, {
|
|
18578
|
+
offset: 28,
|
|
18579
|
+
size: 2,
|
|
18580
|
+
default: 0,
|
|
18581
|
+
name: "extraLength"
|
|
18582
|
+
}];
|
|
18446
18583
|
|
|
18447
18584
|
// ../crypto/src/lib/hash.ts
|
|
18448
18585
|
var Hash = class {
|
|
@@ -19312,7 +19449,7 @@ var __exports__ = (() => {
|
|
|
19312
19449
|
};
|
|
19313
19450
|
|
|
19314
19451
|
// src/3d-tiles-archive-loader.ts
|
|
19315
|
-
var VERSION8 =
|
|
19452
|
+
var VERSION8 = true ? "4.1.0-alpha.10" : "latest";
|
|
19316
19453
|
var Tiles3DArchiveFileLoader = {
|
|
19317
19454
|
name: "3tz",
|
|
19318
19455
|
id: "3tz",
|