@loaders.gl/tile-converter 4.0.0-alpha.18 → 4.0.0-alpha.19
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/bin/converter.js +1 -1
- package/dist/converter.min.js +73 -73
- package/dist/deps-installer/deps-installer.d.ts +3 -2
- package/dist/deps-installer/deps-installer.d.ts.map +1 -1
- package/dist/deps-installer/deps-installer.js +36 -10
- package/dist/dist.min.js +77 -67
- package/dist/es5/deps-installer/deps-installer.js +112 -38
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +12 -9
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +32 -87
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/esm/deps-installer/deps-installer.js +37 -11
- package/dist/esm/deps-installer/deps-installer.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +10 -6
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +11 -28
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +2 -4
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +18 -13
- package/dist/i3s-converter/i3s-converter.d.ts +0 -1
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +10 -22
- package/package.json +14 -14
- package/src/deps-installer/deps-installer.ts +55 -10
- package/src/i3s-converter/helpers/geometry-converter.ts +19 -14
- package/src/i3s-converter/i3s-converter.ts +12 -28
|
@@ -12,7 +12,8 @@ export declare class DepsInstaller {
|
|
|
12
12
|
* This path is '' by default and is not used by tile-converter.
|
|
13
13
|
* It is used in tests to prevent rewriting actual workers during tests running
|
|
14
14
|
*/
|
|
15
|
-
install(path?: string
|
|
16
|
-
private
|
|
15
|
+
install(path?: string): Promise<void>;
|
|
16
|
+
private installFromNpm;
|
|
17
|
+
private installFromUrl;
|
|
17
18
|
}
|
|
18
19
|
//# sourceMappingURL=deps-installer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deps-installer.d.ts","sourceRoot":"","sources":["../../src/deps-installer/deps-installer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deps-installer.d.ts","sourceRoot":"","sources":["../../src/deps-installer/deps-installer.ts"],"names":[],"mappings":"AAaA;;;;;GAKG;AACH,qBAAa,aAAa;IACxB;;;;;;OAMG;IACG,OAAO,CAAC,IAAI,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC;YAoEjC,cAAc;YAYd,cAAc;CAS7B"}
|
|
@@ -6,6 +6,8 @@ const zip_1 = require("@loaders.gl/zip");
|
|
|
6
6
|
const file_utils_1 = require("../lib/utils/file-utils");
|
|
7
7
|
const path_1 = require("path");
|
|
8
8
|
const worker_utils_1 = require("@loaders.gl/worker-utils");
|
|
9
|
+
const draco_1 = require("@loaders.gl/draco");
|
|
10
|
+
const textures_1 = require("@loaders.gl/textures");
|
|
9
11
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
10
12
|
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'beta';
|
|
11
13
|
const PGM_LINK = 'https://raw.githubusercontent.com/visgl/deck.gl-data/master/egm/egm2008-5.zip';
|
|
@@ -23,7 +25,7 @@ class DepsInstaller {
|
|
|
23
25
|
* This path is '' by default and is not used by tile-converter.
|
|
24
26
|
* It is used in tests to prevent rewriting actual workers during tests running
|
|
25
27
|
*/
|
|
26
|
-
async install(path = ''
|
|
28
|
+
async install(path = '') {
|
|
27
29
|
console.log('Installing "EGM2008-5" model...'); // eslint-disable-line no-console
|
|
28
30
|
const fileMap = await (0, core_1.load)(PGM_LINK, zip_1.ZipLoader, {});
|
|
29
31
|
let depsPath = process.cwd();
|
|
@@ -31,12 +33,27 @@ class DepsInstaller {
|
|
|
31
33
|
depsPath = (0, path_1.join)(depsPath, path);
|
|
32
34
|
}
|
|
33
35
|
await (0, file_utils_1.writeFile)(depsPath, new Uint8Array(fileMap['geoids/egm2008-5.pgm']), 'egm2008-5.pgm');
|
|
34
|
-
console.log('Installing "I3S Content Loader worker
|
|
35
|
-
await this.
|
|
36
|
-
console.log('Installing "Draco Loader worker
|
|
37
|
-
await this.
|
|
38
|
-
console.log('Installing "
|
|
39
|
-
await this.
|
|
36
|
+
console.log('Installing "I3S Content Loader" worker'); // eslint-disable-line no-console
|
|
37
|
+
await this.installFromNpm('i3s', 'i3s-content-worker-node.js');
|
|
38
|
+
console.log('Installing "Draco Loader" worker'); // eslint-disable-line no-console
|
|
39
|
+
await this.installFromNpm('draco', 'draco-worker-node.js');
|
|
40
|
+
console.log('Installing "Draco Writer" worker'); // eslint-disable-line no-console
|
|
41
|
+
await this.installFromNpm('draco', 'draco-writer-worker-node.js');
|
|
42
|
+
console.log('Installing "Basis Loader" worker'); // eslint-disable-line no-console
|
|
43
|
+
await this.installFromNpm('textures', 'basis-worker-node.js');
|
|
44
|
+
console.log('Installing "KTX2 Basis Writer" worker'); // eslint-disable-line no-console
|
|
45
|
+
await this.installFromNpm('textures', 'ktx2-basis-writer-worker-node.js');
|
|
46
|
+
console.log('Installing "Draco decoder" library'); // eslint-disable-line no-console
|
|
47
|
+
await this.installFromUrl(draco_1.DRACO_EXTERNAL_LIBRARY_URLS[draco_1.DRACO_EXTERNAL_LIBRARIES.DECODER], 'draco', draco_1.DRACO_EXTERNAL_LIBRARIES.DECODER);
|
|
48
|
+
await this.installFromUrl(draco_1.DRACO_EXTERNAL_LIBRARY_URLS[draco_1.DRACO_EXTERNAL_LIBRARIES.DECODER_WASM], 'draco', draco_1.DRACO_EXTERNAL_LIBRARIES.DECODER_WASM);
|
|
49
|
+
console.log('Installing "Draco encoder" library'); // eslint-disable-line no-console
|
|
50
|
+
await this.installFromUrl(draco_1.DRACO_EXTERNAL_LIBRARY_URLS[draco_1.DRACO_EXTERNAL_LIBRARIES.ENCODER], 'draco', draco_1.DRACO_EXTERNAL_LIBRARIES.ENCODER);
|
|
51
|
+
console.log('Installing "Basis transcoder" library'); // eslint-disable-line no-console
|
|
52
|
+
await this.installFromNpm('textures', textures_1.BASIS_EXTERNAL_LIBRARIES.TRANSCODER, 'libs');
|
|
53
|
+
await this.installFromNpm('textures', textures_1.BASIS_EXTERNAL_LIBRARIES.TRANSCODER_WASM, 'libs');
|
|
54
|
+
console.log('Installing "Basis encoder" library'); // eslint-disable-line no-console
|
|
55
|
+
await this.installFromNpm('textures', textures_1.BASIS_EXTERNAL_LIBRARIES.ENCODER, 'libs');
|
|
56
|
+
await this.installFromNpm('textures', textures_1.BASIS_EXTERNAL_LIBRARIES.ENCODER_WASM, 'libs');
|
|
40
57
|
console.log('Installing "join-images" npm package');
|
|
41
58
|
const childProcess = new worker_utils_1.ChildProcessProxy();
|
|
42
59
|
await childProcess.start({
|
|
@@ -50,13 +67,22 @@ class DepsInstaller {
|
|
|
50
67
|
});
|
|
51
68
|
console.log('All dependencies were installed succesfully.'); // eslint-disable-line no-console
|
|
52
69
|
}
|
|
53
|
-
async
|
|
54
|
-
const fileResponse = await (0, core_1.fetchFile)(`https://unpkg.com/@loaders.gl/${module}@${VERSION}/dist/${name}`);
|
|
70
|
+
async installFromNpm(module, name, extraPath = '') {
|
|
71
|
+
const fileResponse = await (0, core_1.fetchFile)(`https://unpkg.com/@loaders.gl/${module}@${VERSION}/dist/${extraPath}/${name}`);
|
|
55
72
|
const fileData = await fileResponse.arrayBuffer();
|
|
56
73
|
if (!fileData) {
|
|
57
74
|
return;
|
|
58
75
|
}
|
|
59
|
-
const path = (0, path_1.join)(process.cwd(),
|
|
76
|
+
const path = (0, path_1.join)(process.cwd(), 'modules', module, 'dist', extraPath);
|
|
77
|
+
await (0, file_utils_1.writeFile)(path, fileData, name);
|
|
78
|
+
}
|
|
79
|
+
async installFromUrl(url, module, name) {
|
|
80
|
+
const fileResponse = await (0, core_1.fetchFile)(url);
|
|
81
|
+
const fileData = await fileResponse.arrayBuffer();
|
|
82
|
+
if (!fileData) {
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const path = (0, path_1.join)(process.cwd(), 'modules', module, 'dist', 'libs');
|
|
60
86
|
await (0, file_utils_1.writeFile)(path, fileData, name);
|
|
61
87
|
}
|
|
62
88
|
}
|
package/dist/dist.min.js
CHANGED
|
@@ -47134,32 +47134,33 @@ function requireFromString(code, filename2 = "", options) {
|
|
|
47134
47134
|
var LATEST = "beta";
|
|
47135
47135
|
var VERSION3 = typeof VERSION !== "undefined" ? VERSION : LATEST;
|
|
47136
47136
|
var loadLibraryPromises = {};
|
|
47137
|
-
async function loadLibrary(libraryUrl, moduleName = null, options = {}) {
|
|
47137
|
+
async function loadLibrary(libraryUrl, moduleName = null, options = {}, libraryName = null) {
|
|
47138
47138
|
if (moduleName) {
|
|
47139
|
-
libraryUrl = getLibraryUrl(libraryUrl, moduleName, options);
|
|
47139
|
+
libraryUrl = getLibraryUrl(libraryUrl, moduleName, options, libraryName);
|
|
47140
47140
|
}
|
|
47141
47141
|
loadLibraryPromises[libraryUrl] = loadLibraryPromises[libraryUrl] || loadLibraryFromFile(libraryUrl);
|
|
47142
47142
|
return await loadLibraryPromises[libraryUrl];
|
|
47143
47143
|
}
|
|
47144
|
-
function getLibraryUrl(library, moduleName, options) {
|
|
47145
|
-
if (library.startsWith("http")) {
|
|
47144
|
+
function getLibraryUrl(library, moduleName, options = {}, libraryName = null) {
|
|
47145
|
+
if (!options.useLocalLibraries && library.startsWith("http")) {
|
|
47146
47146
|
return library;
|
|
47147
47147
|
}
|
|
47148
|
+
libraryName = libraryName || library;
|
|
47148
47149
|
const modules = options.modules || {};
|
|
47149
|
-
if (modules[
|
|
47150
|
-
return modules[
|
|
47150
|
+
if (modules[libraryName]) {
|
|
47151
|
+
return modules[libraryName];
|
|
47151
47152
|
}
|
|
47152
47153
|
if (!isBrowser2) {
|
|
47153
|
-
return `modules/${moduleName}/dist/libs/${
|
|
47154
|
+
return `modules/${moduleName}/dist/libs/${libraryName}`;
|
|
47154
47155
|
}
|
|
47155
47156
|
if (options.CDN) {
|
|
47156
47157
|
assert3(options.CDN.startsWith("http"));
|
|
47157
|
-
return `${options.CDN}/${moduleName}@${VERSION3}/dist/libs/${
|
|
47158
|
+
return `${options.CDN}/${moduleName}@${VERSION3}/dist/libs/${libraryName}`;
|
|
47158
47159
|
}
|
|
47159
47160
|
if (isWorker) {
|
|
47160
|
-
return `../src/libs/${
|
|
47161
|
+
return `../src/libs/${libraryName}`;
|
|
47161
47162
|
}
|
|
47162
|
-
return `modules/${moduleName}/src/libs/${
|
|
47163
|
+
return `modules/${moduleName}/src/libs/${libraryName}`;
|
|
47163
47164
|
}
|
|
47164
47165
|
async function loadLibraryFromFile(libraryUrl) {
|
|
47165
47166
|
if (libraryUrl.endsWith("wasm")) {
|
|
@@ -48708,6 +48709,7 @@ var DEFAULT_LOADER_OPTIONS = {
|
|
|
48708
48709
|
mimeType: void 0,
|
|
48709
48710
|
nothrow: false,
|
|
48710
48711
|
log: new ConsoleLog(),
|
|
48712
|
+
useLocalLibraries: false,
|
|
48711
48713
|
CDN: "https://unpkg.com/@loaders.gl",
|
|
48712
48714
|
worker: true,
|
|
48713
48715
|
maxConcurrency: 3,
|
|
@@ -50021,10 +50023,18 @@ function getUint32Array(dracoArray) {
|
|
|
50021
50023
|
var DRACO_DECODER_VERSION = "1.5.5";
|
|
50022
50024
|
var DRACO_ENCODER_VERSION = "1.4.1";
|
|
50023
50025
|
var STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
50024
|
-
var
|
|
50025
|
-
|
|
50026
|
-
|
|
50027
|
-
|
|
50026
|
+
var DRACO_EXTERNAL_LIBRARIES = {
|
|
50027
|
+
DECODER: "draco_wasm_wrapper.js",
|
|
50028
|
+
DECODER_WASM: "draco_decoder.wasm",
|
|
50029
|
+
FALLBACK_DECODER: "draco_decoder.js",
|
|
50030
|
+
ENCODER: "draco_encoder.js"
|
|
50031
|
+
};
|
|
50032
|
+
var DRACO_EXTERNAL_LIBRARY_URLS = {
|
|
50033
|
+
[DRACO_EXTERNAL_LIBRARIES.DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER}`,
|
|
50034
|
+
[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER_WASM}`,
|
|
50035
|
+
[DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER}`,
|
|
50036
|
+
[DRACO_EXTERNAL_LIBRARIES.ENCODER]: `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/${DRACO_EXTERNAL_LIBRARIES.ENCODER}`
|
|
50037
|
+
};
|
|
50028
50038
|
var loadDecoderPromise;
|
|
50029
50039
|
async function loadDracoDecoderModule(options) {
|
|
50030
50040
|
const modules = options.modules || {};
|
|
@@ -50042,13 +50052,13 @@ async function loadDracoDecoder(options) {
|
|
|
50042
50052
|
let wasmBinary;
|
|
50043
50053
|
switch (options.draco && options.draco.decoderType) {
|
|
50044
50054
|
case "js":
|
|
50045
|
-
DracoDecoderModule = await loadLibrary(
|
|
50055
|
+
DracoDecoderModule = await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER], "draco", options, DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER);
|
|
50046
50056
|
break;
|
|
50047
50057
|
case "wasm":
|
|
50048
50058
|
default:
|
|
50049
50059
|
[DracoDecoderModule, wasmBinary] = await Promise.all([
|
|
50050
|
-
await loadLibrary(
|
|
50051
|
-
await loadLibrary(
|
|
50060
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER], "draco", options, DRACO_EXTERNAL_LIBRARIES.DECODER),
|
|
50061
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM], "draco", options, DRACO_EXTERNAL_LIBRARIES.DECODER_WASM)
|
|
50052
50062
|
]);
|
|
50053
50063
|
}
|
|
50054
50064
|
DracoDecoderModule = DracoDecoderModule || globalThis.DracoDecoderModule;
|
|
@@ -51733,9 +51743,12 @@ function testBrowserImageFormatSupport(mimeType) {
|
|
|
51733
51743
|
var VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
51734
51744
|
|
|
51735
51745
|
// ../textures/src/lib/parsers/basis-module-loader.ts
|
|
51736
|
-
var
|
|
51737
|
-
|
|
51738
|
-
|
|
51746
|
+
var BASIS_EXTERNAL_LIBRARIES = {
|
|
51747
|
+
TRANSCODER: "basis_transcoder.js",
|
|
51748
|
+
TRANSCODER_WASM: "basis_transcoder.wasm",
|
|
51749
|
+
ENCODER: "basis_encoder.js",
|
|
51750
|
+
ENCODER_WASM: "basis_encoder.wasm"
|
|
51751
|
+
};
|
|
51739
51752
|
var loadBasisTranscoderPromise;
|
|
51740
51753
|
async function loadBasisTranscoderModule(options) {
|
|
51741
51754
|
const modules = options.modules || {};
|
|
@@ -51749,8 +51762,8 @@ async function loadBasisTranscoder(options) {
|
|
|
51749
51762
|
let BASIS = null;
|
|
51750
51763
|
let wasmBinary = null;
|
|
51751
51764
|
[BASIS, wasmBinary] = await Promise.all([
|
|
51752
|
-
await loadLibrary(
|
|
51753
|
-
await loadLibrary(
|
|
51765
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.TRANSCODER, "textures", options),
|
|
51766
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.TRANSCODER_WASM, "textures", options)
|
|
51754
51767
|
]);
|
|
51755
51768
|
BASIS = BASIS || globalThis.BASIS;
|
|
51756
51769
|
return await initializeBasisTranscoderModule(BASIS, wasmBinary);
|
|
@@ -51781,8 +51794,8 @@ async function loadBasisEncoder(options) {
|
|
|
51781
51794
|
let BASIS_ENCODER = null;
|
|
51782
51795
|
let wasmBinary = null;
|
|
51783
51796
|
[BASIS_ENCODER, wasmBinary] = await Promise.all([
|
|
51784
|
-
await loadLibrary(
|
|
51785
|
-
await loadLibrary(
|
|
51797
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.ENCODER, "textures", options),
|
|
51798
|
+
await loadLibrary(BASIS_EXTERNAL_LIBRARIES.ENCODER_WASM, "textures", options)
|
|
51786
51799
|
]);
|
|
51787
51800
|
BASIS_ENCODER = BASIS_ENCODER || globalThis.BASIS;
|
|
51788
51801
|
return await initializeBasisEncoderModule(BASIS_ENCODER, wasmBinary);
|
|
@@ -53420,7 +53433,7 @@ var EXT_MESHOPT_COMPRESSION = "EXT_meshopt_compression";
|
|
|
53420
53433
|
var name = EXT_MESHOPT_COMPRESSION;
|
|
53421
53434
|
async function decode2(gltfData, options) {
|
|
53422
53435
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
53423
|
-
if (!options?.gltf?.decompressMeshes) {
|
|
53436
|
+
if (!options?.gltf?.decompressMeshes || !options.gltf?.loadBuffers) {
|
|
53424
53437
|
return;
|
|
53425
53438
|
}
|
|
53426
53439
|
const promises = [];
|
|
@@ -53693,7 +53706,7 @@ var scratchScaleMatrix = new import_core6.Matrix3();
|
|
|
53693
53706
|
async function decode4(gltfData, options) {
|
|
53694
53707
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
53695
53708
|
const hasExtension = gltfScenegraph.hasExtension(EXT_MESHOPT_TRANSFORM);
|
|
53696
|
-
if (!hasExtension) {
|
|
53709
|
+
if (!hasExtension || !options.gltf?.loadBuffers) {
|
|
53697
53710
|
return;
|
|
53698
53711
|
}
|
|
53699
53712
|
const materials = gltfData.json.materials || [];
|
|
@@ -54526,7 +54539,11 @@ async function loadImage(gltf, image, index, options, context) {
|
|
|
54526
54539
|
arrayBuffer = sliceArrayBuffer(array.buffer, array.byteOffset, array.byteLength);
|
|
54527
54540
|
}
|
|
54528
54541
|
assert6(arrayBuffer, "glTF image has no data");
|
|
54529
|
-
let parsedImage = await parse7(arrayBuffer, [ImageLoader, BasisLoader], {
|
|
54542
|
+
let parsedImage = await parse7(arrayBuffer, [ImageLoader, BasisLoader], {
|
|
54543
|
+
...options,
|
|
54544
|
+
mimeType: image.mimeType,
|
|
54545
|
+
basis: options.basis || { format: selectSupportedBasisFormat() }
|
|
54546
|
+
}, context);
|
|
54530
54547
|
if (parsedImage && parsedImage[0]) {
|
|
54531
54548
|
parsedImage = {
|
|
54532
54549
|
compressed: true,
|
|
@@ -55402,7 +55419,7 @@ var console_2 = globalThis.console;
|
|
|
55402
55419
|
var navigator_2 = globalThis.navigator || {};
|
|
55403
55420
|
|
|
55404
55421
|
// ../3d-tiles/node_modules/@probe.gl/env/dist/utils/globals.js
|
|
55405
|
-
var
|
|
55422
|
+
var VERSION11 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
|
|
55406
55423
|
var isBrowser6 = isBrowser5();
|
|
55407
55424
|
|
|
55408
55425
|
// ../3d-tiles/node_modules/@probe.gl/log/dist/utils/local-storage.js
|
|
@@ -55587,7 +55604,7 @@ var Log2 = class {
|
|
|
55587
55604
|
id: ""
|
|
55588
55605
|
};
|
|
55589
55606
|
this.id = void 0;
|
|
55590
|
-
this.VERSION =
|
|
55607
|
+
this.VERSION = VERSION11;
|
|
55591
55608
|
this._startTs = getHiResTimestamp2();
|
|
55592
55609
|
this._deltaTs = getHiResTimestamp2();
|
|
55593
55610
|
this._storage = void 0;
|
|
@@ -55790,7 +55807,7 @@ var Log2 = class {
|
|
|
55790
55807
|
return noop2;
|
|
55791
55808
|
}
|
|
55792
55809
|
};
|
|
55793
|
-
Log2.VERSION =
|
|
55810
|
+
Log2.VERSION = VERSION11;
|
|
55794
55811
|
function normalizeLogLevel2(logLevel) {
|
|
55795
55812
|
if (!logLevel) {
|
|
55796
55813
|
return 0;
|
|
@@ -58795,7 +58812,7 @@ var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BA
|
|
|
58795
58812
|
var EXT_FEATURE_METADATA3 = "EXT_feature_metadata";
|
|
58796
58813
|
var EXT_MESH_FEATURES2 = "EXT_mesh_features";
|
|
58797
58814
|
var scratchVector4 = new import_core16.Vector3();
|
|
58798
|
-
async function convertB3dmToI3sGeometry(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel,
|
|
58815
|
+
async function convertB3dmToI3sGeometry(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel, libraries) {
|
|
58799
58816
|
const useCartesianPositions = generateBoundingVolumes;
|
|
58800
58817
|
const materialAndTextureList = await convertMaterials(tileContent.gltf?.materials, shouldMergeMaterials);
|
|
58801
58818
|
const dataForAttributesConversion = prepareDataForAttributesConversion(tileContent, tileTransform, tileBoundingVolume);
|
|
@@ -58825,7 +58842,7 @@ async function convertB3dmToI3sGeometry(tileContent, tileTransform, tileBounding
|
|
|
58825
58842
|
propertyTable,
|
|
58826
58843
|
attributeStorageInfo,
|
|
58827
58844
|
draco,
|
|
58828
|
-
|
|
58845
|
+
libraries
|
|
58829
58846
|
}));
|
|
58830
58847
|
}
|
|
58831
58848
|
if (!result.length) {
|
|
@@ -58857,7 +58874,7 @@ async function _makeNodeResources({
|
|
|
58857
58874
|
propertyTable,
|
|
58858
58875
|
attributeStorageInfo,
|
|
58859
58876
|
draco,
|
|
58860
|
-
|
|
58877
|
+
libraries
|
|
58861
58878
|
}) {
|
|
58862
58879
|
const boundingVolumes = convertedAttributes.boundingVolumes;
|
|
58863
58880
|
const vertexCount = convertedAttributes.positions.length / VALUES_PER_VERTEX2;
|
|
@@ -58877,7 +58894,7 @@ async function _makeNodeResources({
|
|
|
58877
58894
|
uvRegions,
|
|
58878
58895
|
featureIds,
|
|
58879
58896
|
faceRange
|
|
58880
|
-
},
|
|
58897
|
+
}, libraries) : null;
|
|
58881
58898
|
let attributes = [];
|
|
58882
58899
|
if (attributeStorageInfo && propertyTable) {
|
|
58883
58900
|
attributes = convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo);
|
|
@@ -59446,7 +59463,7 @@ function generateBigUint64Array(featureIds) {
|
|
|
59446
59463
|
}
|
|
59447
59464
|
return typedFeatureIds;
|
|
59448
59465
|
}
|
|
59449
|
-
async function generateCompressedGeometry(vertexCount, convertedAttributes, attributes,
|
|
59466
|
+
async function generateCompressedGeometry(vertexCount, convertedAttributes, attributes, libraries) {
|
|
59450
59467
|
const { positions, normals, texCoords, colors, uvRegions, featureIds, faceRange } = attributes;
|
|
59451
59468
|
const indices = new Uint32Array(vertexCount);
|
|
59452
59469
|
for (let index = 0; index < indices.length; index++) {
|
|
@@ -59477,12 +59494,16 @@ async function generateCompressedGeometry(vertexCount, convertedAttributes, attr
|
|
|
59477
59494
|
}
|
|
59478
59495
|
return encode({ attributes: compressedAttributes, indices }, DracoWriterWorker, {
|
|
59479
59496
|
...DracoWriterWorker.options,
|
|
59480
|
-
source: dracoWorkerSoure,
|
|
59481
59497
|
reuseWorkers: true,
|
|
59482
59498
|
_nodeWorkers: true,
|
|
59499
|
+
modules: libraries,
|
|
59500
|
+
useLocalLibraries: true,
|
|
59483
59501
|
draco: {
|
|
59484
59502
|
method: "MESH_SEQUENTIAL_ENCODING",
|
|
59485
59503
|
attributesMetadata
|
|
59504
|
+
},
|
|
59505
|
+
["draco-writer"]: {
|
|
59506
|
+
workerUrl: "./modules/draco/dist/draco-writer-worker-node.js"
|
|
59486
59507
|
}
|
|
59487
59508
|
});
|
|
59488
59509
|
}
|
|
@@ -59650,12 +59671,12 @@ function convertScreenThresholdToGeometricError(node2) {
|
|
|
59650
59671
|
|
|
59651
59672
|
// src/pgm-loader.ts
|
|
59652
59673
|
var import_geoid = __toModule(require_es54());
|
|
59653
|
-
var
|
|
59674
|
+
var VERSION12 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
59654
59675
|
var PGMLoader = {
|
|
59655
59676
|
name: "PGM - Netpbm grayscale image format",
|
|
59656
59677
|
id: "pgm",
|
|
59657
59678
|
module: "tile-converter",
|
|
59658
|
-
version:
|
|
59679
|
+
version: VERSION12,
|
|
59659
59680
|
mimeTypes: ["image/x-portable-graymap"],
|
|
59660
59681
|
parse: async (arrayBuffer, options) => (0, import_geoid.parsePGM)(new Uint8Array(arrayBuffer), options),
|
|
59661
59682
|
extensions: ["pgm"],
|
|
@@ -60728,12 +60749,14 @@ var I3SConverter = class {
|
|
|
60728
60749
|
this.loadOptions = {
|
|
60729
60750
|
_nodeWorkers: true,
|
|
60730
60751
|
reuseWorkers: true,
|
|
60752
|
+
useLocalLibraries: true,
|
|
60731
60753
|
basis: {
|
|
60732
60754
|
format: "rgba32",
|
|
60733
60755
|
workerUrl: "./modules/textures/dist/basis-worker-node.js"
|
|
60734
60756
|
},
|
|
60735
60757
|
draco: { workerUrl: "./modules/draco/dist/draco-worker-node.js" },
|
|
60736
|
-
fetch: {}
|
|
60758
|
+
fetch: {},
|
|
60759
|
+
modules: {}
|
|
60737
60760
|
};
|
|
60738
60761
|
this.geoidHeightModel = null;
|
|
60739
60762
|
this.Loader = Tiles3DLoader;
|
|
@@ -60809,7 +60832,6 @@ var I3SConverter = class {
|
|
|
60809
60832
|
if (slpk) {
|
|
60810
60833
|
this.nodePages.useWriteFunction(writeFileForSlpk);
|
|
60811
60834
|
}
|
|
60812
|
-
await this.loadWorkers();
|
|
60813
60835
|
try {
|
|
60814
60836
|
const preloadOptions = await this._fetchPreloadOptions();
|
|
60815
60837
|
let tilesetUrl = inputUrl;
|
|
@@ -61064,7 +61086,7 @@ var I3SConverter = class {
|
|
|
61064
61086
|
halfSize: [],
|
|
61065
61087
|
quaternion: []
|
|
61066
61088
|
};
|
|
61067
|
-
const resourcesData = await convertB3dmToI3sGeometry(tileContent, transformationMatrix, boundingVolume, async () => (await this.nodePages.push({ index: 0, obb: draftObb }, parentId)).index, propertyTable, this.featuresHashArray, this.layers0?.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.options.mergeMaterials, this.geoidHeightModel, this.
|
|
61089
|
+
const resourcesData = await convertB3dmToI3sGeometry(tileContent, transformationMatrix, boundingVolume, async () => (await this.nodePages.push({ index: 0, obb: draftObb }, parentId)).index, propertyTable, this.featuresHashArray, this.layers0?.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.options.mergeMaterials, this.geoidHeightModel, this.loadOptions.modules);
|
|
61068
61090
|
return resourcesData;
|
|
61069
61091
|
}
|
|
61070
61092
|
async _updateNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources) {
|
|
@@ -61195,9 +61217,12 @@ var I3SConverter = class {
|
|
|
61195
61217
|
const arrayToEncode = new Uint8Array(copyArrayBuffer2);
|
|
61196
61218
|
const ktx2TextureData = encode({ ...texture.image, data: arrayToEncode }, KTX2BasisWriterWorker, {
|
|
61197
61219
|
...KTX2BasisWriterWorker.options,
|
|
61198
|
-
|
|
61220
|
+
["ktx2-basis-writer"]: {
|
|
61221
|
+
workerUrl: "./modules/textures/dist/ktx2-basis-writer-worker-node.js"
|
|
61222
|
+
},
|
|
61199
61223
|
reuseWorkers: true,
|
|
61200
|
-
_nodeWorkers: true
|
|
61224
|
+
_nodeWorkers: true,
|
|
61225
|
+
useLocalLibraries: true
|
|
61201
61226
|
});
|
|
61202
61227
|
await this.writeTextureFile(ktx2TextureData, "1", "ktx2", childPath, slpkChildPath);
|
|
61203
61228
|
}
|
|
@@ -61356,22 +61381,6 @@ var I3SConverter = class {
|
|
|
61356
61381
|
isContentSupported(sourceTile) {
|
|
61357
61382
|
return ["b3dm", "glTF", "scenegraph"].includes(sourceTile.type || "");
|
|
61358
61383
|
}
|
|
61359
|
-
async loadWorkers() {
|
|
61360
|
-
console.log(`Loading workers source...`);
|
|
61361
|
-
if (this.options.draco) {
|
|
61362
|
-
const url = getWorkerURL(DracoWriterWorker, { ...getGlobalLoaderOptions() });
|
|
61363
|
-
const sourceResponse = await fetchFile(url);
|
|
61364
|
-
const source = await sourceResponse.text();
|
|
61365
|
-
this.workerSource.draco = source;
|
|
61366
|
-
}
|
|
61367
|
-
if (this.generateTextures) {
|
|
61368
|
-
const url = getWorkerURL(KTX2BasisWriterWorker, { ...getGlobalLoaderOptions() });
|
|
61369
|
-
const sourceResponse = await fetchFile(url);
|
|
61370
|
-
const source = await sourceResponse.text();
|
|
61371
|
-
this.workerSource.ktx2 = source;
|
|
61372
|
-
}
|
|
61373
|
-
console.log(`Loading workers source completed!`);
|
|
61374
|
-
}
|
|
61375
61384
|
};
|
|
61376
61385
|
|
|
61377
61386
|
// src/3d-tiles-converter/3d-tiles-converter.ts
|
|
@@ -61528,12 +61537,12 @@ function parseStringsAttribute(arrayBuffer) {
|
|
|
61528
61537
|
}
|
|
61529
61538
|
|
|
61530
61539
|
// ../i3s/src/i3s-attribute-loader.ts
|
|
61531
|
-
var
|
|
61540
|
+
var VERSION13 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
61532
61541
|
var I3SAttributeLoader = {
|
|
61533
61542
|
name: "I3S Attribute",
|
|
61534
61543
|
id: "i3s-attribute",
|
|
61535
61544
|
module: "i3s",
|
|
61536
|
-
version:
|
|
61545
|
+
version: VERSION13,
|
|
61537
61546
|
mimeTypes: ["application/binary"],
|
|
61538
61547
|
parse: async (arrayBuffer, options) => parseI3STileAttribute(arrayBuffer, options),
|
|
61539
61548
|
extensions: ["bin"],
|
|
@@ -61991,13 +62000,13 @@ function getFeatureIdsFromFeatureIndexMetadata(featureIndex) {
|
|
|
61991
62000
|
}
|
|
61992
62001
|
|
|
61993
62002
|
// ../i3s/src/i3s-content-loader.ts
|
|
61994
|
-
var
|
|
62003
|
+
var VERSION14 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
61995
62004
|
var I3SContentLoader = {
|
|
61996
62005
|
name: "I3S Content (Indexed Scene Layers)",
|
|
61997
62006
|
id: "i3s-content",
|
|
61998
62007
|
module: "i3s",
|
|
61999
62008
|
worker: true,
|
|
62000
|
-
version:
|
|
62009
|
+
version: VERSION14,
|
|
62001
62010
|
mimeTypes: ["application/octet-stream"],
|
|
62002
62011
|
parse: parse6,
|
|
62003
62012
|
extensions: ["bin"],
|
|
@@ -62020,7 +62029,7 @@ var import_culling5 = __toModule(require_es53());
|
|
|
62020
62029
|
var import_geospatial9 = __toModule(require_es52());
|
|
62021
62030
|
|
|
62022
62031
|
// ../i3s/src/i3s-node-page-loader.ts
|
|
62023
|
-
var
|
|
62032
|
+
var VERSION15 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
62024
62033
|
async function parseNodePage(data, options) {
|
|
62025
62034
|
return JSON.parse(new TextDecoder().decode(data));
|
|
62026
62035
|
}
|
|
@@ -62028,7 +62037,7 @@ var I3SNodePageLoader = {
|
|
|
62028
62037
|
name: "I3S Node Page",
|
|
62029
62038
|
id: "i3s-node-page",
|
|
62030
62039
|
module: "i3s",
|
|
62031
|
-
version:
|
|
62040
|
+
version: VERSION15,
|
|
62032
62041
|
mimeTypes: ["application/json"],
|
|
62033
62042
|
parse: parseNodePage,
|
|
62034
62043
|
extensions: ["json"],
|
|
@@ -62280,6 +62289,7 @@ async function normalizeTilesetData(tileset, options, context) {
|
|
|
62280
62289
|
}
|
|
62281
62290
|
return {
|
|
62282
62291
|
...tileset,
|
|
62292
|
+
loader: I3SLoader,
|
|
62283
62293
|
url,
|
|
62284
62294
|
basePath: url,
|
|
62285
62295
|
type: TILESET_TYPE.I3S,
|
|
@@ -62291,7 +62301,7 @@ async function normalizeTilesetData(tileset, options, context) {
|
|
|
62291
62301
|
}
|
|
62292
62302
|
|
|
62293
62303
|
// ../i3s/src/i3s-loader.ts
|
|
62294
|
-
var
|
|
62304
|
+
var VERSION16 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
62295
62305
|
var TILESET_REGEX = /layers\/[0-9]+$/;
|
|
62296
62306
|
var TILE_HEADER_REGEX = /nodes\/([0-9-]+|root)$/;
|
|
62297
62307
|
var SLPK_HEX = "504b0304";
|
|
@@ -62300,7 +62310,7 @@ var I3SLoader = {
|
|
|
62300
62310
|
name: "I3S (Indexed Scene Layers)",
|
|
62301
62311
|
id: "i3s",
|
|
62302
62312
|
module: "i3s",
|
|
62303
|
-
version:
|
|
62313
|
+
version: VERSION16,
|
|
62304
62314
|
mimeTypes: ["application/octet-stream"],
|
|
62305
62315
|
parse: parseI3S,
|
|
62306
62316
|
extensions: ["bin"],
|