@loaders.gl/tile-converter 4.0.0-alpha.22 → 4.0.0-alpha.24
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-converter/helpers/load-i3s.d.ts.map +1 -1
- package/dist/constants.d.ts +0 -2
- package/dist/constants.d.ts.map +1 -1
- package/dist/converter.min.js +106 -106
- package/dist/dist.min.js +1883 -1241
- package/dist/es5/3d-tiles-converter/helpers/load-i3s.js.map +1 -1
- package/dist/es5/constants.js +1 -5
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +26 -11
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/feature-attributes.js +7 -17
- package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +83 -44
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +70 -17
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/node-index-document.js +3 -2
- package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js +1 -2
- package/dist/es5/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +36 -26
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-converter/types.js.map +1 -1
- package/dist/es5/i3s-server/controllers/slpk-controller.js +2 -2
- package/dist/es5/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/es5/pgm-loader.js +11 -3
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/es5/slpk-extractor/slpk-extractor.js +1 -1
- package/dist/es5/slpk-extractor/slpk-extractor.js.map +1 -1
- package/dist/esm/3d-tiles-converter/helpers/load-i3s.js.map +1 -1
- package/dist/esm/constants.js +0 -2
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js +21 -6
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/feature-attributes.js +9 -7
- package/dist/esm/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js +76 -34
- package/dist/esm/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +66 -13
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/node-index-document.js +2 -1
- package/dist/esm/i3s-converter/helpers/node-index-document.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js +1 -1
- package/dist/esm/i3s-converter/helpers/preprocess-3d-tiles.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +20 -17
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/i3s-converter/types.js.map +1 -1
- package/dist/esm/i3s-server/bin/i3s-server.min.js +71 -71
- package/dist/esm/i3s-server/controllers/slpk-controller.js +1 -1
- package/dist/esm/i3s-server/controllers/slpk-controller.js.map +1 -1
- package/dist/esm/pgm-loader.js +7 -4
- package/dist/esm/pgm-loader.js.map +1 -1
- package/dist/esm/slpk-extractor/slpk-extractor.js +2 -1
- package/dist/esm/slpk-extractor/slpk-extractor.js.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/feature-attributes.d.ts +6 -6
- package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.d.ts +2 -2
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/node-index-document.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.d.ts +1 -1
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/types.d.ts +7 -4
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/pgm-loader.d.ts +9 -2
- package/dist/pgm-loader.d.ts.map +1 -1
- package/dist/slpk-extractor/slpk-extractor.d.ts.map +1 -1
- package/dist/slpk-extractor.min.js +38 -38
- package/package.json +14 -14
- package/src/3d-tiles-converter/helpers/load-i3s.ts +1 -0
- package/src/constants.ts +0 -3
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +53 -14
- package/src/i3s-converter/helpers/feature-attributes.ts +20 -15
- package/src/i3s-converter/helpers/geometry-attributes.ts +80 -50
- package/src/i3s-converter/helpers/geometry-converter.ts +153 -21
- package/src/i3s-converter/helpers/node-index-document.ts +5 -1
- package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +1 -1
- package/src/i3s-converter/i3s-converter.ts +42 -17
- package/src/i3s-converter/types.ts +8 -4
- package/src/i3s-server/controllers/slpk-controller.ts +1 -1
- package/src/pgm-loader.ts +15 -7
- package/src/slpk-extractor/slpk-extractor.ts +2 -1
- package/dist/3d-tiles-converter/3d-tiles-converter.js +0 -279
- package/dist/3d-tiles-converter/helpers/b3dm-converter.js +0 -271
- package/dist/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +0 -23
- package/dist/3d-tiles-converter/helpers/load-i3s.js +0 -42
- package/dist/3d-tiles-converter/helpers/texture-atlas.js +0 -54
- package/dist/3d-tiles-converter/json-templates/tileset.js +0 -43
- package/dist/bundle.js +0 -5
- package/dist/constants.js +0 -6
- package/dist/converter-cli.js +0 -222
- package/dist/deps-installer/deps-installer.js +0 -89
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +0 -158
- package/dist/i3s-converter/helpers/coordinate-converter.js +0 -122
- package/dist/i3s-converter/helpers/create-scene-server-path.js +0 -28
- package/dist/i3s-converter/helpers/feature-attributes.js +0 -216
- package/dist/i3s-converter/helpers/geometry-attributes.js +0 -203
- package/dist/i3s-converter/helpers/geometry-converter.js +0 -1240
- package/dist/i3s-converter/helpers/gltf-attributes.js +0 -129
- package/dist/i3s-converter/helpers/load-3d-tiles.js +0 -99
- package/dist/i3s-converter/helpers/node-debug.js +0 -120
- package/dist/i3s-converter/helpers/node-index-document.js +0 -268
- package/dist/i3s-converter/helpers/node-pages.js +0 -316
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +0 -100
- package/dist/i3s-converter/helpers/tileset-traversal.js +0 -29
- package/dist/i3s-converter/i3s-converter.js +0 -945
- package/dist/i3s-converter/json-templates/geometry-definitions.js +0 -87
- package/dist/i3s-converter/json-templates/layers.js +0 -139
- package/dist/i3s-converter/json-templates/metadata.js +0 -25
- package/dist/i3s-converter/json-templates/node.js +0 -89
- package/dist/i3s-converter/json-templates/scene-server.js +0 -31
- package/dist/i3s-converter/json-templates/shared-resources.js +0 -129
- package/dist/i3s-converter/json-templates/store.js +0 -103
- package/dist/i3s-converter/types.js +0 -17
- package/dist/i3s-server/app.js +0 -29
- package/dist/i3s-server/bin/www.js +0 -37
- package/dist/i3s-server/controllers/index-controller.js +0 -31
- package/dist/i3s-server/controllers/slpk-controller.js +0 -33
- package/dist/i3s-server/routes/index.js +0 -20
- package/dist/i3s-server/routes/slpk-router.js +0 -34
- package/dist/i3s-server/utils/create-scene-server.js +0 -22
- package/dist/i3s-server/utils/server-utils.js +0 -66
- package/dist/index.js +0 -10
- package/dist/lib/utils/cli-utils.js +0 -82
- package/dist/lib/utils/compress-util.js +0 -257
- package/dist/lib/utils/file-utils.js +0 -139
- package/dist/lib/utils/geometry-utils.js +0 -18
- package/dist/lib/utils/lod-conversion-utils.js +0 -76
- package/dist/lib/utils/queue.js +0 -18
- package/dist/lib/utils/statistic-utills.js +0 -64
- package/dist/lib/utils/write-queue.js +0 -80
- package/dist/pgm-loader.js +0 -24
- package/dist/slpk-extractor/slpk-extractor.js +0 -74
- package/dist/slpk-extractor-cli.js +0 -102
package/dist/dist.min.js
CHANGED
|
@@ -10,8 +10,8 @@ var __commonJS = (cb, mod) => function __require() {
|
|
|
10
10
|
};
|
|
11
11
|
var __export = (target, all) => {
|
|
12
12
|
__markAsModule(target);
|
|
13
|
-
for (var
|
|
14
|
-
__defProp(target,
|
|
13
|
+
for (var name12 in all)
|
|
14
|
+
__defProp(target, name12, { get: all[name12], enumerable: true });
|
|
15
15
|
};
|
|
16
16
|
var __reExport = (target, module2, desc) => {
|
|
17
17
|
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
@@ -13302,7 +13302,7 @@ var require_utils = __commonJS({
|
|
|
13302
13302
|
}
|
|
13303
13303
|
return result;
|
|
13304
13304
|
};
|
|
13305
|
-
exports.prepareContent = function(
|
|
13305
|
+
exports.prepareContent = function(name12, inputData, isBinary, isOptimizedBinaryString, isBase64) {
|
|
13306
13306
|
var promise = external.Promise.resolve(inputData).then(function(data) {
|
|
13307
13307
|
var isBlob2 = support.blob && (data instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(data)) !== -1);
|
|
13308
13308
|
if (isBlob2 && typeof FileReader !== "undefined") {
|
|
@@ -13323,7 +13323,7 @@ var require_utils = __commonJS({
|
|
|
13323
13323
|
return promise.then(function(data) {
|
|
13324
13324
|
var dataType = exports.getTypeOf(data);
|
|
13325
13325
|
if (!dataType) {
|
|
13326
|
-
return external.Promise.reject(new Error("Can't read the data of '" +
|
|
13326
|
+
return external.Promise.reject(new Error("Can't read the data of '" + name12 + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
|
|
13327
13327
|
}
|
|
13328
13328
|
if (dataType === "arraybuffer") {
|
|
13329
13329
|
data = exports.transformTo("uint8array", data);
|
|
@@ -13346,8 +13346,8 @@ var require_utils = __commonJS({
|
|
|
13346
13346
|
var require_GenericWorker = __commonJS({
|
|
13347
13347
|
"../../node_modules/jszip/lib/stream/GenericWorker.js"(exports, module2) {
|
|
13348
13348
|
"use strict";
|
|
13349
|
-
function GenericWorker(
|
|
13350
|
-
this.name =
|
|
13349
|
+
function GenericWorker(name12) {
|
|
13350
|
+
this.name = name12 || "default";
|
|
13351
13351
|
this.streamInfo = {};
|
|
13352
13352
|
this.generatedError = null;
|
|
13353
13353
|
this.extraStreamInfo = {};
|
|
@@ -13395,18 +13395,18 @@ var require_GenericWorker = __commonJS({
|
|
|
13395
13395
|
}
|
|
13396
13396
|
return true;
|
|
13397
13397
|
},
|
|
13398
|
-
on: function(
|
|
13399
|
-
this._listeners[
|
|
13398
|
+
on: function(name12, listener) {
|
|
13399
|
+
this._listeners[name12].push(listener);
|
|
13400
13400
|
return this;
|
|
13401
13401
|
},
|
|
13402
13402
|
cleanUp: function() {
|
|
13403
13403
|
this.streamInfo = this.generatedError = this.extraStreamInfo = null;
|
|
13404
13404
|
this._listeners = [];
|
|
13405
13405
|
},
|
|
13406
|
-
emit: function(
|
|
13407
|
-
if (this._listeners[
|
|
13408
|
-
for (var i = 0; i < this._listeners[
|
|
13409
|
-
this._listeners[
|
|
13406
|
+
emit: function(name12, arg) {
|
|
13407
|
+
if (this._listeners[name12]) {
|
|
13408
|
+
for (var i = 0; i < this._listeners[name12].length; i++) {
|
|
13409
|
+
this._listeners[name12][i].call(this, arg);
|
|
13410
13410
|
}
|
|
13411
13411
|
}
|
|
13412
13412
|
},
|
|
@@ -14115,8 +14115,8 @@ var require_zipObject = __commonJS({
|
|
|
14115
14115
|
var utf8 = require_utf8();
|
|
14116
14116
|
var CompressedObject = require_compressedObject();
|
|
14117
14117
|
var GenericWorker = require_GenericWorker();
|
|
14118
|
-
var ZipObject = function(
|
|
14119
|
-
this.name =
|
|
14118
|
+
var ZipObject = function(name12, data, options) {
|
|
14119
|
+
this.name = name12;
|
|
14120
14120
|
this.dir = options.dir;
|
|
14121
14121
|
this.date = options.date;
|
|
14122
14122
|
this.comment = options.comment;
|
|
@@ -18748,7 +18748,7 @@ var require_object = __commonJS({
|
|
|
18748
18748
|
var generate = require_generate();
|
|
18749
18749
|
var nodejsUtils = require_nodejsUtils();
|
|
18750
18750
|
var NodejsStreamInputAdapter = require_NodejsStreamInputAdapter();
|
|
18751
|
-
var fileAdd = function(
|
|
18751
|
+
var fileAdd = function(name12, data, originalOptions) {
|
|
18752
18752
|
var dataType = utils.getTypeOf(data), parent;
|
|
18753
18753
|
var o = utils.extend(originalOptions || {}, defaults);
|
|
18754
18754
|
o.date = o.date || new Date();
|
|
@@ -18765,9 +18765,9 @@ var require_object = __commonJS({
|
|
|
18765
18765
|
o.dir = true;
|
|
18766
18766
|
}
|
|
18767
18767
|
if (o.dir) {
|
|
18768
|
-
|
|
18768
|
+
name12 = forceTrailingSlash(name12);
|
|
18769
18769
|
}
|
|
18770
|
-
if (o.createFolders && (parent = parentFolder(
|
|
18770
|
+
if (o.createFolders && (parent = parentFolder(name12))) {
|
|
18771
18771
|
folderAdd.call(this, parent, true);
|
|
18772
18772
|
}
|
|
18773
18773
|
var isUnicodeString = dataType === "string" && o.binary === false && o.base64 === false;
|
|
@@ -18786,12 +18786,12 @@ var require_object = __commonJS({
|
|
|
18786
18786
|
if (data instanceof CompressedObject || data instanceof GenericWorker) {
|
|
18787
18787
|
zipObjectContent = data;
|
|
18788
18788
|
} else if (nodejsUtils.isNode && nodejsUtils.isStream(data)) {
|
|
18789
|
-
zipObjectContent = new NodejsStreamInputAdapter(
|
|
18789
|
+
zipObjectContent = new NodejsStreamInputAdapter(name12, data);
|
|
18790
18790
|
} else {
|
|
18791
|
-
zipObjectContent = utils.prepareContent(
|
|
18791
|
+
zipObjectContent = utils.prepareContent(name12, data, o.binary, o.optimizedBinaryString, o.base64);
|
|
18792
18792
|
}
|
|
18793
|
-
var object = new ZipObject(
|
|
18794
|
-
this.files[
|
|
18793
|
+
var object = new ZipObject(name12, zipObjectContent, o);
|
|
18794
|
+
this.files[name12] = object;
|
|
18795
18795
|
};
|
|
18796
18796
|
var parentFolder = function(path2) {
|
|
18797
18797
|
if (path2.slice(-1) === "/") {
|
|
@@ -18806,16 +18806,16 @@ var require_object = __commonJS({
|
|
|
18806
18806
|
}
|
|
18807
18807
|
return path2;
|
|
18808
18808
|
};
|
|
18809
|
-
var folderAdd = function(
|
|
18809
|
+
var folderAdd = function(name12, createFolders) {
|
|
18810
18810
|
createFolders = typeof createFolders !== "undefined" ? createFolders : defaults.createFolders;
|
|
18811
|
-
|
|
18812
|
-
if (!this.files[
|
|
18813
|
-
fileAdd.call(this,
|
|
18811
|
+
name12 = forceTrailingSlash(name12);
|
|
18812
|
+
if (!this.files[name12]) {
|
|
18813
|
+
fileAdd.call(this, name12, null, {
|
|
18814
18814
|
dir: true,
|
|
18815
18815
|
createFolders
|
|
18816
18816
|
});
|
|
18817
18817
|
}
|
|
18818
|
-
return this.files[
|
|
18818
|
+
return this.files[name12];
|
|
18819
18819
|
};
|
|
18820
18820
|
function isRegExp(object) {
|
|
18821
18821
|
return Object.prototype.toString.call(object) === "[object RegExp]";
|
|
@@ -18843,15 +18843,15 @@ var require_object = __commonJS({
|
|
|
18843
18843
|
});
|
|
18844
18844
|
return result;
|
|
18845
18845
|
},
|
|
18846
|
-
file: function(
|
|
18846
|
+
file: function(name12, data, o) {
|
|
18847
18847
|
if (arguments.length === 1) {
|
|
18848
|
-
if (isRegExp(
|
|
18849
|
-
var regexp =
|
|
18848
|
+
if (isRegExp(name12)) {
|
|
18849
|
+
var regexp = name12;
|
|
18850
18850
|
return this.filter(function(relativePath, file) {
|
|
18851
18851
|
return !file.dir && regexp.test(relativePath);
|
|
18852
18852
|
});
|
|
18853
18853
|
} else {
|
|
18854
|
-
var obj = this.files[this.root +
|
|
18854
|
+
var obj = this.files[this.root + name12];
|
|
18855
18855
|
if (obj && !obj.dir) {
|
|
18856
18856
|
return obj;
|
|
18857
18857
|
} else {
|
|
@@ -18859,8 +18859,8 @@ var require_object = __commonJS({
|
|
|
18859
18859
|
}
|
|
18860
18860
|
}
|
|
18861
18861
|
} else {
|
|
18862
|
-
|
|
18863
|
-
fileAdd.call(this,
|
|
18862
|
+
name12 = this.root + name12;
|
|
18863
|
+
fileAdd.call(this, name12, data, o);
|
|
18864
18864
|
}
|
|
18865
18865
|
return this;
|
|
18866
18866
|
},
|
|
@@ -18873,26 +18873,26 @@ var require_object = __commonJS({
|
|
|
18873
18873
|
return file.dir && arg.test(relativePath);
|
|
18874
18874
|
});
|
|
18875
18875
|
}
|
|
18876
|
-
var
|
|
18877
|
-
var newFolder = folderAdd.call(this,
|
|
18876
|
+
var name12 = this.root + arg;
|
|
18877
|
+
var newFolder = folderAdd.call(this, name12);
|
|
18878
18878
|
var ret = this.clone();
|
|
18879
18879
|
ret.root = newFolder.name;
|
|
18880
18880
|
return ret;
|
|
18881
18881
|
},
|
|
18882
|
-
remove: function(
|
|
18883
|
-
|
|
18884
|
-
var file = this.files[
|
|
18882
|
+
remove: function(name12) {
|
|
18883
|
+
name12 = this.root + name12;
|
|
18884
|
+
var file = this.files[name12];
|
|
18885
18885
|
if (!file) {
|
|
18886
|
-
if (
|
|
18887
|
-
|
|
18886
|
+
if (name12.slice(-1) !== "/") {
|
|
18887
|
+
name12 += "/";
|
|
18888
18888
|
}
|
|
18889
|
-
file = this.files[
|
|
18889
|
+
file = this.files[name12];
|
|
18890
18890
|
}
|
|
18891
18891
|
if (file && !file.dir) {
|
|
18892
|
-
delete this.files[
|
|
18892
|
+
delete this.files[name12];
|
|
18893
18893
|
} else {
|
|
18894
18894
|
var kids = this.filter(function(relativePath, file2) {
|
|
18895
|
-
return file2.name.slice(0,
|
|
18895
|
+
return file2.name.slice(0, name12.length) === name12;
|
|
18896
18896
|
});
|
|
18897
18897
|
for (var i = 0; i < kids.length; i++) {
|
|
18898
18898
|
delete this.files[kids[i].name];
|
|
@@ -20074,7 +20074,7 @@ var require_v35 = __commonJS({
|
|
|
20074
20074
|
exports.DNS = DNS;
|
|
20075
20075
|
var URL2 = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
|
|
20076
20076
|
exports.URL = URL2;
|
|
20077
|
-
function v35(
|
|
20077
|
+
function v35(name12, version2, hashfunc) {
|
|
20078
20078
|
function generateUUID(value, namespace, buf, offset) {
|
|
20079
20079
|
var _namespace;
|
|
20080
20080
|
if (typeof value === "string") {
|
|
@@ -20102,7 +20102,7 @@ var require_v35 = __commonJS({
|
|
|
20102
20102
|
return (0, _stringify.unsafeStringify)(bytes);
|
|
20103
20103
|
}
|
|
20104
20104
|
try {
|
|
20105
|
-
generateUUID.name =
|
|
20105
|
+
generateUUID.name = name12;
|
|
20106
20106
|
} catch (err) {
|
|
20107
20107
|
}
|
|
20108
20108
|
generateUUID.DNS = DNS;
|
|
@@ -21297,12 +21297,12 @@ var require_readdir_glob = __commonJS({
|
|
|
21297
21297
|
async function* exploreWalkAsync(dir, path2, followSymlinks, useStat, shouldSkip, strict) {
|
|
21298
21298
|
let files = await readdir2(path2 + dir, strict);
|
|
21299
21299
|
for (const file of files) {
|
|
21300
|
-
let
|
|
21301
|
-
if (
|
|
21302
|
-
|
|
21300
|
+
let name12 = file.name;
|
|
21301
|
+
if (name12 === void 0) {
|
|
21302
|
+
name12 = file;
|
|
21303
21303
|
useStat = true;
|
|
21304
21304
|
}
|
|
21305
|
-
const filename2 = dir + "/" +
|
|
21305
|
+
const filename2 = dir + "/" + name12;
|
|
21306
21306
|
const relative = filename2.slice(1);
|
|
21307
21307
|
const absolute = path2 + "/" + relative;
|
|
21308
21308
|
let stats = null;
|
|
@@ -22013,7 +22013,7 @@ var require_async = __commonJS({
|
|
|
22013
22013
|
newTasks[key] = params.concat(newTask);
|
|
22014
22014
|
}
|
|
22015
22015
|
function newTask(results, taskCb) {
|
|
22016
|
-
var newArgs = params.map((
|
|
22016
|
+
var newArgs = params.map((name12) => results[name12]);
|
|
22017
22017
|
newArgs.push(taskCb);
|
|
22018
22018
|
wrapAsync(taskFn)(...newArgs);
|
|
22019
22019
|
}
|
|
@@ -22209,18 +22209,18 @@ var require_async = __commonJS({
|
|
|
22209
22209
|
}
|
|
22210
22210
|
return false;
|
|
22211
22211
|
}
|
|
22212
|
-
const eventMethod = (
|
|
22212
|
+
const eventMethod = (name12) => (handler) => {
|
|
22213
22213
|
if (!handler) {
|
|
22214
22214
|
return new Promise((resolve2, reject2) => {
|
|
22215
|
-
once2(
|
|
22215
|
+
once2(name12, (err, data) => {
|
|
22216
22216
|
if (err)
|
|
22217
22217
|
return reject2(err);
|
|
22218
22218
|
resolve2(data);
|
|
22219
22219
|
});
|
|
22220
22220
|
});
|
|
22221
22221
|
}
|
|
22222
|
-
off(
|
|
22223
|
-
on(
|
|
22222
|
+
off(name12);
|
|
22223
|
+
on(name12, handler);
|
|
22224
22224
|
};
|
|
22225
22225
|
var isProcessing = false;
|
|
22226
22226
|
var q = {
|
|
@@ -22463,15 +22463,15 @@ var require_async = __commonJS({
|
|
|
22463
22463
|
return _createTester((bool) => bool, (res, item) => item)(eachOfLimit(1), coll, iteratee, callback);
|
|
22464
22464
|
}
|
|
22465
22465
|
var detectSeries$1 = awaitify(detectSeries, 3);
|
|
22466
|
-
function consoleFunc(
|
|
22466
|
+
function consoleFunc(name12) {
|
|
22467
22467
|
return (fn, ...args) => wrapAsync(fn)(...args, (err, ...resultArgs) => {
|
|
22468
22468
|
if (typeof console === "object") {
|
|
22469
22469
|
if (err) {
|
|
22470
22470
|
if (console.error) {
|
|
22471
22471
|
console.error(err);
|
|
22472
22472
|
}
|
|
22473
|
-
} else if (console[
|
|
22474
|
-
resultArgs.forEach((x) => console[
|
|
22473
|
+
} else if (console[name12]) {
|
|
22474
|
+
resultArgs.forEach((x) => console[name12](x));
|
|
22475
22475
|
}
|
|
22476
22476
|
}
|
|
22477
22477
|
});
|
|
@@ -23031,8 +23031,8 @@ var require_async = __commonJS({
|
|
|
23031
23031
|
var timedOut = false;
|
|
23032
23032
|
var timer;
|
|
23033
23033
|
function timeoutCallback() {
|
|
23034
|
-
var
|
|
23035
|
-
var error = new Error('Callback function "' +
|
|
23034
|
+
var name12 = asyncFn.name || "anonymous";
|
|
23035
|
+
var error = new Error('Callback function "' + name12 + '" timed out.');
|
|
23036
23036
|
error.code = "ETIMEDOUT";
|
|
23037
23037
|
if (info) {
|
|
23038
23038
|
error.info = info;
|
|
@@ -27000,8 +27000,8 @@ var require_once = __commonJS({
|
|
|
27000
27000
|
f.called = true;
|
|
27001
27001
|
return f.value = fn.apply(this, arguments);
|
|
27002
27002
|
};
|
|
27003
|
-
var
|
|
27004
|
-
f.onceError =
|
|
27003
|
+
var name12 = fn.name || "Function wrapped with `once`";
|
|
27004
|
+
f.onceError = name12 + " shouldn't be called more than once";
|
|
27005
27005
|
f.called = false;
|
|
27006
27006
|
return f;
|
|
27007
27007
|
}
|
|
@@ -28329,10 +28329,10 @@ var require_errors = __commonJS({
|
|
|
28329
28329
|
return str.indexOf(search, start) !== -1;
|
|
28330
28330
|
}
|
|
28331
28331
|
}
|
|
28332
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
28333
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
28332
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
|
|
28333
|
+
return 'The value "' + value + '" is invalid for option "' + name12 + '"';
|
|
28334
28334
|
}, TypeError);
|
|
28335
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
28335
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
|
|
28336
28336
|
let determiner;
|
|
28337
28337
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
28338
28338
|
determiner = "must not be";
|
|
@@ -28341,22 +28341,22 @@ var require_errors = __commonJS({
|
|
|
28341
28341
|
determiner = "must be";
|
|
28342
28342
|
}
|
|
28343
28343
|
let msg;
|
|
28344
|
-
if (endsWith(
|
|
28345
|
-
msg = `The ${
|
|
28344
|
+
if (endsWith(name12, " argument")) {
|
|
28345
|
+
msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
|
|
28346
28346
|
} else {
|
|
28347
|
-
const type = includes(
|
|
28348
|
-
msg = `The "${
|
|
28347
|
+
const type = includes(name12, ".") ? "property" : "argument";
|
|
28348
|
+
msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
28349
28349
|
}
|
|
28350
28350
|
msg += `. Received type ${typeof actual}`;
|
|
28351
28351
|
return msg;
|
|
28352
28352
|
}, TypeError);
|
|
28353
28353
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
28354
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
28355
|
-
return "The " +
|
|
28354
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
|
|
28355
|
+
return "The " + name12 + " method is not implemented";
|
|
28356
28356
|
});
|
|
28357
28357
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
28358
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
28359
|
-
return "Cannot call " +
|
|
28358
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name12) {
|
|
28359
|
+
return "Cannot call " + name12 + " after a stream was destroyed";
|
|
28360
28360
|
});
|
|
28361
28361
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
28362
28362
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -28382,8 +28382,8 @@ var require_state = __commonJS({
|
|
|
28382
28382
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
28383
28383
|
if (hwm != null) {
|
|
28384
28384
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
28385
|
-
var
|
|
28386
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
28385
|
+
var name12 = isDuplex ? duplexKey : "highWaterMark";
|
|
28386
|
+
throw new ERR_INVALID_OPT_VALUE(name12, hwm);
|
|
28387
28387
|
}
|
|
28388
28388
|
return Math.floor(hwm);
|
|
28389
28389
|
}
|
|
@@ -31493,9 +31493,9 @@ var require_zip_archive_entry = __commonJS({
|
|
|
31493
31493
|
var UnixStat = require_unix_stat();
|
|
31494
31494
|
var constants = require_constants4();
|
|
31495
31495
|
var zipUtil = require_util2();
|
|
31496
|
-
var ZipArchiveEntry = module2.exports = function(
|
|
31496
|
+
var ZipArchiveEntry = module2.exports = function(name12) {
|
|
31497
31497
|
if (!(this instanceof ZipArchiveEntry)) {
|
|
31498
|
-
return new ZipArchiveEntry(
|
|
31498
|
+
return new ZipArchiveEntry(name12);
|
|
31499
31499
|
}
|
|
31500
31500
|
ArchiveEntry.call(this);
|
|
31501
31501
|
this.platform = constants.PLATFORM_FAT;
|
|
@@ -31512,8 +31512,8 @@ var require_zip_archive_entry = __commonJS({
|
|
|
31512
31512
|
this.exattr = 0;
|
|
31513
31513
|
this.inattr = 0;
|
|
31514
31514
|
this.comment = null;
|
|
31515
|
-
if (
|
|
31516
|
-
this.setName(
|
|
31515
|
+
if (name12) {
|
|
31516
|
+
this.setName(name12);
|
|
31517
31517
|
}
|
|
31518
31518
|
};
|
|
31519
31519
|
inherits(ZipArchiveEntry, ArchiveEntry);
|
|
@@ -31610,15 +31610,15 @@ var require_zip_archive_entry = __commonJS({
|
|
|
31610
31610
|
}
|
|
31611
31611
|
this.method = method;
|
|
31612
31612
|
};
|
|
31613
|
-
ZipArchiveEntry.prototype.setName = function(
|
|
31614
|
-
|
|
31613
|
+
ZipArchiveEntry.prototype.setName = function(name12, prependSlash = false) {
|
|
31614
|
+
name12 = normalizePath(name12, false).replace(/^\w+:/, "").replace(/^(\.\.\/|\/)+/, "");
|
|
31615
31615
|
if (prependSlash) {
|
|
31616
|
-
|
|
31616
|
+
name12 = `/${name12}`;
|
|
31617
31617
|
}
|
|
31618
|
-
if (Buffer.byteLength(
|
|
31618
|
+
if (Buffer.byteLength(name12) !== name12.length) {
|
|
31619
31619
|
this.getGeneralPurposeBit().useUTF8ForNames(true);
|
|
31620
31620
|
}
|
|
31621
|
-
this.name =
|
|
31621
|
+
this.name = name12;
|
|
31622
31622
|
};
|
|
31623
31623
|
ZipArchiveEntry.prototype.setPlatform = function(platform) {
|
|
31624
31624
|
this.platform = platform;
|
|
@@ -32073,10 +32073,10 @@ var require_errors2 = __commonJS({
|
|
|
32073
32073
|
return str.indexOf(search, start) !== -1;
|
|
32074
32074
|
}
|
|
32075
32075
|
}
|
|
32076
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
32077
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
32076
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
|
|
32077
|
+
return 'The value "' + value + '" is invalid for option "' + name12 + '"';
|
|
32078
32078
|
}, TypeError);
|
|
32079
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
32079
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
|
|
32080
32080
|
let determiner;
|
|
32081
32081
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
32082
32082
|
determiner = "must not be";
|
|
@@ -32085,22 +32085,22 @@ var require_errors2 = __commonJS({
|
|
|
32085
32085
|
determiner = "must be";
|
|
32086
32086
|
}
|
|
32087
32087
|
let msg;
|
|
32088
|
-
if (endsWith(
|
|
32089
|
-
msg = `The ${
|
|
32088
|
+
if (endsWith(name12, " argument")) {
|
|
32089
|
+
msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
|
|
32090
32090
|
} else {
|
|
32091
|
-
const type = includes(
|
|
32092
|
-
msg = `The "${
|
|
32091
|
+
const type = includes(name12, ".") ? "property" : "argument";
|
|
32092
|
+
msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
32093
32093
|
}
|
|
32094
32094
|
msg += `. Received type ${typeof actual}`;
|
|
32095
32095
|
return msg;
|
|
32096
32096
|
}, TypeError);
|
|
32097
32097
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
32098
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
32099
|
-
return "The " +
|
|
32098
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
|
|
32099
|
+
return "The " + name12 + " method is not implemented";
|
|
32100
32100
|
});
|
|
32101
32101
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
32102
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
32103
|
-
return "Cannot call " +
|
|
32102
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name12) {
|
|
32103
|
+
return "Cannot call " + name12 + " after a stream was destroyed";
|
|
32104
32104
|
});
|
|
32105
32105
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
32106
32106
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -32126,8 +32126,8 @@ var require_state2 = __commonJS({
|
|
|
32126
32126
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
32127
32127
|
if (hwm != null) {
|
|
32128
32128
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
32129
|
-
var
|
|
32130
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
32129
|
+
var name12 = isDuplex ? duplexKey : "highWaterMark";
|
|
32130
|
+
throw new ERR_INVALID_OPT_VALUE(name12, hwm);
|
|
32131
32131
|
}
|
|
32132
32132
|
return Math.floor(hwm);
|
|
32133
32133
|
}
|
|
@@ -35247,10 +35247,10 @@ var require_errors3 = __commonJS({
|
|
|
35247
35247
|
return str.indexOf(search, start) !== -1;
|
|
35248
35248
|
}
|
|
35249
35249
|
}
|
|
35250
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
35251
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
35250
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
|
|
35251
|
+
return 'The value "' + value + '" is invalid for option "' + name12 + '"';
|
|
35252
35252
|
}, TypeError);
|
|
35253
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
35253
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
|
|
35254
35254
|
let determiner;
|
|
35255
35255
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
35256
35256
|
determiner = "must not be";
|
|
@@ -35259,22 +35259,22 @@ var require_errors3 = __commonJS({
|
|
|
35259
35259
|
determiner = "must be";
|
|
35260
35260
|
}
|
|
35261
35261
|
let msg;
|
|
35262
|
-
if (endsWith(
|
|
35263
|
-
msg = `The ${
|
|
35262
|
+
if (endsWith(name12, " argument")) {
|
|
35263
|
+
msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
|
|
35264
35264
|
} else {
|
|
35265
|
-
const type = includes(
|
|
35266
|
-
msg = `The "${
|
|
35265
|
+
const type = includes(name12, ".") ? "property" : "argument";
|
|
35266
|
+
msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
35267
35267
|
}
|
|
35268
35268
|
msg += `. Received type ${typeof actual}`;
|
|
35269
35269
|
return msg;
|
|
35270
35270
|
}, TypeError);
|
|
35271
35271
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
35272
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
35273
|
-
return "The " +
|
|
35272
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
|
|
35273
|
+
return "The " + name12 + " method is not implemented";
|
|
35274
35274
|
});
|
|
35275
35275
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
35276
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
35277
|
-
return "Cannot call " +
|
|
35276
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name12) {
|
|
35277
|
+
return "Cannot call " + name12 + " after a stream was destroyed";
|
|
35278
35278
|
});
|
|
35279
35279
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
35280
35280
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -35300,8 +35300,8 @@ var require_state3 = __commonJS({
|
|
|
35300
35300
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
35301
35301
|
if (hwm != null) {
|
|
35302
35302
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
35303
|
-
var
|
|
35304
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
35303
|
+
var name12 = isDuplex ? duplexKey : "highWaterMark";
|
|
35304
|
+
throw new ERR_INVALID_OPT_VALUE(name12, hwm);
|
|
35305
35305
|
}
|
|
35306
35306
|
return Math.floor(hwm);
|
|
35307
35307
|
}
|
|
@@ -37995,14 +37995,14 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
37995
37995
|
this.write(zipUtil.getLongBytes(ae.getCrc()));
|
|
37996
37996
|
this.write(zipUtil.getLongBytes(compressedSize));
|
|
37997
37997
|
this.write(zipUtil.getLongBytes(size));
|
|
37998
|
-
var
|
|
37998
|
+
var name12 = ae.getName();
|
|
37999
37999
|
var comment = ae.getComment();
|
|
38000
38000
|
var extra = ae.getCentralDirectoryExtra();
|
|
38001
38001
|
if (gpb.usesUTF8ForNames()) {
|
|
38002
|
-
|
|
38002
|
+
name12 = Buffer.from(name12);
|
|
38003
38003
|
comment = Buffer.from(comment);
|
|
38004
38004
|
}
|
|
38005
|
-
this.write(zipUtil.getShortBytes(
|
|
38005
|
+
this.write(zipUtil.getShortBytes(name12.length));
|
|
38006
38006
|
this.write(zipUtil.getShortBytes(extra.length));
|
|
38007
38007
|
this.write(zipUtil.getShortBytes(comment.length));
|
|
38008
38008
|
this.write(constants.SHORT_ZERO);
|
|
@@ -38013,7 +38013,7 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
38013
38013
|
} else {
|
|
38014
38014
|
this.write(zipUtil.getLongBytes(offsets.file));
|
|
38015
38015
|
}
|
|
38016
|
-
this.write(
|
|
38016
|
+
this.write(name12);
|
|
38017
38017
|
this.write(extra);
|
|
38018
38018
|
this.write(comment);
|
|
38019
38019
|
};
|
|
@@ -38031,14 +38031,14 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
38031
38031
|
ZipArchiveOutputStream.prototype._writeLocalFileHeader = function(ae) {
|
|
38032
38032
|
var gpb = ae.getGeneralPurposeBit();
|
|
38033
38033
|
var method = ae.getMethod();
|
|
38034
|
-
var
|
|
38034
|
+
var name12 = ae.getName();
|
|
38035
38035
|
var extra = ae.getLocalFileDataExtra();
|
|
38036
38036
|
if (ae.isZip64()) {
|
|
38037
38037
|
gpb.useDataDescriptor(true);
|
|
38038
38038
|
ae.setVersionNeededToExtract(constants.MIN_VERSION_ZIP64);
|
|
38039
38039
|
}
|
|
38040
38040
|
if (gpb.usesUTF8ForNames()) {
|
|
38041
|
-
|
|
38041
|
+
name12 = Buffer.from(name12);
|
|
38042
38042
|
}
|
|
38043
38043
|
ae._offsets.file = this.offset;
|
|
38044
38044
|
this.write(zipUtil.getLongBytes(constants.SIG_LFH));
|
|
@@ -38056,9 +38056,9 @@ var require_zip_archive_output_stream = __commonJS({
|
|
|
38056
38056
|
this.write(zipUtil.getLongBytes(ae.getCompressedSize()));
|
|
38057
38057
|
this.write(zipUtil.getLongBytes(ae.getSize()));
|
|
38058
38058
|
}
|
|
38059
|
-
this.write(zipUtil.getShortBytes(
|
|
38059
|
+
this.write(zipUtil.getShortBytes(name12.length));
|
|
38060
38060
|
this.write(zipUtil.getShortBytes(extra.length));
|
|
38061
|
-
this.write(
|
|
38061
|
+
this.write(name12);
|
|
38062
38062
|
this.write(extra);
|
|
38063
38063
|
ae._offsets.contents = this.offset;
|
|
38064
38064
|
};
|
|
@@ -38644,10 +38644,10 @@ var require_errors4 = __commonJS({
|
|
|
38644
38644
|
return str.indexOf(search, start) !== -1;
|
|
38645
38645
|
}
|
|
38646
38646
|
}
|
|
38647
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
38648
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
38647
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
|
|
38648
|
+
return 'The value "' + value + '" is invalid for option "' + name12 + '"';
|
|
38649
38649
|
}, TypeError);
|
|
38650
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
38650
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
|
|
38651
38651
|
let determiner;
|
|
38652
38652
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
38653
38653
|
determiner = "must not be";
|
|
@@ -38656,22 +38656,22 @@ var require_errors4 = __commonJS({
|
|
|
38656
38656
|
determiner = "must be";
|
|
38657
38657
|
}
|
|
38658
38658
|
let msg;
|
|
38659
|
-
if (endsWith(
|
|
38660
|
-
msg = `The ${
|
|
38659
|
+
if (endsWith(name12, " argument")) {
|
|
38660
|
+
msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
|
|
38661
38661
|
} else {
|
|
38662
|
-
const type = includes(
|
|
38663
|
-
msg = `The "${
|
|
38662
|
+
const type = includes(name12, ".") ? "property" : "argument";
|
|
38663
|
+
msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
38664
38664
|
}
|
|
38665
38665
|
msg += `. Received type ${typeof actual}`;
|
|
38666
38666
|
return msg;
|
|
38667
38667
|
}, TypeError);
|
|
38668
38668
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
38669
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
38670
|
-
return "The " +
|
|
38669
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
|
|
38670
|
+
return "The " + name12 + " method is not implemented";
|
|
38671
38671
|
});
|
|
38672
38672
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
38673
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
38674
|
-
return "Cannot call " +
|
|
38673
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name12) {
|
|
38674
|
+
return "Cannot call " + name12 + " after a stream was destroyed";
|
|
38675
38675
|
});
|
|
38676
38676
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
38677
38677
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -38697,8 +38697,8 @@ var require_state4 = __commonJS({
|
|
|
38697
38697
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
38698
38698
|
if (hwm != null) {
|
|
38699
38699
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
38700
|
-
var
|
|
38701
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
38700
|
+
var name12 = isDuplex ? duplexKey : "highWaterMark";
|
|
38701
|
+
throw new ERR_INVALID_OPT_VALUE(name12, hwm);
|
|
38702
38702
|
}
|
|
38703
38703
|
return Math.floor(hwm);
|
|
38704
38704
|
}
|
|
@@ -41548,24 +41548,24 @@ var require_headers = __commonJS({
|
|
|
41548
41548
|
};
|
|
41549
41549
|
exports.encode = function(opts) {
|
|
41550
41550
|
var buf = alloc(512);
|
|
41551
|
-
var
|
|
41551
|
+
var name12 = opts.name;
|
|
41552
41552
|
var prefix = "";
|
|
41553
|
-
if (opts.typeflag === 5 &&
|
|
41554
|
-
|
|
41555
|
-
if (Buffer.byteLength(
|
|
41553
|
+
if (opts.typeflag === 5 && name12[name12.length - 1] !== "/")
|
|
41554
|
+
name12 += "/";
|
|
41555
|
+
if (Buffer.byteLength(name12) !== name12.length)
|
|
41556
41556
|
return null;
|
|
41557
|
-
while (Buffer.byteLength(
|
|
41558
|
-
var i =
|
|
41557
|
+
while (Buffer.byteLength(name12) > 100) {
|
|
41558
|
+
var i = name12.indexOf("/");
|
|
41559
41559
|
if (i === -1)
|
|
41560
41560
|
return null;
|
|
41561
|
-
prefix += prefix ? "/" +
|
|
41562
|
-
|
|
41561
|
+
prefix += prefix ? "/" + name12.slice(0, i) : name12.slice(0, i);
|
|
41562
|
+
name12 = name12.slice(i + 1);
|
|
41563
41563
|
}
|
|
41564
|
-
if (Buffer.byteLength(
|
|
41564
|
+
if (Buffer.byteLength(name12) > 100 || Buffer.byteLength(prefix) > 155)
|
|
41565
41565
|
return null;
|
|
41566
41566
|
if (opts.linkname && Buffer.byteLength(opts.linkname) > 100)
|
|
41567
41567
|
return null;
|
|
41568
|
-
buf.write(
|
|
41568
|
+
buf.write(name12);
|
|
41569
41569
|
buf.write(encodeOct(opts.mode & MASK, 6), 100);
|
|
41570
41570
|
buf.write(encodeOct(opts.uid, 6), 108);
|
|
41571
41571
|
buf.write(encodeOct(opts.gid, 6), 116);
|
|
@@ -41589,7 +41589,7 @@ var require_headers = __commonJS({
|
|
|
41589
41589
|
};
|
|
41590
41590
|
exports.decode = function(buf, filenameEncoding, allowUnknownFormat) {
|
|
41591
41591
|
var typeflag = buf[156] === 0 ? 0 : buf[156] - ZERO_OFFSET;
|
|
41592
|
-
var
|
|
41592
|
+
var name12 = decodeStr(buf, 0, 100, filenameEncoding);
|
|
41593
41593
|
var mode = decodeOct(buf, 100, 8);
|
|
41594
41594
|
var uid = decodeOct(buf, 108, 8);
|
|
41595
41595
|
var gid = decodeOct(buf, 116, 8);
|
|
@@ -41608,17 +41608,17 @@ var require_headers = __commonJS({
|
|
|
41608
41608
|
throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");
|
|
41609
41609
|
if (USTAR_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0) {
|
|
41610
41610
|
if (buf[345])
|
|
41611
|
-
|
|
41611
|
+
name12 = decodeStr(buf, 345, 155, filenameEncoding) + "/" + name12;
|
|
41612
41612
|
} else if (GNU_MAGIC.compare(buf, MAGIC_OFFSET, MAGIC_OFFSET + 6) === 0 && GNU_VER.compare(buf, VERSION_OFFSET, VERSION_OFFSET + 2) === 0) {
|
|
41613
41613
|
} else {
|
|
41614
41614
|
if (!allowUnknownFormat) {
|
|
41615
41615
|
throw new Error("Invalid tar header: unknown format.");
|
|
41616
41616
|
}
|
|
41617
41617
|
}
|
|
41618
|
-
if (typeflag === 0 &&
|
|
41618
|
+
if (typeflag === 0 && name12 && name12[name12.length - 1] === "/")
|
|
41619
41619
|
typeflag = 5;
|
|
41620
41620
|
return {
|
|
41621
|
-
name:
|
|
41621
|
+
name: name12,
|
|
41622
41622
|
mode,
|
|
41623
41623
|
uid,
|
|
41624
41624
|
gid,
|
|
@@ -42050,10 +42050,10 @@ var require_errors5 = __commonJS({
|
|
|
42050
42050
|
return str.indexOf(search, start) !== -1;
|
|
42051
42051
|
}
|
|
42052
42052
|
}
|
|
42053
|
-
createErrorType("ERR_INVALID_OPT_VALUE", function(
|
|
42054
|
-
return 'The value "' + value + '" is invalid for option "' +
|
|
42053
|
+
createErrorType("ERR_INVALID_OPT_VALUE", function(name12, value) {
|
|
42054
|
+
return 'The value "' + value + '" is invalid for option "' + name12 + '"';
|
|
42055
42055
|
}, TypeError);
|
|
42056
|
-
createErrorType("ERR_INVALID_ARG_TYPE", function(
|
|
42056
|
+
createErrorType("ERR_INVALID_ARG_TYPE", function(name12, expected, actual) {
|
|
42057
42057
|
let determiner;
|
|
42058
42058
|
if (typeof expected === "string" && startsWith(expected, "not ")) {
|
|
42059
42059
|
determiner = "must not be";
|
|
@@ -42062,22 +42062,22 @@ var require_errors5 = __commonJS({
|
|
|
42062
42062
|
determiner = "must be";
|
|
42063
42063
|
}
|
|
42064
42064
|
let msg;
|
|
42065
|
-
if (endsWith(
|
|
42066
|
-
msg = `The ${
|
|
42065
|
+
if (endsWith(name12, " argument")) {
|
|
42066
|
+
msg = `The ${name12} ${determiner} ${oneOf(expected, "type")}`;
|
|
42067
42067
|
} else {
|
|
42068
|
-
const type = includes(
|
|
42069
|
-
msg = `The "${
|
|
42068
|
+
const type = includes(name12, ".") ? "property" : "argument";
|
|
42069
|
+
msg = `The "${name12}" ${type} ${determiner} ${oneOf(expected, "type")}`;
|
|
42070
42070
|
}
|
|
42071
42071
|
msg += `. Received type ${typeof actual}`;
|
|
42072
42072
|
return msg;
|
|
42073
42073
|
}, TypeError);
|
|
42074
42074
|
createErrorType("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF");
|
|
42075
|
-
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(
|
|
42076
|
-
return "The " +
|
|
42075
|
+
createErrorType("ERR_METHOD_NOT_IMPLEMENTED", function(name12) {
|
|
42076
|
+
return "The " + name12 + " method is not implemented";
|
|
42077
42077
|
});
|
|
42078
42078
|
createErrorType("ERR_STREAM_PREMATURE_CLOSE", "Premature close");
|
|
42079
|
-
createErrorType("ERR_STREAM_DESTROYED", function(
|
|
42080
|
-
return "Cannot call " +
|
|
42079
|
+
createErrorType("ERR_STREAM_DESTROYED", function(name12) {
|
|
42080
|
+
return "Cannot call " + name12 + " after a stream was destroyed";
|
|
42081
42081
|
});
|
|
42082
42082
|
createErrorType("ERR_MULTIPLE_CALLBACK", "Callback called multiple times");
|
|
42083
42083
|
createErrorType("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable");
|
|
@@ -42103,8 +42103,8 @@ var require_state5 = __commonJS({
|
|
|
42103
42103
|
var hwm = highWaterMarkFrom(options, isDuplex, duplexKey);
|
|
42104
42104
|
if (hwm != null) {
|
|
42105
42105
|
if (!(isFinite(hwm) && Math.floor(hwm) === hwm) || hwm < 0) {
|
|
42106
|
-
var
|
|
42107
|
-
throw new ERR_INVALID_OPT_VALUE(
|
|
42106
|
+
var name12 = isDuplex ? duplexKey : "highWaterMark";
|
|
42107
|
+
throw new ERR_INVALID_OPT_VALUE(name12, hwm);
|
|
42108
42108
|
}
|
|
42109
42109
|
return Math.floor(hwm);
|
|
42110
42110
|
}
|
|
@@ -45388,8 +45388,8 @@ var require_regeneratorRuntime = __commonJS({
|
|
|
45388
45388
|
constructor: Context,
|
|
45389
45389
|
reset: function reset(skipTempReset) {
|
|
45390
45390
|
if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
|
|
45391
|
-
for (var
|
|
45392
|
-
|
|
45391
|
+
for (var name12 in this)
|
|
45392
|
+
name12.charAt(0) === "t" && hasOwn.call(this, name12) && !isNaN(+name12.slice(1)) && (this[name12] = void 0);
|
|
45393
45393
|
},
|
|
45394
45394
|
stop: function stop() {
|
|
45395
45395
|
this.done = true;
|
|
@@ -45517,9 +45517,9 @@ var require_geoid = __commonJS({
|
|
|
45517
45517
|
var stencilsize_ = 12;
|
|
45518
45518
|
var nterms_ = (3 + 1) * (3 + 2) / 2;
|
|
45519
45519
|
var PIXEL_SIZE = 2;
|
|
45520
|
-
var
|
|
45521
|
-
function
|
|
45522
|
-
(0, _classCallCheck2.default)(this,
|
|
45520
|
+
var Geoid2 = function() {
|
|
45521
|
+
function Geoid3(options) {
|
|
45522
|
+
(0, _classCallCheck2.default)(this, Geoid3);
|
|
45523
45523
|
(0, _defineProperty2.default)(this, "_v00", 0);
|
|
45524
45524
|
(0, _defineProperty2.default)(this, "_v01", 0);
|
|
45525
45525
|
(0, _defineProperty2.default)(this, "_v10", 0);
|
|
@@ -45532,7 +45532,7 @@ var require_geoid = __commonJS({
|
|
|
45532
45532
|
this._ix = this.options._width;
|
|
45533
45533
|
this._iy = this.options._height;
|
|
45534
45534
|
}
|
|
45535
|
-
(0, _createClass2.default)(
|
|
45535
|
+
(0, _createClass2.default)(Geoid3, [{
|
|
45536
45536
|
key: "getHeight",
|
|
45537
45537
|
value: function getHeight(lat, lon) {
|
|
45538
45538
|
lat = Math.abs(lat) > 90 ? NaN : lat;
|
|
@@ -45625,9 +45625,9 @@ var require_geoid = __commonJS({
|
|
|
45625
45625
|
return r;
|
|
45626
45626
|
}
|
|
45627
45627
|
}]);
|
|
45628
|
-
return
|
|
45628
|
+
return Geoid3;
|
|
45629
45629
|
}();
|
|
45630
|
-
exports.default =
|
|
45630
|
+
exports.default = Geoid2;
|
|
45631
45631
|
function remainder(x, y) {
|
|
45632
45632
|
y = Math.abs(y);
|
|
45633
45633
|
var z = fmod(x, y);
|
|
@@ -46752,9 +46752,9 @@ var WorkerThread = class {
|
|
|
46752
46752
|
constructor(props) {
|
|
46753
46753
|
this.terminated = false;
|
|
46754
46754
|
this._loadableURL = "";
|
|
46755
|
-
const { name:
|
|
46755
|
+
const { name: name12, source, url } = props;
|
|
46756
46756
|
assert3(source || url);
|
|
46757
|
-
this.name =
|
|
46757
|
+
this.name = name12;
|
|
46758
46758
|
this.source = source;
|
|
46759
46759
|
this.url = url;
|
|
46760
46760
|
this.onMessage = NOOP;
|
|
@@ -46871,9 +46871,9 @@ var WorkerPool = class {
|
|
|
46871
46871
|
this.onDebug = props.onDebug;
|
|
46872
46872
|
}
|
|
46873
46873
|
}
|
|
46874
|
-
async startJob(
|
|
46874
|
+
async startJob(name12, onMessage3 = (job, type, data) => job.done(data), onError = (job, error) => job.error(error)) {
|
|
46875
46875
|
const startPromise = new Promise((onStart) => {
|
|
46876
|
-
this.jobQueue.push({ name:
|
|
46876
|
+
this.jobQueue.push({ name: name12, onMessage: onMessage3, onError, onStart });
|
|
46877
46877
|
return this;
|
|
46878
46878
|
});
|
|
46879
46879
|
this._startQueuedJob();
|
|
@@ -46924,8 +46924,8 @@ var WorkerPool = class {
|
|
|
46924
46924
|
}
|
|
46925
46925
|
if (this.count < this._getMaxConcurrency()) {
|
|
46926
46926
|
this.count++;
|
|
46927
|
-
const
|
|
46928
|
-
return new WorkerThread({ name:
|
|
46927
|
+
const name12 = `${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;
|
|
46928
|
+
return new WorkerThread({ name: name12, source: this.source, url: this.url });
|
|
46929
46929
|
}
|
|
46930
46930
|
return null;
|
|
46931
46931
|
}
|
|
@@ -46970,16 +46970,16 @@ var WorkerFarm = class {
|
|
|
46970
46970
|
}
|
|
46971
46971
|
}
|
|
46972
46972
|
getWorkerPool(options) {
|
|
46973
|
-
const { name:
|
|
46974
|
-
let workerPool = this.workerPools.get(
|
|
46973
|
+
const { name: name12, source, url } = options;
|
|
46974
|
+
let workerPool = this.workerPools.get(name12);
|
|
46975
46975
|
if (!workerPool) {
|
|
46976
46976
|
workerPool = new WorkerPool({
|
|
46977
|
-
name:
|
|
46977
|
+
name: name12,
|
|
46978
46978
|
source,
|
|
46979
46979
|
url
|
|
46980
46980
|
});
|
|
46981
46981
|
workerPool.setProps(this._getWorkerPoolProps());
|
|
46982
|
-
this.workerPools.set(
|
|
46982
|
+
this.workerPools.set(name12, workerPool);
|
|
46983
46983
|
}
|
|
46984
46984
|
return workerPool;
|
|
46985
46985
|
}
|
|
@@ -47024,10 +47024,10 @@ function getWorkerURL(worker, options = {}) {
|
|
|
47024
47024
|
|
|
47025
47025
|
// ../worker-utils/src/lib/worker-api/process-on-worker.ts
|
|
47026
47026
|
async function processOnWorker(worker, data, options = {}, context = {}) {
|
|
47027
|
-
const
|
|
47027
|
+
const name12 = getWorkerName(worker);
|
|
47028
47028
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
47029
47029
|
const { source } = options;
|
|
47030
|
-
const workerPoolProps = { name:
|
|
47030
|
+
const workerPoolProps = { name: name12, source };
|
|
47031
47031
|
if (!source) {
|
|
47032
47032
|
workerPoolProps.url = getWorkerURL(worker, options);
|
|
47033
47033
|
}
|
|
@@ -47349,10 +47349,10 @@ function canParseWithWorker(loader, options) {
|
|
|
47349
47349
|
return loader.worker && options?.worker;
|
|
47350
47350
|
}
|
|
47351
47351
|
async function parseWithWorker(loader, data, options, context, parseOnMainThread) {
|
|
47352
|
-
const
|
|
47352
|
+
const name12 = loader.id;
|
|
47353
47353
|
const url = getWorkerURL(loader, options);
|
|
47354
47354
|
const workerFarm = WorkerFarm.getWorkerFarm(options);
|
|
47355
|
-
const workerPool = workerFarm.getWorkerPool({ name:
|
|
47355
|
+
const workerPool = workerFarm.getWorkerPool({ name: name12, url });
|
|
47356
47356
|
options = JSON.parse(JSON.stringify(options));
|
|
47357
47357
|
context = JSON.parse(JSON.stringify(context || {}));
|
|
47358
47358
|
const job = await workerPool.startJob("process-on-worker", onMessage2.bind(null, parseOnMainThread));
|
|
@@ -47861,37 +47861,20 @@ __export(fs_exports, {
|
|
|
47861
47861
|
writeFileSync: () => writeFileSync
|
|
47862
47862
|
});
|
|
47863
47863
|
var import_fs2 = __toModule(require("fs"));
|
|
47864
|
-
var readdir;
|
|
47865
|
-
var stat;
|
|
47866
|
-
var statSync;
|
|
47867
|
-
var readFile;
|
|
47868
|
-
var readFileSync;
|
|
47869
|
-
var writeFile;
|
|
47870
|
-
var writeFileSync;
|
|
47871
|
-
var open;
|
|
47872
|
-
var close;
|
|
47873
|
-
var read;
|
|
47874
|
-
var fstat;
|
|
47875
|
-
var createReadStream;
|
|
47876
|
-
var createWriteStream;
|
|
47864
|
+
var readdir = promisify2(import_fs2.default.readdir);
|
|
47865
|
+
var stat = promisify2(import_fs2.default.stat);
|
|
47866
|
+
var statSync = import_fs2.default.statSync;
|
|
47867
|
+
var readFile = import_fs2.default.readFile;
|
|
47868
|
+
var readFileSync = import_fs2.default.readFileSync;
|
|
47869
|
+
var writeFile = promisify3(import_fs2.default.writeFile);
|
|
47870
|
+
var writeFileSync = import_fs2.default.writeFileSync;
|
|
47871
|
+
var open = import_fs2.default.open;
|
|
47872
|
+
var close = (fd) => new Promise((resolve2, reject) => import_fs2.default.close(fd, (err) => err ? reject(err) : resolve2()));
|
|
47873
|
+
var read = import_fs2.default.read;
|
|
47874
|
+
var fstat = import_fs2.default.fstat;
|
|
47875
|
+
var createReadStream = import_fs2.default.createReadStream;
|
|
47876
|
+
var createWriteStream = import_fs2.default.createWriteStream;
|
|
47877
47877
|
var isSupported = Boolean(import_fs2.default);
|
|
47878
|
-
try {
|
|
47879
|
-
readdir = promisify2(import_fs2.default.readdir);
|
|
47880
|
-
stat = promisify2(import_fs2.default.stat);
|
|
47881
|
-
statSync = import_fs2.default.statSync;
|
|
47882
|
-
readFile = import_fs2.default.readFile;
|
|
47883
|
-
readFileSync = import_fs2.default.readFileSync;
|
|
47884
|
-
writeFile = promisify3(import_fs2.default.writeFile);
|
|
47885
|
-
writeFileSync = import_fs2.default.writeFileSync;
|
|
47886
|
-
open = import_fs2.default.open;
|
|
47887
|
-
close = (fd) => new Promise((resolve2, reject) => import_fs2.default.close(fd, (err) => err ? reject(err) : resolve2()));
|
|
47888
|
-
read = import_fs2.default.read;
|
|
47889
|
-
fstat = import_fs2.default.fstat;
|
|
47890
|
-
createReadStream = import_fs2.default.createReadStream;
|
|
47891
|
-
createWriteStream = import_fs2.default.createWriteStream;
|
|
47892
|
-
isSupported = Boolean(import_fs2.default);
|
|
47893
|
-
} catch {
|
|
47894
|
-
}
|
|
47895
47878
|
async function _readToArrayBuffer(fd, start, length) {
|
|
47896
47879
|
const buffer = Buffer.alloc(length);
|
|
47897
47880
|
const { bytesRead } = await read(fd, buffer, 0, length, start);
|
|
@@ -47901,6 +47884,99 @@ async function _readToArrayBuffer(fd, start, length) {
|
|
|
47901
47884
|
return toArrayBuffer(buffer);
|
|
47902
47885
|
}
|
|
47903
47886
|
|
|
47887
|
+
// ../loader-utils/src/lib/file-provider/file-provider.ts
|
|
47888
|
+
var isFileProvider = (fileProvider) => {
|
|
47889
|
+
return fileProvider?.getUint8 && fileProvider?.slice && fileProvider?.length;
|
|
47890
|
+
};
|
|
47891
|
+
|
|
47892
|
+
// ../loader-utils/src/lib/file-provider/file-handle.ts
|
|
47893
|
+
var import_fs3 = __toModule(require("fs"));
|
|
47894
|
+
var FileHandle = class {
|
|
47895
|
+
constructor(fileDescriptor, stats) {
|
|
47896
|
+
this.read = (buffer, offset, length, position) => {
|
|
47897
|
+
return new Promise((s) => {
|
|
47898
|
+
(0, import_fs3.read)(this.fileDescriptor, buffer, offset, length, position, (_err, bytesRead, buffer2) => s({ bytesRead, buffer: buffer2 }));
|
|
47899
|
+
});
|
|
47900
|
+
};
|
|
47901
|
+
this.fileDescriptor = fileDescriptor;
|
|
47902
|
+
this.stats = stats;
|
|
47903
|
+
}
|
|
47904
|
+
static async open(path2) {
|
|
47905
|
+
const [fd, stats] = await Promise.all([
|
|
47906
|
+
new Promise((resolve2, reject) => {
|
|
47907
|
+
(0, import_fs3.open)(path2, void 0, void 0, (_err, fd2) => _err ? reject(_err) : resolve2(fd2));
|
|
47908
|
+
}),
|
|
47909
|
+
new Promise((resolve2, reject) => {
|
|
47910
|
+
(0, import_fs3.stat)(path2, { bigint: true }, (_err, stats2) => _err ? reject(_err) : resolve2(stats2));
|
|
47911
|
+
})
|
|
47912
|
+
]);
|
|
47913
|
+
return new FileHandle(fd, stats);
|
|
47914
|
+
}
|
|
47915
|
+
async close() {
|
|
47916
|
+
return new Promise((resolve2) => {
|
|
47917
|
+
(0, import_fs3.close)(this.fileDescriptor, (_err) => resolve2());
|
|
47918
|
+
});
|
|
47919
|
+
}
|
|
47920
|
+
get stat() {
|
|
47921
|
+
return this.stats;
|
|
47922
|
+
}
|
|
47923
|
+
};
|
|
47924
|
+
|
|
47925
|
+
// ../loader-utils/src/lib/file-provider/file-handle-file.ts
|
|
47926
|
+
var FileHandleFile = class {
|
|
47927
|
+
static async from(path2) {
|
|
47928
|
+
path2 = resolvePath(path2);
|
|
47929
|
+
const fileDescriptor = await FileHandle.open(path2);
|
|
47930
|
+
return new FileHandleFile(fileDescriptor, fileDescriptor.stat.size);
|
|
47931
|
+
}
|
|
47932
|
+
constructor(fileDescriptor, size) {
|
|
47933
|
+
this.fileDescriptor = fileDescriptor;
|
|
47934
|
+
this.size = size;
|
|
47935
|
+
}
|
|
47936
|
+
async destroy() {
|
|
47937
|
+
await this.fileDescriptor.close();
|
|
47938
|
+
}
|
|
47939
|
+
async getUint8(offset) {
|
|
47940
|
+
const val = new Uint8Array((await this.fileDescriptor.read(Buffer.alloc(1), 0, 1, offset)).buffer.buffer).at(0);
|
|
47941
|
+
if (val === void 0) {
|
|
47942
|
+
throw new Error("something went wrong");
|
|
47943
|
+
}
|
|
47944
|
+
return val;
|
|
47945
|
+
}
|
|
47946
|
+
async getUint16(offset) {
|
|
47947
|
+
const val = new Uint16Array((await this.fileDescriptor.read(Buffer.alloc(2), 0, 2, offset)).buffer.buffer).at(0);
|
|
47948
|
+
if (val === void 0) {
|
|
47949
|
+
throw new Error("something went wrong");
|
|
47950
|
+
}
|
|
47951
|
+
return val;
|
|
47952
|
+
}
|
|
47953
|
+
async getUint32(offset) {
|
|
47954
|
+
const val = new Uint32Array((await this.fileDescriptor.read(Buffer.alloc(4), 0, 4, offset)).buffer.buffer).at(0);
|
|
47955
|
+
if (val === void 0) {
|
|
47956
|
+
throw new Error("something went wrong");
|
|
47957
|
+
}
|
|
47958
|
+
return val;
|
|
47959
|
+
}
|
|
47960
|
+
async getBigUint64(offset) {
|
|
47961
|
+
const val = new BigInt64Array((await this.fileDescriptor.read(Buffer.alloc(8), 0, 8, offset)).buffer.buffer).at(0);
|
|
47962
|
+
if (val === void 0) {
|
|
47963
|
+
throw new Error("something went wrong");
|
|
47964
|
+
}
|
|
47965
|
+
return val;
|
|
47966
|
+
}
|
|
47967
|
+
async slice(startOffsset, endOffset) {
|
|
47968
|
+
const bigLength = endOffset - startOffsset;
|
|
47969
|
+
if (bigLength > Number.MAX_SAFE_INTEGER) {
|
|
47970
|
+
throw new Error("too big slice");
|
|
47971
|
+
}
|
|
47972
|
+
const length = Number(bigLength);
|
|
47973
|
+
return (await this.fileDescriptor.read(Buffer.alloc(length), 0, length, startOffsset)).buffer.buffer;
|
|
47974
|
+
}
|
|
47975
|
+
get length() {
|
|
47976
|
+
return this.size;
|
|
47977
|
+
}
|
|
47978
|
+
};
|
|
47979
|
+
|
|
47904
47980
|
// ../core/src/javascript-utils/is-type.ts
|
|
47905
47981
|
var isBoolean = (x) => typeof x === "boolean";
|
|
47906
47982
|
var isFunction = (x) => typeof x === "function";
|
|
@@ -48304,7 +48380,7 @@ function autobind(obj) {
|
|
|
48304
48380
|
for (const key of propNames) {
|
|
48305
48381
|
const value = object[key];
|
|
48306
48382
|
if (typeof value === "function") {
|
|
48307
|
-
if (!predefined.find((
|
|
48383
|
+
if (!predefined.find((name12) => key === name12)) {
|
|
48308
48384
|
object[key] = value.bind(obj);
|
|
48309
48385
|
}
|
|
48310
48386
|
}
|
|
@@ -49625,11 +49701,11 @@ function getMeshBoundingBox(attributes) {
|
|
|
49625
49701
|
}
|
|
49626
49702
|
|
|
49627
49703
|
// ../schema/src/lib/mesh/deduce-mesh-schema.ts
|
|
49628
|
-
function deduceMeshField(
|
|
49704
|
+
function deduceMeshField(name12, attribute, optionalMetadata) {
|
|
49629
49705
|
const type = getDataTypeFromTypedArray(attribute.value);
|
|
49630
49706
|
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
49631
49707
|
return {
|
|
49632
|
-
name:
|
|
49708
|
+
name: name12,
|
|
49633
49709
|
type: { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] },
|
|
49634
49710
|
nullable: false,
|
|
49635
49711
|
metadata
|
|
@@ -50028,7 +50104,7 @@ function getUint32Array(dracoArray) {
|
|
|
50028
50104
|
}
|
|
50029
50105
|
|
|
50030
50106
|
// ../draco/src/lib/draco-module-loader.ts
|
|
50031
|
-
var DRACO_DECODER_VERSION = "1.5.
|
|
50107
|
+
var DRACO_DECODER_VERSION = "1.5.6";
|
|
50032
50108
|
var DRACO_ENCODER_VERSION = "1.4.1";
|
|
50033
50109
|
var STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
50034
50110
|
var DRACO_EXTERNAL_LIBRARIES = {
|
|
@@ -50169,8 +50245,8 @@ var GLType = class {
|
|
|
50169
50245
|
}
|
|
50170
50246
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
50171
50247
|
}
|
|
50172
|
-
static fromName(
|
|
50173
|
-
const glType = NAME_TO_GL_TYPE[
|
|
50248
|
+
static fromName(name12) {
|
|
50249
|
+
const glType = NAME_TO_GL_TYPE[name12];
|
|
50174
50250
|
if (!glType) {
|
|
50175
50251
|
throw new Error(ERR_TYPE_CONVERSION);
|
|
50176
50252
|
}
|
|
@@ -50257,6 +50333,11 @@ function octDecode(x, y, result) {
|
|
|
50257
50333
|
return octDecodeInRange(x, y, 255, result);
|
|
50258
50334
|
}
|
|
50259
50335
|
|
|
50336
|
+
// ../math/src/geometry/utils/coordinates.ts
|
|
50337
|
+
function emod(n) {
|
|
50338
|
+
return (n % 1 + 1) % 1;
|
|
50339
|
+
}
|
|
50340
|
+
|
|
50260
50341
|
// ../3d-tiles/src/lib/parsers/parse-3d-tile-point-cloud.ts
|
|
50261
50342
|
var import_core5 = __toModule(require_es5());
|
|
50262
50343
|
|
|
@@ -50682,10 +50763,10 @@ var Tile3DBatchTableParser = class {
|
|
|
50682
50763
|
}
|
|
50683
50764
|
return void 0;
|
|
50684
50765
|
}
|
|
50685
|
-
hasProperty(batchId,
|
|
50766
|
+
hasProperty(batchId, name12) {
|
|
50686
50767
|
this._checkBatchId(batchId);
|
|
50687
|
-
assert2(typeof
|
|
50688
|
-
return defined3(this._properties[
|
|
50768
|
+
assert2(typeof name12 === "string", name12);
|
|
50769
|
+
return defined3(this._properties[name12]) || this._hasPropertyInHierarchy(batchId, name12);
|
|
50689
50770
|
}
|
|
50690
50771
|
getPropertyNames(batchId, results) {
|
|
50691
50772
|
this._checkBatchId(batchId);
|
|
@@ -50698,47 +50779,47 @@ var Tile3DBatchTableParser = class {
|
|
|
50698
50779
|
}
|
|
50699
50780
|
return results;
|
|
50700
50781
|
}
|
|
50701
|
-
getProperty(batchId,
|
|
50782
|
+
getProperty(batchId, name12) {
|
|
50702
50783
|
this._checkBatchId(batchId);
|
|
50703
|
-
assert2(typeof
|
|
50784
|
+
assert2(typeof name12 === "string", name12);
|
|
50704
50785
|
if (this._binaryProperties) {
|
|
50705
|
-
const binaryProperty = this._binaryProperties[
|
|
50786
|
+
const binaryProperty = this._binaryProperties[name12];
|
|
50706
50787
|
if (defined3(binaryProperty)) {
|
|
50707
50788
|
return this._getBinaryProperty(binaryProperty, batchId);
|
|
50708
50789
|
}
|
|
50709
50790
|
}
|
|
50710
|
-
const propertyValues = this._properties[
|
|
50791
|
+
const propertyValues = this._properties[name12];
|
|
50711
50792
|
if (defined3(propertyValues)) {
|
|
50712
50793
|
return clone(propertyValues[batchId], true);
|
|
50713
50794
|
}
|
|
50714
50795
|
if (this._hierarchy) {
|
|
50715
|
-
const hierarchyProperty = this._getHierarchyProperty(batchId,
|
|
50796
|
+
const hierarchyProperty = this._getHierarchyProperty(batchId, name12);
|
|
50716
50797
|
if (defined3(hierarchyProperty)) {
|
|
50717
50798
|
return hierarchyProperty;
|
|
50718
50799
|
}
|
|
50719
50800
|
}
|
|
50720
50801
|
return void 0;
|
|
50721
50802
|
}
|
|
50722
|
-
setProperty(batchId,
|
|
50803
|
+
setProperty(batchId, name12, value) {
|
|
50723
50804
|
const featureCount = this.featureCount;
|
|
50724
50805
|
this._checkBatchId(batchId);
|
|
50725
|
-
assert2(typeof
|
|
50806
|
+
assert2(typeof name12 === "string", name12);
|
|
50726
50807
|
if (this._binaryProperties) {
|
|
50727
|
-
const binaryProperty = this._binaryProperties[
|
|
50808
|
+
const binaryProperty = this._binaryProperties[name12];
|
|
50728
50809
|
if (binaryProperty) {
|
|
50729
50810
|
this._setBinaryProperty(binaryProperty, batchId, value);
|
|
50730
50811
|
return;
|
|
50731
50812
|
}
|
|
50732
50813
|
}
|
|
50733
50814
|
if (this._hierarchy) {
|
|
50734
|
-
if (this._setHierarchyProperty(this, batchId,
|
|
50815
|
+
if (this._setHierarchyProperty(this, batchId, name12, value)) {
|
|
50735
50816
|
return;
|
|
50736
50817
|
}
|
|
50737
50818
|
}
|
|
50738
|
-
let propertyValues = this._properties[
|
|
50819
|
+
let propertyValues = this._properties[name12];
|
|
50739
50820
|
if (!defined3(propertyValues)) {
|
|
50740
|
-
this._properties[
|
|
50741
|
-
propertyValues = this._properties[
|
|
50821
|
+
this._properties[name12] = new Array(featureCount);
|
|
50822
|
+
propertyValues = this._properties[name12];
|
|
50742
50823
|
}
|
|
50743
50824
|
propertyValues[batchId] = clone(value, true);
|
|
50744
50825
|
}
|
|
@@ -50756,21 +50837,21 @@ var Tile3DBatchTableParser = class {
|
|
|
50756
50837
|
}
|
|
50757
50838
|
_initializeBinaryProperties() {
|
|
50758
50839
|
let binaryProperties = null;
|
|
50759
|
-
for (const
|
|
50760
|
-
const property = this._properties[
|
|
50761
|
-
const binaryProperty = this._initializeBinaryProperty(
|
|
50840
|
+
for (const name12 in this._properties) {
|
|
50841
|
+
const property = this._properties[name12];
|
|
50842
|
+
const binaryProperty = this._initializeBinaryProperty(name12, property);
|
|
50762
50843
|
if (binaryProperty) {
|
|
50763
50844
|
binaryProperties = binaryProperties || {};
|
|
50764
|
-
binaryProperties[
|
|
50845
|
+
binaryProperties[name12] = binaryProperty;
|
|
50765
50846
|
}
|
|
50766
50847
|
}
|
|
50767
50848
|
return binaryProperties;
|
|
50768
50849
|
}
|
|
50769
|
-
_initializeBinaryProperty(
|
|
50850
|
+
_initializeBinaryProperty(name12, property) {
|
|
50770
50851
|
if ("byteOffset" in property) {
|
|
50771
50852
|
const tile3DAccessor = property;
|
|
50772
|
-
assert2(this.binary, `Property ${
|
|
50773
|
-
assert2(tile3DAccessor.type, `Property ${
|
|
50853
|
+
assert2(this.binary, `Property ${name12} requires a batch table binary.`);
|
|
50854
|
+
assert2(tile3DAccessor.type, `Property ${name12} requires a type.`);
|
|
50774
50855
|
const accessor = createTypedArrayFromAccessor(tile3DAccessor, this.binary.buffer, this.binary.byteOffset | 0, this.featureCount);
|
|
50775
50856
|
return {
|
|
50776
50857
|
typedArray: accessor.values,
|
|
@@ -50781,14 +50862,14 @@ var Tile3DBatchTableParser = class {
|
|
|
50781
50862
|
}
|
|
50782
50863
|
return null;
|
|
50783
50864
|
}
|
|
50784
|
-
_hasPropertyInHierarchy(batchId,
|
|
50865
|
+
_hasPropertyInHierarchy(batchId, name12) {
|
|
50785
50866
|
if (!this._hierarchy) {
|
|
50786
50867
|
return false;
|
|
50787
50868
|
}
|
|
50788
50869
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
50789
50870
|
const classId = hierarchy.classIds[instanceIndex];
|
|
50790
50871
|
const instances = hierarchy.classes[classId].instances;
|
|
50791
|
-
return defined3(instances[
|
|
50872
|
+
return defined3(instances[name12]);
|
|
50792
50873
|
});
|
|
50793
50874
|
return defined3(result);
|
|
50794
50875
|
}
|
|
@@ -50796,21 +50877,21 @@ var Tile3DBatchTableParser = class {
|
|
|
50796
50877
|
traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
50797
50878
|
const classId = hierarchy.classIds[instanceIndex];
|
|
50798
50879
|
const instances = hierarchy.classes[classId].instances;
|
|
50799
|
-
for (const
|
|
50800
|
-
if (instances.hasOwnProperty(
|
|
50801
|
-
if (results.indexOf(
|
|
50802
|
-
results.push(
|
|
50880
|
+
for (const name12 in instances) {
|
|
50881
|
+
if (instances.hasOwnProperty(name12)) {
|
|
50882
|
+
if (results.indexOf(name12) === -1) {
|
|
50883
|
+
results.push(name12);
|
|
50803
50884
|
}
|
|
50804
50885
|
}
|
|
50805
50886
|
}
|
|
50806
50887
|
});
|
|
50807
50888
|
}
|
|
50808
|
-
_getHierarchyProperty(batchId,
|
|
50889
|
+
_getHierarchyProperty(batchId, name12) {
|
|
50809
50890
|
return traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
50810
50891
|
const classId = hierarchy.classIds[instanceIndex];
|
|
50811
50892
|
const instanceClass = hierarchy.classes[classId];
|
|
50812
50893
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
50813
|
-
const propertyValues = instanceClass.instances[
|
|
50894
|
+
const propertyValues = instanceClass.instances[name12];
|
|
50814
50895
|
if (defined3(propertyValues)) {
|
|
50815
50896
|
if (defined3(propertyValues.typedArray)) {
|
|
50816
50897
|
return this._getBinaryProperty(propertyValues, indexInClass);
|
|
@@ -50820,14 +50901,14 @@ var Tile3DBatchTableParser = class {
|
|
|
50820
50901
|
return null;
|
|
50821
50902
|
});
|
|
50822
50903
|
}
|
|
50823
|
-
_setHierarchyProperty(batchTable, batchId,
|
|
50904
|
+
_setHierarchyProperty(batchTable, batchId, name12, value) {
|
|
50824
50905
|
const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
|
|
50825
50906
|
const classId = hierarchy.classIds[instanceIndex];
|
|
50826
50907
|
const instanceClass = hierarchy.classes[classId];
|
|
50827
50908
|
const indexInClass = hierarchy.classIndexes[instanceIndex];
|
|
50828
|
-
const propertyValues = instanceClass.instances[
|
|
50909
|
+
const propertyValues = instanceClass.instances[name12];
|
|
50829
50910
|
if (defined3(propertyValues)) {
|
|
50830
|
-
assert2(instanceIndex === batchId, `Inherited property "${
|
|
50911
|
+
assert2(instanceIndex === batchId, `Inherited property "${name12}" is read-only.`);
|
|
50831
50912
|
if (defined3(propertyValues.typedArray)) {
|
|
50832
50913
|
this._setBinaryProperty(propertyValues, indexInClass, value);
|
|
50833
50914
|
} else {
|
|
@@ -51244,11 +51325,15 @@ async function loadDraco(tile, dracoData, options, context) {
|
|
|
51244
51325
|
};
|
|
51245
51326
|
}
|
|
51246
51327
|
|
|
51247
|
-
// ../gltf/src/lib/
|
|
51248
|
-
var
|
|
51328
|
+
// ../gltf/src/lib/extensions/EXT_mesh_features.ts
|
|
51329
|
+
var EXT_mesh_features_exports = {};
|
|
51330
|
+
__export(EXT_mesh_features_exports, {
|
|
51331
|
+
decode: () => decode2,
|
|
51332
|
+
name: () => name2
|
|
51333
|
+
});
|
|
51249
51334
|
|
|
51250
51335
|
// ../images/src/lib/utils/version.ts
|
|
51251
|
-
var
|
|
51336
|
+
var VERSION8 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
51252
51337
|
|
|
51253
51338
|
// ../images/src/lib/category-api/image-type.ts
|
|
51254
51339
|
var { _parseImageNode } = globalThis;
|
|
@@ -51639,7 +51724,7 @@ var ImageLoader = {
|
|
|
51639
51724
|
id: "image",
|
|
51640
51725
|
module: "images",
|
|
51641
51726
|
name: "Images",
|
|
51642
|
-
version:
|
|
51727
|
+
version: VERSION8,
|
|
51643
51728
|
mimeTypes: MIME_TYPES,
|
|
51644
51729
|
extensions: EXTENSIONS,
|
|
51645
51730
|
parse: parseImage,
|
|
@@ -51702,7 +51787,7 @@ var ImageWriter = {
|
|
|
51702
51787
|
name: "Images",
|
|
51703
51788
|
id: "image",
|
|
51704
51789
|
module: "images",
|
|
51705
|
-
version:
|
|
51790
|
+
version: VERSION8,
|
|
51706
51791
|
extensions: ["jpeg"],
|
|
51707
51792
|
options: {
|
|
51708
51793
|
image: {
|
|
@@ -51746,6 +51831,1248 @@ function testBrowserImageFormatSupport(mimeType) {
|
|
|
51746
51831
|
}
|
|
51747
51832
|
}
|
|
51748
51833
|
|
|
51834
|
+
// ../gltf/src/lib/utils/assert.ts
|
|
51835
|
+
function assert6(condition, message) {
|
|
51836
|
+
if (!condition) {
|
|
51837
|
+
throw new Error(message || "assert failed: gltf");
|
|
51838
|
+
}
|
|
51839
|
+
}
|
|
51840
|
+
|
|
51841
|
+
// ../gltf/src/lib/gltf-utils/gltf-utils.ts
|
|
51842
|
+
var MIPMAP_FACTOR = 1.33;
|
|
51843
|
+
var TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
|
|
51844
|
+
var ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
|
|
51845
|
+
[Int8Array, 5120],
|
|
51846
|
+
[Uint8Array, 5121],
|
|
51847
|
+
[Int16Array, 5122],
|
|
51848
|
+
[Uint16Array, 5123],
|
|
51849
|
+
[Uint32Array, 5125],
|
|
51850
|
+
[Float32Array, 5126],
|
|
51851
|
+
[Float64Array, 5130]
|
|
51852
|
+
];
|
|
51853
|
+
var ARRAY_TO_COMPONENT_TYPE = new Map(ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT);
|
|
51854
|
+
var ATTRIBUTE_TYPE_TO_COMPONENTS = {
|
|
51855
|
+
SCALAR: 1,
|
|
51856
|
+
VEC2: 2,
|
|
51857
|
+
VEC3: 3,
|
|
51858
|
+
VEC4: 4,
|
|
51859
|
+
MAT2: 4,
|
|
51860
|
+
MAT3: 9,
|
|
51861
|
+
MAT4: 16
|
|
51862
|
+
};
|
|
51863
|
+
var ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE = {
|
|
51864
|
+
5120: 1,
|
|
51865
|
+
5121: 1,
|
|
51866
|
+
5122: 2,
|
|
51867
|
+
5123: 2,
|
|
51868
|
+
5125: 4,
|
|
51869
|
+
5126: 4
|
|
51870
|
+
};
|
|
51871
|
+
var ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY = {
|
|
51872
|
+
5120: Int8Array,
|
|
51873
|
+
5121: Uint8Array,
|
|
51874
|
+
5122: Int16Array,
|
|
51875
|
+
5123: Uint16Array,
|
|
51876
|
+
5125: Uint32Array,
|
|
51877
|
+
5126: Float32Array
|
|
51878
|
+
};
|
|
51879
|
+
function getAccessorTypeFromSize(size) {
|
|
51880
|
+
const type = TYPES[size - 1];
|
|
51881
|
+
return type || TYPES[0];
|
|
51882
|
+
}
|
|
51883
|
+
function getComponentTypeFromArray(typedArray) {
|
|
51884
|
+
const componentType = ARRAY_TO_COMPONENT_TYPE.get(typedArray.constructor);
|
|
51885
|
+
if (!componentType) {
|
|
51886
|
+
throw new Error("Illegal typed array");
|
|
51887
|
+
}
|
|
51888
|
+
return componentType;
|
|
51889
|
+
}
|
|
51890
|
+
function getAccessorArrayTypeAndLength(accessor, bufferView) {
|
|
51891
|
+
const ArrayType = ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY[accessor.componentType];
|
|
51892
|
+
const components = ATTRIBUTE_TYPE_TO_COMPONENTS[accessor.type];
|
|
51893
|
+
const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
|
|
51894
|
+
const length = accessor.count * components;
|
|
51895
|
+
const byteLength = accessor.count * components * bytesPerComponent;
|
|
51896
|
+
assert6(byteLength >= 0 && byteLength <= bufferView.byteLength);
|
|
51897
|
+
return { ArrayType, length, byteLength };
|
|
51898
|
+
}
|
|
51899
|
+
function getMemoryUsageGLTF(gltf) {
|
|
51900
|
+
let { images, bufferViews } = gltf;
|
|
51901
|
+
images = images || [];
|
|
51902
|
+
bufferViews = bufferViews || [];
|
|
51903
|
+
const imageBufferViews = images.map((i) => i.bufferView);
|
|
51904
|
+
bufferViews = bufferViews.filter((view) => !imageBufferViews.includes(view));
|
|
51905
|
+
const bufferMemory = bufferViews.reduce((acc, view) => acc + view.byteLength, 0);
|
|
51906
|
+
const pixelCount = images.reduce((acc, image) => {
|
|
51907
|
+
const { width, height } = image.image;
|
|
51908
|
+
return acc + width * height;
|
|
51909
|
+
}, 0);
|
|
51910
|
+
return bufferMemory + Math.ceil(4 * pixelCount * MIPMAP_FACTOR);
|
|
51911
|
+
}
|
|
51912
|
+
|
|
51913
|
+
// ../gltf/src/lib/api/gltf-scenegraph.ts
|
|
51914
|
+
function makeDefaultGLTFJson() {
|
|
51915
|
+
return {
|
|
51916
|
+
asset: {
|
|
51917
|
+
version: "2.0",
|
|
51918
|
+
generator: "loaders.gl"
|
|
51919
|
+
},
|
|
51920
|
+
buffers: [],
|
|
51921
|
+
extensions: {},
|
|
51922
|
+
extensionsRequired: [],
|
|
51923
|
+
extensionsUsed: []
|
|
51924
|
+
};
|
|
51925
|
+
}
|
|
51926
|
+
var GLTFScenegraph = class {
|
|
51927
|
+
constructor(gltf) {
|
|
51928
|
+
this.gltf = {
|
|
51929
|
+
json: gltf?.json || makeDefaultGLTFJson(),
|
|
51930
|
+
buffers: gltf?.buffers || [],
|
|
51931
|
+
images: gltf?.images || []
|
|
51932
|
+
};
|
|
51933
|
+
this.sourceBuffers = [];
|
|
51934
|
+
this.byteLength = 0;
|
|
51935
|
+
if (this.gltf.buffers && this.gltf.buffers[0]) {
|
|
51936
|
+
this.byteLength = this.gltf.buffers[0].byteLength;
|
|
51937
|
+
this.sourceBuffers = [this.gltf.buffers[0]];
|
|
51938
|
+
}
|
|
51939
|
+
}
|
|
51940
|
+
get json() {
|
|
51941
|
+
return this.gltf.json;
|
|
51942
|
+
}
|
|
51943
|
+
getApplicationData(key) {
|
|
51944
|
+
const data = this.json[key];
|
|
51945
|
+
return data;
|
|
51946
|
+
}
|
|
51947
|
+
getExtraData(key) {
|
|
51948
|
+
const extras = this.json.extras || {};
|
|
51949
|
+
return extras[key];
|
|
51950
|
+
}
|
|
51951
|
+
hasExtension(extensionName) {
|
|
51952
|
+
const isUsedExtension = this.getUsedExtensions().find((name12) => name12 === extensionName);
|
|
51953
|
+
const isRequiredExtension = this.getRequiredExtensions().find((name12) => name12 === extensionName);
|
|
51954
|
+
return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
|
|
51955
|
+
}
|
|
51956
|
+
getExtension(extensionName) {
|
|
51957
|
+
const isExtension = this.getUsedExtensions().find((name12) => name12 === extensionName);
|
|
51958
|
+
const extensions = this.json.extensions || {};
|
|
51959
|
+
return isExtension ? extensions[extensionName] : null;
|
|
51960
|
+
}
|
|
51961
|
+
getRequiredExtension(extensionName) {
|
|
51962
|
+
const isRequired = this.getRequiredExtensions().find((name12) => name12 === extensionName);
|
|
51963
|
+
return isRequired ? this.getExtension(extensionName) : null;
|
|
51964
|
+
}
|
|
51965
|
+
getRequiredExtensions() {
|
|
51966
|
+
return this.json.extensionsRequired || [];
|
|
51967
|
+
}
|
|
51968
|
+
getUsedExtensions() {
|
|
51969
|
+
return this.json.extensionsUsed || [];
|
|
51970
|
+
}
|
|
51971
|
+
getRemovedExtensions() {
|
|
51972
|
+
return this.json.extensionsRemoved || [];
|
|
51973
|
+
}
|
|
51974
|
+
getObjectExtension(object, extensionName) {
|
|
51975
|
+
const extensions = object.extensions || {};
|
|
51976
|
+
return extensions[extensionName];
|
|
51977
|
+
}
|
|
51978
|
+
getScene(index) {
|
|
51979
|
+
return this.getObject("scenes", index);
|
|
51980
|
+
}
|
|
51981
|
+
getNode(index) {
|
|
51982
|
+
return this.getObject("nodes", index);
|
|
51983
|
+
}
|
|
51984
|
+
getSkin(index) {
|
|
51985
|
+
return this.getObject("skins", index);
|
|
51986
|
+
}
|
|
51987
|
+
getMesh(index) {
|
|
51988
|
+
return this.getObject("meshes", index);
|
|
51989
|
+
}
|
|
51990
|
+
getMaterial(index) {
|
|
51991
|
+
return this.getObject("materials", index);
|
|
51992
|
+
}
|
|
51993
|
+
getAccessor(index) {
|
|
51994
|
+
return this.getObject("accessors", index);
|
|
51995
|
+
}
|
|
51996
|
+
getTexture(index) {
|
|
51997
|
+
return this.getObject("textures", index);
|
|
51998
|
+
}
|
|
51999
|
+
getSampler(index) {
|
|
52000
|
+
return this.getObject("samplers", index);
|
|
52001
|
+
}
|
|
52002
|
+
getImage(index) {
|
|
52003
|
+
return this.getObject("images", index);
|
|
52004
|
+
}
|
|
52005
|
+
getBufferView(index) {
|
|
52006
|
+
return this.getObject("bufferViews", index);
|
|
52007
|
+
}
|
|
52008
|
+
getBuffer(index) {
|
|
52009
|
+
return this.getObject("buffers", index);
|
|
52010
|
+
}
|
|
52011
|
+
getObject(array, index) {
|
|
52012
|
+
if (typeof index === "object") {
|
|
52013
|
+
return index;
|
|
52014
|
+
}
|
|
52015
|
+
const object = this.json[array] && this.json[array][index];
|
|
52016
|
+
if (!object) {
|
|
52017
|
+
throw new Error(`glTF file error: Could not find ${array}[${index}]`);
|
|
52018
|
+
}
|
|
52019
|
+
return object;
|
|
52020
|
+
}
|
|
52021
|
+
getTypedArrayForBufferView(bufferView) {
|
|
52022
|
+
bufferView = this.getBufferView(bufferView);
|
|
52023
|
+
const bufferIndex = bufferView.buffer;
|
|
52024
|
+
const binChunk = this.gltf.buffers[bufferIndex];
|
|
52025
|
+
assert6(binChunk);
|
|
52026
|
+
const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
|
|
52027
|
+
return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
|
|
52028
|
+
}
|
|
52029
|
+
getTypedArrayForAccessor(accessor) {
|
|
52030
|
+
accessor = this.getAccessor(accessor);
|
|
52031
|
+
const bufferView = this.getBufferView(accessor.bufferView);
|
|
52032
|
+
const buffer = this.getBuffer(bufferView.buffer);
|
|
52033
|
+
const arrayBuffer = buffer.data;
|
|
52034
|
+
const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
|
|
52035
|
+
const byteOffset = bufferView.byteOffset + accessor.byteOffset;
|
|
52036
|
+
return new ArrayType(arrayBuffer, byteOffset, length);
|
|
52037
|
+
}
|
|
52038
|
+
getTypedArrayForImageData(image) {
|
|
52039
|
+
image = this.getAccessor(image);
|
|
52040
|
+
const bufferView = this.getBufferView(image.bufferView);
|
|
52041
|
+
const buffer = this.getBuffer(bufferView.buffer);
|
|
52042
|
+
const arrayBuffer = buffer.data;
|
|
52043
|
+
const byteOffset = bufferView.byteOffset || 0;
|
|
52044
|
+
return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);
|
|
52045
|
+
}
|
|
52046
|
+
addApplicationData(key, data) {
|
|
52047
|
+
this.json[key] = data;
|
|
52048
|
+
return this;
|
|
52049
|
+
}
|
|
52050
|
+
addExtraData(key, data) {
|
|
52051
|
+
this.json.extras = this.json.extras || {};
|
|
52052
|
+
this.json.extras[key] = data;
|
|
52053
|
+
return this;
|
|
52054
|
+
}
|
|
52055
|
+
addObjectExtension(object, extensionName, data) {
|
|
52056
|
+
object.extensions = object.extensions || {};
|
|
52057
|
+
object.extensions[extensionName] = data;
|
|
52058
|
+
this.registerUsedExtension(extensionName);
|
|
52059
|
+
return this;
|
|
52060
|
+
}
|
|
52061
|
+
setObjectExtension(object, extensionName, data) {
|
|
52062
|
+
const extensions = object.extensions || {};
|
|
52063
|
+
extensions[extensionName] = data;
|
|
52064
|
+
}
|
|
52065
|
+
removeObjectExtension(object, extensionName) {
|
|
52066
|
+
const extensions = object?.extensions || {};
|
|
52067
|
+
if (extensions[extensionName]) {
|
|
52068
|
+
this.json.extensionsRemoved = this.json.extensionsRemoved || [];
|
|
52069
|
+
const extensionsRemoved = this.json.extensionsRemoved;
|
|
52070
|
+
if (!extensionsRemoved.includes(extensionName)) {
|
|
52071
|
+
extensionsRemoved.push(extensionName);
|
|
52072
|
+
}
|
|
52073
|
+
}
|
|
52074
|
+
delete extensions[extensionName];
|
|
52075
|
+
}
|
|
52076
|
+
addExtension(extensionName, extensionData = {}) {
|
|
52077
|
+
assert6(extensionData);
|
|
52078
|
+
this.json.extensions = this.json.extensions || {};
|
|
52079
|
+
this.json.extensions[extensionName] = extensionData;
|
|
52080
|
+
this.registerUsedExtension(extensionName);
|
|
52081
|
+
return extensionData;
|
|
52082
|
+
}
|
|
52083
|
+
addRequiredExtension(extensionName, extensionData = {}) {
|
|
52084
|
+
assert6(extensionData);
|
|
52085
|
+
this.addExtension(extensionName, extensionData);
|
|
52086
|
+
this.registerRequiredExtension(extensionName);
|
|
52087
|
+
return extensionData;
|
|
52088
|
+
}
|
|
52089
|
+
registerUsedExtension(extensionName) {
|
|
52090
|
+
this.json.extensionsUsed = this.json.extensionsUsed || [];
|
|
52091
|
+
if (!this.json.extensionsUsed.find((ext) => ext === extensionName)) {
|
|
52092
|
+
this.json.extensionsUsed.push(extensionName);
|
|
52093
|
+
}
|
|
52094
|
+
}
|
|
52095
|
+
registerRequiredExtension(extensionName) {
|
|
52096
|
+
this.registerUsedExtension(extensionName);
|
|
52097
|
+
this.json.extensionsRequired = this.json.extensionsRequired || [];
|
|
52098
|
+
if (!this.json.extensionsRequired.find((ext) => ext === extensionName)) {
|
|
52099
|
+
this.json.extensionsRequired.push(extensionName);
|
|
52100
|
+
}
|
|
52101
|
+
}
|
|
52102
|
+
removeExtension(extensionName) {
|
|
52103
|
+
if (this.json.extensions?.[extensionName]) {
|
|
52104
|
+
this.json.extensionsRemoved = this.json.extensionsRemoved || [];
|
|
52105
|
+
const extensionsRemoved = this.json.extensionsRemoved;
|
|
52106
|
+
if (!extensionsRemoved.includes(extensionName)) {
|
|
52107
|
+
extensionsRemoved.push(extensionName);
|
|
52108
|
+
}
|
|
52109
|
+
}
|
|
52110
|
+
if (this.json.extensions) {
|
|
52111
|
+
delete this.json.extensions[extensionName];
|
|
52112
|
+
}
|
|
52113
|
+
if (this.json.extensionsRequired) {
|
|
52114
|
+
this._removeStringFromArray(this.json.extensionsRequired, extensionName);
|
|
52115
|
+
}
|
|
52116
|
+
if (this.json.extensionsUsed) {
|
|
52117
|
+
this._removeStringFromArray(this.json.extensionsUsed, extensionName);
|
|
52118
|
+
}
|
|
52119
|
+
}
|
|
52120
|
+
setDefaultScene(sceneIndex) {
|
|
52121
|
+
this.json.scene = sceneIndex;
|
|
52122
|
+
}
|
|
52123
|
+
addScene(scene) {
|
|
52124
|
+
const { nodeIndices } = scene;
|
|
52125
|
+
this.json.scenes = this.json.scenes || [];
|
|
52126
|
+
this.json.scenes.push({ nodes: nodeIndices });
|
|
52127
|
+
return this.json.scenes.length - 1;
|
|
52128
|
+
}
|
|
52129
|
+
addNode(node2) {
|
|
52130
|
+
const { meshIndex, matrix } = node2;
|
|
52131
|
+
this.json.nodes = this.json.nodes || [];
|
|
52132
|
+
const nodeData = { mesh: meshIndex };
|
|
52133
|
+
if (matrix) {
|
|
52134
|
+
nodeData.matrix = matrix;
|
|
52135
|
+
}
|
|
52136
|
+
this.json.nodes.push(nodeData);
|
|
52137
|
+
return this.json.nodes.length - 1;
|
|
52138
|
+
}
|
|
52139
|
+
addMesh(mesh) {
|
|
52140
|
+
const { attributes, indices, material, mode = 4 } = mesh;
|
|
52141
|
+
const accessors = this._addAttributes(attributes);
|
|
52142
|
+
const glTFMesh = {
|
|
52143
|
+
primitives: [
|
|
52144
|
+
{
|
|
52145
|
+
attributes: accessors,
|
|
52146
|
+
mode
|
|
52147
|
+
}
|
|
52148
|
+
]
|
|
52149
|
+
};
|
|
52150
|
+
if (indices) {
|
|
52151
|
+
const indicesAccessor = this._addIndices(indices);
|
|
52152
|
+
glTFMesh.primitives[0].indices = indicesAccessor;
|
|
52153
|
+
}
|
|
52154
|
+
if (Number.isFinite(material)) {
|
|
52155
|
+
glTFMesh.primitives[0].material = material;
|
|
52156
|
+
}
|
|
52157
|
+
this.json.meshes = this.json.meshes || [];
|
|
52158
|
+
this.json.meshes.push(glTFMesh);
|
|
52159
|
+
return this.json.meshes.length - 1;
|
|
52160
|
+
}
|
|
52161
|
+
addPointCloud(attributes) {
|
|
52162
|
+
const accessorIndices = this._addAttributes(attributes);
|
|
52163
|
+
const glTFMesh = {
|
|
52164
|
+
primitives: [
|
|
52165
|
+
{
|
|
52166
|
+
attributes: accessorIndices,
|
|
52167
|
+
mode: 0
|
|
52168
|
+
}
|
|
52169
|
+
]
|
|
52170
|
+
};
|
|
52171
|
+
this.json.meshes = this.json.meshes || [];
|
|
52172
|
+
this.json.meshes.push(glTFMesh);
|
|
52173
|
+
return this.json.meshes.length - 1;
|
|
52174
|
+
}
|
|
52175
|
+
addImage(imageData, mimeTypeOpt) {
|
|
52176
|
+
const metadata = getBinaryImageMetadata(imageData);
|
|
52177
|
+
const mimeType = mimeTypeOpt || metadata?.mimeType;
|
|
52178
|
+
const bufferViewIndex = this.addBufferView(imageData);
|
|
52179
|
+
const glTFImage = {
|
|
52180
|
+
bufferView: bufferViewIndex,
|
|
52181
|
+
mimeType
|
|
52182
|
+
};
|
|
52183
|
+
this.json.images = this.json.images || [];
|
|
52184
|
+
this.json.images.push(glTFImage);
|
|
52185
|
+
return this.json.images.length - 1;
|
|
52186
|
+
}
|
|
52187
|
+
addBufferView(buffer, bufferIndex = 0, byteOffset = this.byteLength) {
|
|
52188
|
+
const byteLength = buffer.byteLength;
|
|
52189
|
+
assert6(Number.isFinite(byteLength));
|
|
52190
|
+
this.sourceBuffers = this.sourceBuffers || [];
|
|
52191
|
+
this.sourceBuffers.push(buffer);
|
|
52192
|
+
const glTFBufferView = {
|
|
52193
|
+
buffer: bufferIndex,
|
|
52194
|
+
byteOffset,
|
|
52195
|
+
byteLength
|
|
52196
|
+
};
|
|
52197
|
+
this.byteLength += padToNBytes(byteLength, 4);
|
|
52198
|
+
this.json.bufferViews = this.json.bufferViews || [];
|
|
52199
|
+
this.json.bufferViews.push(glTFBufferView);
|
|
52200
|
+
return this.json.bufferViews.length - 1;
|
|
52201
|
+
}
|
|
52202
|
+
addAccessor(bufferViewIndex, accessor) {
|
|
52203
|
+
const glTFAccessor = {
|
|
52204
|
+
bufferView: bufferViewIndex,
|
|
52205
|
+
type: getAccessorTypeFromSize(accessor.size),
|
|
52206
|
+
componentType: accessor.componentType,
|
|
52207
|
+
count: accessor.count,
|
|
52208
|
+
max: accessor.max,
|
|
52209
|
+
min: accessor.min
|
|
52210
|
+
};
|
|
52211
|
+
this.json.accessors = this.json.accessors || [];
|
|
52212
|
+
this.json.accessors.push(glTFAccessor);
|
|
52213
|
+
return this.json.accessors.length - 1;
|
|
52214
|
+
}
|
|
52215
|
+
addBinaryBuffer(sourceBuffer, accessor = { size: 3 }) {
|
|
52216
|
+
const bufferViewIndex = this.addBufferView(sourceBuffer);
|
|
52217
|
+
let minMax = { min: accessor.min, max: accessor.max };
|
|
52218
|
+
if (!minMax.min || !minMax.max) {
|
|
52219
|
+
minMax = this._getAccessorMinMax(sourceBuffer, accessor.size);
|
|
52220
|
+
}
|
|
52221
|
+
const accessorDefaults = {
|
|
52222
|
+
size: accessor.size,
|
|
52223
|
+
componentType: getComponentTypeFromArray(sourceBuffer),
|
|
52224
|
+
count: Math.round(sourceBuffer.length / accessor.size),
|
|
52225
|
+
min: minMax.min,
|
|
52226
|
+
max: minMax.max
|
|
52227
|
+
};
|
|
52228
|
+
return this.addAccessor(bufferViewIndex, Object.assign(accessorDefaults, accessor));
|
|
52229
|
+
}
|
|
52230
|
+
addTexture(texture) {
|
|
52231
|
+
const { imageIndex } = texture;
|
|
52232
|
+
const glTFTexture = {
|
|
52233
|
+
source: imageIndex
|
|
52234
|
+
};
|
|
52235
|
+
this.json.textures = this.json.textures || [];
|
|
52236
|
+
this.json.textures.push(glTFTexture);
|
|
52237
|
+
return this.json.textures.length - 1;
|
|
52238
|
+
}
|
|
52239
|
+
addMaterial(pbrMaterialInfo) {
|
|
52240
|
+
this.json.materials = this.json.materials || [];
|
|
52241
|
+
this.json.materials.push(pbrMaterialInfo);
|
|
52242
|
+
return this.json.materials.length - 1;
|
|
52243
|
+
}
|
|
52244
|
+
createBinaryChunk() {
|
|
52245
|
+
this.gltf.buffers = [];
|
|
52246
|
+
const totalByteLength = this.byteLength;
|
|
52247
|
+
const arrayBuffer = new ArrayBuffer(totalByteLength);
|
|
52248
|
+
const targetArray = new Uint8Array(arrayBuffer);
|
|
52249
|
+
let dstByteOffset = 0;
|
|
52250
|
+
for (const sourceBuffer of this.sourceBuffers || []) {
|
|
52251
|
+
dstByteOffset = copyToArray(sourceBuffer, targetArray, dstByteOffset);
|
|
52252
|
+
}
|
|
52253
|
+
if (this.json?.buffers?.[0]) {
|
|
52254
|
+
this.json.buffers[0].byteLength = totalByteLength;
|
|
52255
|
+
} else {
|
|
52256
|
+
this.json.buffers = [{ byteLength: totalByteLength }];
|
|
52257
|
+
}
|
|
52258
|
+
this.gltf.binary = arrayBuffer;
|
|
52259
|
+
this.sourceBuffers = [arrayBuffer];
|
|
52260
|
+
}
|
|
52261
|
+
_removeStringFromArray(array, string) {
|
|
52262
|
+
let found = true;
|
|
52263
|
+
while (found) {
|
|
52264
|
+
const index = array.indexOf(string);
|
|
52265
|
+
if (index > -1) {
|
|
52266
|
+
array.splice(index, 1);
|
|
52267
|
+
} else {
|
|
52268
|
+
found = false;
|
|
52269
|
+
}
|
|
52270
|
+
}
|
|
52271
|
+
}
|
|
52272
|
+
_addAttributes(attributes = {}) {
|
|
52273
|
+
const result = {};
|
|
52274
|
+
for (const attributeKey in attributes) {
|
|
52275
|
+
const attributeData = attributes[attributeKey];
|
|
52276
|
+
const attrName = this._getGltfAttributeName(attributeKey);
|
|
52277
|
+
const accessor = this.addBinaryBuffer(attributeData.value, attributeData);
|
|
52278
|
+
result[attrName] = accessor;
|
|
52279
|
+
}
|
|
52280
|
+
return result;
|
|
52281
|
+
}
|
|
52282
|
+
_addIndices(indices) {
|
|
52283
|
+
return this.addBinaryBuffer(indices, { size: 1 });
|
|
52284
|
+
}
|
|
52285
|
+
_getGltfAttributeName(attributeName) {
|
|
52286
|
+
switch (attributeName.toLowerCase()) {
|
|
52287
|
+
case "position":
|
|
52288
|
+
case "positions":
|
|
52289
|
+
case "vertices":
|
|
52290
|
+
return "POSITION";
|
|
52291
|
+
case "normal":
|
|
52292
|
+
case "normals":
|
|
52293
|
+
return "NORMAL";
|
|
52294
|
+
case "color":
|
|
52295
|
+
case "colors":
|
|
52296
|
+
return "COLOR_0";
|
|
52297
|
+
case "texcoord":
|
|
52298
|
+
case "texcoords":
|
|
52299
|
+
return "TEXCOORD_0";
|
|
52300
|
+
default:
|
|
52301
|
+
return attributeName;
|
|
52302
|
+
}
|
|
52303
|
+
}
|
|
52304
|
+
_getAccessorMinMax(buffer, size) {
|
|
52305
|
+
const result = { min: null, max: null };
|
|
52306
|
+
if (buffer.length < size) {
|
|
52307
|
+
return result;
|
|
52308
|
+
}
|
|
52309
|
+
result.min = [];
|
|
52310
|
+
result.max = [];
|
|
52311
|
+
const initValues = buffer.subarray(0, size);
|
|
52312
|
+
for (const value of initValues) {
|
|
52313
|
+
result.min.push(value);
|
|
52314
|
+
result.max.push(value);
|
|
52315
|
+
}
|
|
52316
|
+
for (let index = size; index < buffer.length; index += size) {
|
|
52317
|
+
for (let componentIndex = 0; componentIndex < size; componentIndex++) {
|
|
52318
|
+
result.min[0 + componentIndex] = Math.min(result.min[0 + componentIndex], buffer[index + componentIndex]);
|
|
52319
|
+
result.max[0 + componentIndex] = Math.max(result.max[0 + componentIndex], buffer[index + componentIndex]);
|
|
52320
|
+
}
|
|
52321
|
+
}
|
|
52322
|
+
return result;
|
|
52323
|
+
}
|
|
52324
|
+
};
|
|
52325
|
+
|
|
52326
|
+
// ../gltf/src/lib/extensions/utils/3d-tiles-utils.ts
|
|
52327
|
+
var ATTRIBUTE_TYPE_TO_COMPONENTS2 = {
|
|
52328
|
+
SCALAR: 1,
|
|
52329
|
+
VEC2: 2,
|
|
52330
|
+
VEC3: 3,
|
|
52331
|
+
VEC4: 4,
|
|
52332
|
+
MAT2: 4,
|
|
52333
|
+
MAT3: 9,
|
|
52334
|
+
MAT4: 16,
|
|
52335
|
+
BOOLEAN: 1,
|
|
52336
|
+
STRING: 1,
|
|
52337
|
+
ENUM: 1
|
|
52338
|
+
};
|
|
52339
|
+
var ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY2 = {
|
|
52340
|
+
INT8: Int8Array,
|
|
52341
|
+
UINT8: Uint8Array,
|
|
52342
|
+
INT16: Int16Array,
|
|
52343
|
+
UINT16: Uint16Array,
|
|
52344
|
+
INT32: Int32Array,
|
|
52345
|
+
UINT32: Uint32Array,
|
|
52346
|
+
INT64: BigInt64Array,
|
|
52347
|
+
UINT64: BigUint64Array,
|
|
52348
|
+
FLOAT32: Float32Array,
|
|
52349
|
+
FLOAT64: Float64Array
|
|
52350
|
+
};
|
|
52351
|
+
var ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2 = {
|
|
52352
|
+
INT8: 1,
|
|
52353
|
+
UINT8: 1,
|
|
52354
|
+
INT16: 2,
|
|
52355
|
+
UINT16: 2,
|
|
52356
|
+
INT32: 4,
|
|
52357
|
+
UINT32: 4,
|
|
52358
|
+
INT64: 8,
|
|
52359
|
+
UINT64: 8,
|
|
52360
|
+
FLOAT32: 4,
|
|
52361
|
+
FLOAT64: 8
|
|
52362
|
+
};
|
|
52363
|
+
function getArrayElementByteSize(attributeType, componentType) {
|
|
52364
|
+
return ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2[componentType] * ATTRIBUTE_TYPE_TO_COMPONENTS2[attributeType];
|
|
52365
|
+
}
|
|
52366
|
+
function getOffsetsForProperty(scenegraph, bufferViewIndex, offsetType, numberOfElements) {
|
|
52367
|
+
if (offsetType !== "UINT8" && offsetType !== "UINT16" && offsetType !== "UINT32" && offsetType !== "UINT64") {
|
|
52368
|
+
return null;
|
|
52369
|
+
}
|
|
52370
|
+
const arrayOffsetsBytes = scenegraph.getTypedArrayForBufferView(bufferViewIndex);
|
|
52371
|
+
const arrayOffsets = convertRawBufferToMetadataArray(arrayOffsetsBytes, "SCALAR", offsetType, numberOfElements + 1);
|
|
52372
|
+
if (arrayOffsets instanceof BigInt64Array || arrayOffsets instanceof BigUint64Array) {
|
|
52373
|
+
return null;
|
|
52374
|
+
}
|
|
52375
|
+
return arrayOffsets;
|
|
52376
|
+
}
|
|
52377
|
+
function convertRawBufferToMetadataArray(data, attributeType, componentType, elementCount = 1) {
|
|
52378
|
+
const numberOfComponents = ATTRIBUTE_TYPE_TO_COMPONENTS2[attributeType];
|
|
52379
|
+
const ArrayType = ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY2[componentType];
|
|
52380
|
+
const size = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE2[componentType];
|
|
52381
|
+
const length = elementCount * numberOfComponents;
|
|
52382
|
+
const byteLength = length * size;
|
|
52383
|
+
let buffer = data.buffer;
|
|
52384
|
+
let offset = data.byteOffset;
|
|
52385
|
+
if (offset % size !== 0) {
|
|
52386
|
+
const bufferArray = new Uint8Array(buffer);
|
|
52387
|
+
buffer = bufferArray.slice(offset, offset + byteLength).buffer;
|
|
52388
|
+
offset = 0;
|
|
52389
|
+
}
|
|
52390
|
+
return new ArrayType(buffer, offset, length);
|
|
52391
|
+
}
|
|
52392
|
+
function getPrimitiveTextureData(scenegraph, textureInfo, primitive) {
|
|
52393
|
+
const json = scenegraph.gltf.json;
|
|
52394
|
+
const texCoordAccessorKey = `TEXCOORD_${textureInfo.texCoord || 0}`;
|
|
52395
|
+
const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
|
|
52396
|
+
const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);
|
|
52397
|
+
const texCoordArray = scenegraph.getTypedArrayForBufferView(texCoordBufferView);
|
|
52398
|
+
const textureCoordinates = new Float32Array(texCoordArray.buffer, texCoordArray.byteOffset, texCoordArray.length / 4);
|
|
52399
|
+
const textureIndex = textureInfo.index;
|
|
52400
|
+
const imageIndex = json.textures?.[textureIndex]?.source;
|
|
52401
|
+
if (typeof imageIndex !== "undefined") {
|
|
52402
|
+
const mimeType = json.images?.[imageIndex]?.mimeType;
|
|
52403
|
+
const parsedImage = scenegraph.gltf.images?.[imageIndex];
|
|
52404
|
+
if (parsedImage && typeof parsedImage.width !== "undefined") {
|
|
52405
|
+
const textureData = [];
|
|
52406
|
+
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
52407
|
+
const value = getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, textureInfo.channels);
|
|
52408
|
+
textureData.push(value);
|
|
52409
|
+
}
|
|
52410
|
+
return textureData;
|
|
52411
|
+
}
|
|
52412
|
+
}
|
|
52413
|
+
return null;
|
|
52414
|
+
}
|
|
52415
|
+
function primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive) {
|
|
52416
|
+
if (propertyData === null)
|
|
52417
|
+
return;
|
|
52418
|
+
const featureIndices = [];
|
|
52419
|
+
for (const texelData of propertyData) {
|
|
52420
|
+
let index = featureTable.findIndex((item) => item === texelData);
|
|
52421
|
+
if (index === -1) {
|
|
52422
|
+
index = featureTable.push(texelData) - 1;
|
|
52423
|
+
}
|
|
52424
|
+
featureIndices.push(index);
|
|
52425
|
+
}
|
|
52426
|
+
const typedArray = new Uint32Array(featureIndices);
|
|
52427
|
+
const bufferIndex = scenegraph.gltf.buffers.push({
|
|
52428
|
+
arrayBuffer: typedArray.buffer,
|
|
52429
|
+
byteOffset: typedArray.byteOffset,
|
|
52430
|
+
byteLength: typedArray.byteLength
|
|
52431
|
+
}) - 1;
|
|
52432
|
+
const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);
|
|
52433
|
+
const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {
|
|
52434
|
+
size: 1,
|
|
52435
|
+
componentType: getComponentTypeFromArray(typedArray),
|
|
52436
|
+
count: typedArray.length
|
|
52437
|
+
});
|
|
52438
|
+
primitive.attributes[attributeName] = accessorIndex;
|
|
52439
|
+
}
|
|
52440
|
+
function getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, channels = [0]) {
|
|
52441
|
+
const CHANNELS_MAP = [
|
|
52442
|
+
{ offset: 0, shift: 0 },
|
|
52443
|
+
{ offset: 1, shift: 8 },
|
|
52444
|
+
{ offset: 2, shift: 16 },
|
|
52445
|
+
{ offset: 3, shift: 24 }
|
|
52446
|
+
];
|
|
52447
|
+
const u = textureCoordinates[index];
|
|
52448
|
+
const v = textureCoordinates[index + 1];
|
|
52449
|
+
let components = 1;
|
|
52450
|
+
if (mimeType && (mimeType.indexOf("image/jpeg") !== -1 || mimeType.indexOf("image/png") !== -1))
|
|
52451
|
+
components = 4;
|
|
52452
|
+
const offset = coordinatesToOffset(u, v, parsedImage, components);
|
|
52453
|
+
let value = 0;
|
|
52454
|
+
for (const c of channels) {
|
|
52455
|
+
const map = CHANNELS_MAP[c];
|
|
52456
|
+
const imageOffset = offset + map.offset;
|
|
52457
|
+
const imageData = getImageData(parsedImage);
|
|
52458
|
+
if (imageData.data.length <= imageOffset) {
|
|
52459
|
+
throw new Error(`${imageData.data.length} <= ${imageOffset}`);
|
|
52460
|
+
}
|
|
52461
|
+
const imageValue = imageData.data[imageOffset];
|
|
52462
|
+
value |= imageValue << map.shift;
|
|
52463
|
+
}
|
|
52464
|
+
return value;
|
|
52465
|
+
}
|
|
52466
|
+
function coordinatesToOffset(u, v, parsedImage, componentsCount = 1) {
|
|
52467
|
+
const w = parsedImage.width;
|
|
52468
|
+
const iX = emod(u) * (w - 1);
|
|
52469
|
+
const indX = Math.round(iX);
|
|
52470
|
+
const h = parsedImage.height;
|
|
52471
|
+
const iY = emod(v) * (h - 1);
|
|
52472
|
+
const indY = Math.round(iY);
|
|
52473
|
+
const components = parsedImage.components ? parsedImage.components : componentsCount;
|
|
52474
|
+
const offset = (indY * w + indX) * components;
|
|
52475
|
+
return offset;
|
|
52476
|
+
}
|
|
52477
|
+
|
|
52478
|
+
// ../gltf/src/lib/extensions/EXT_structural_metadata.ts
|
|
52479
|
+
var EXT_structural_metadata_exports = {};
|
|
52480
|
+
__export(EXT_structural_metadata_exports, {
|
|
52481
|
+
decode: () => decode,
|
|
52482
|
+
getPropertyTablePopulated: () => getPropertyTablePopulated,
|
|
52483
|
+
name: () => name
|
|
52484
|
+
});
|
|
52485
|
+
var EXT_STRUCTURAL_METADATA_NAME = "EXT_structural_metadata";
|
|
52486
|
+
var name = EXT_STRUCTURAL_METADATA_NAME;
|
|
52487
|
+
async function decode(gltfData, options) {
|
|
52488
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
52489
|
+
decodeExtStructuralMetadata(scenegraph, options);
|
|
52490
|
+
}
|
|
52491
|
+
function getPropertyTablePopulated(scenegraph, propertyTableIndex) {
|
|
52492
|
+
const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
|
|
52493
|
+
const propertyTable = extension?.propertyTables?.[propertyTableIndex];
|
|
52494
|
+
if (extension?.schema && propertyTable) {
|
|
52495
|
+
processPropertyTable(scenegraph, extension.schema, propertyTable);
|
|
52496
|
+
return propertyTable;
|
|
52497
|
+
}
|
|
52498
|
+
throw new Error(`Incorrect data in the EXT_structural_metadata extension: no property table with index ${propertyTableIndex}`);
|
|
52499
|
+
}
|
|
52500
|
+
function decodeExtStructuralMetadata(scenegraph, options) {
|
|
52501
|
+
const extension = scenegraph.getExtension(EXT_STRUCTURAL_METADATA_NAME);
|
|
52502
|
+
if (!extension?.schema) {
|
|
52503
|
+
return;
|
|
52504
|
+
}
|
|
52505
|
+
const propertyTextures = extension.propertyTextures;
|
|
52506
|
+
const json = scenegraph.gltf.json;
|
|
52507
|
+
if (propertyTextures && json.meshes && options?.gltf?.loadImages) {
|
|
52508
|
+
for (const mesh of json.meshes) {
|
|
52509
|
+
for (const primitive of mesh.primitives) {
|
|
52510
|
+
processPrimitivePropertyTextures(scenegraph, propertyTextures, primitive, extension);
|
|
52511
|
+
}
|
|
52512
|
+
}
|
|
52513
|
+
}
|
|
52514
|
+
const schemaClasses = extension.schema.classes;
|
|
52515
|
+
const propertyTables = extension.propertyTables;
|
|
52516
|
+
if (schemaClasses && propertyTables) {
|
|
52517
|
+
for (const schemaName in schemaClasses) {
|
|
52518
|
+
const propertyTable = findPropertyTableByClass(propertyTables, schemaName);
|
|
52519
|
+
if (propertyTable) {
|
|
52520
|
+
processPropertyTable(scenegraph, extension.schema, propertyTable);
|
|
52521
|
+
}
|
|
52522
|
+
}
|
|
52523
|
+
}
|
|
52524
|
+
}
|
|
52525
|
+
function findPropertyTableByClass(propertyTables, schemaClassName) {
|
|
52526
|
+
for (let i = 0, len = propertyTables.length; i < len; i++) {
|
|
52527
|
+
const propertyTable = propertyTables[i];
|
|
52528
|
+
if (propertyTable.class === schemaClassName) {
|
|
52529
|
+
return propertyTable;
|
|
52530
|
+
}
|
|
52531
|
+
}
|
|
52532
|
+
return null;
|
|
52533
|
+
}
|
|
52534
|
+
function processPrimitivePropertyTextures(scenegraph, propertyTextures, primitive, extension) {
|
|
52535
|
+
if (!propertyTextures) {
|
|
52536
|
+
return;
|
|
52537
|
+
}
|
|
52538
|
+
const primitiveExtension = primitive.extensions?.[EXT_STRUCTURAL_METADATA_NAME];
|
|
52539
|
+
const primitivePropertyTextureIndices = primitiveExtension?.propertyTextures;
|
|
52540
|
+
if (!primitivePropertyTextureIndices) {
|
|
52541
|
+
return;
|
|
52542
|
+
}
|
|
52543
|
+
for (const primitivePropertyTextureIndex of primitivePropertyTextureIndices) {
|
|
52544
|
+
const propertyTexture = propertyTextures[primitivePropertyTextureIndex];
|
|
52545
|
+
processPrimitivePropertyTexture(scenegraph, propertyTexture, primitive, extension);
|
|
52546
|
+
}
|
|
52547
|
+
}
|
|
52548
|
+
function processPrimitivePropertyTexture(scenegraph, propertyTexture, primitive, extension) {
|
|
52549
|
+
if (!propertyTexture.properties) {
|
|
52550
|
+
return;
|
|
52551
|
+
}
|
|
52552
|
+
if (!extension.dataAttributeNames) {
|
|
52553
|
+
extension.dataAttributeNames = [];
|
|
52554
|
+
}
|
|
52555
|
+
const className = propertyTexture.class;
|
|
52556
|
+
for (const propName in propertyTexture.properties) {
|
|
52557
|
+
const attributeName = `${className}_${propName}`;
|
|
52558
|
+
const textureInfoTopLevel = propertyTexture.properties?.[propName];
|
|
52559
|
+
if (!textureInfoTopLevel) {
|
|
52560
|
+
continue;
|
|
52561
|
+
}
|
|
52562
|
+
if (!textureInfoTopLevel.data) {
|
|
52563
|
+
textureInfoTopLevel.data = [];
|
|
52564
|
+
}
|
|
52565
|
+
const featureTextureTable = textureInfoTopLevel.data;
|
|
52566
|
+
const propertyData = getPrimitiveTextureData(scenegraph, textureInfoTopLevel, primitive);
|
|
52567
|
+
if (propertyData === null) {
|
|
52568
|
+
continue;
|
|
52569
|
+
}
|
|
52570
|
+
primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTextureTable, primitive);
|
|
52571
|
+
textureInfoTopLevel.data = featureTextureTable;
|
|
52572
|
+
extension.dataAttributeNames.push(attributeName);
|
|
52573
|
+
}
|
|
52574
|
+
}
|
|
52575
|
+
function processPropertyTable(scenegraph, schema, propertyTable) {
|
|
52576
|
+
const schemaClass = schema.classes?.[propertyTable.class];
|
|
52577
|
+
if (!schemaClass) {
|
|
52578
|
+
throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${propertyTable.class}`);
|
|
52579
|
+
}
|
|
52580
|
+
const numberOfElements = propertyTable.count;
|
|
52581
|
+
for (const propertyName in schemaClass.properties) {
|
|
52582
|
+
const classProperty = schemaClass.properties[propertyName];
|
|
52583
|
+
const propertyTableProperty = propertyTable.properties?.[propertyName];
|
|
52584
|
+
if (propertyTableProperty) {
|
|
52585
|
+
const data = getPropertyDataFromBinarySource(scenegraph, schema, classProperty, numberOfElements, propertyTableProperty);
|
|
52586
|
+
propertyTableProperty.data = data;
|
|
52587
|
+
}
|
|
52588
|
+
}
|
|
52589
|
+
}
|
|
52590
|
+
function getPropertyDataFromBinarySource(scenegraph, schema, classProperty, numberOfElements, propertyTableProperty) {
|
|
52591
|
+
let data = [];
|
|
52592
|
+
const valuesBufferView = propertyTableProperty.values;
|
|
52593
|
+
const valuesDataBytes = scenegraph.getTypedArrayForBufferView(valuesBufferView);
|
|
52594
|
+
const arrayOffsets = getArrayOffsetsForProperty(scenegraph, classProperty, propertyTableProperty, numberOfElements);
|
|
52595
|
+
const stringOffsets = getStringOffsetsForProperty(scenegraph, propertyTableProperty, numberOfElements);
|
|
52596
|
+
switch (classProperty.type) {
|
|
52597
|
+
case "SCALAR":
|
|
52598
|
+
case "VEC2":
|
|
52599
|
+
case "VEC3":
|
|
52600
|
+
case "VEC4":
|
|
52601
|
+
case "MAT2":
|
|
52602
|
+
case "MAT3":
|
|
52603
|
+
case "MAT4": {
|
|
52604
|
+
data = getPropertyDataNumeric(classProperty, numberOfElements, valuesDataBytes, arrayOffsets);
|
|
52605
|
+
break;
|
|
52606
|
+
}
|
|
52607
|
+
case "BOOLEAN": {
|
|
52608
|
+
throw new Error(`Not implemented - classProperty.type=${classProperty.type}`);
|
|
52609
|
+
}
|
|
52610
|
+
case "STRING": {
|
|
52611
|
+
data = getPropertyDataString(classProperty, numberOfElements, valuesDataBytes, arrayOffsets, stringOffsets);
|
|
52612
|
+
break;
|
|
52613
|
+
}
|
|
52614
|
+
case "ENUM": {
|
|
52615
|
+
data = getPropertyDataENUM(schema, classProperty, numberOfElements, valuesDataBytes, arrayOffsets);
|
|
52616
|
+
break;
|
|
52617
|
+
}
|
|
52618
|
+
default:
|
|
52619
|
+
throw new Error(`Unknown classProperty type ${classProperty.type}`);
|
|
52620
|
+
}
|
|
52621
|
+
return data;
|
|
52622
|
+
}
|
|
52623
|
+
function getArrayOffsetsForProperty(scenegraph, classProperty, propertyTableProperty, numberOfElements) {
|
|
52624
|
+
if (classProperty.array && typeof classProperty.count === "undefined" && typeof propertyTableProperty.arrayOffsets !== "undefined" && typeof propertyTableProperty.arrayOffsetType !== "undefined") {
|
|
52625
|
+
return getOffsetsForProperty(scenegraph, propertyTableProperty.arrayOffsets, propertyTableProperty.arrayOffsetType, numberOfElements);
|
|
52626
|
+
}
|
|
52627
|
+
return null;
|
|
52628
|
+
}
|
|
52629
|
+
function getStringOffsetsForProperty(scenegraph, propertyTableProperty, numberOfElements) {
|
|
52630
|
+
if (typeof propertyTableProperty.stringOffsets !== "undefined" && typeof propertyTableProperty.stringOffsetType !== "undefined") {
|
|
52631
|
+
return getOffsetsForProperty(scenegraph, propertyTableProperty.stringOffsets, propertyTableProperty.stringOffsetType, numberOfElements);
|
|
52632
|
+
}
|
|
52633
|
+
return null;
|
|
52634
|
+
}
|
|
52635
|
+
function getPropertyDataNumeric(classProperty, numberOfElements, valuesDataBytes, arrayOffsets) {
|
|
52636
|
+
const isArray = classProperty.array;
|
|
52637
|
+
const arrayCount = classProperty.count;
|
|
52638
|
+
const elementSize = getArrayElementByteSize(classProperty.type, classProperty.componentType);
|
|
52639
|
+
const elementCount = valuesDataBytes.byteLength / elementSize;
|
|
52640
|
+
let valuesData;
|
|
52641
|
+
if (classProperty.componentType) {
|
|
52642
|
+
valuesData = convertRawBufferToMetadataArray(valuesDataBytes, classProperty.type, classProperty.componentType, elementCount);
|
|
52643
|
+
if (!valuesData) {
|
|
52644
|
+
valuesData = valuesDataBytes;
|
|
52645
|
+
}
|
|
52646
|
+
} else {
|
|
52647
|
+
valuesData = valuesDataBytes;
|
|
52648
|
+
}
|
|
52649
|
+
if (isArray) {
|
|
52650
|
+
if (arrayOffsets) {
|
|
52651
|
+
return parseVariableLengthArrayNumeric(valuesData, numberOfElements, arrayOffsets, valuesDataBytes.length, elementSize);
|
|
52652
|
+
}
|
|
52653
|
+
if (arrayCount) {
|
|
52654
|
+
return parseFixedLengthArrayNumeric(valuesData, numberOfElements, arrayCount);
|
|
52655
|
+
}
|
|
52656
|
+
return [];
|
|
52657
|
+
}
|
|
52658
|
+
return valuesData;
|
|
52659
|
+
}
|
|
52660
|
+
function parseVariableLengthArrayNumeric(valuesData, numberOfElements, arrayOffsets, valuesDataBytesLength, valueSize) {
|
|
52661
|
+
const attributeValueArray = [];
|
|
52662
|
+
for (let index = 0; index < numberOfElements; index++) {
|
|
52663
|
+
const arrayOffset = arrayOffsets[index];
|
|
52664
|
+
const arrayByteSize = arrayOffsets[index + 1] - arrayOffsets[index];
|
|
52665
|
+
if (arrayByteSize + arrayOffset > valuesDataBytesLength) {
|
|
52666
|
+
break;
|
|
52667
|
+
}
|
|
52668
|
+
const typedArrayOffset = arrayOffset / valueSize;
|
|
52669
|
+
const elementCount = arrayByteSize / valueSize;
|
|
52670
|
+
attributeValueArray.push(valuesData.slice(typedArrayOffset, typedArrayOffset + elementCount));
|
|
52671
|
+
}
|
|
52672
|
+
return attributeValueArray;
|
|
52673
|
+
}
|
|
52674
|
+
function parseFixedLengthArrayNumeric(valuesData, numberOfElements, arrayCount) {
|
|
52675
|
+
const attributeValueArray = [];
|
|
52676
|
+
for (let index = 0; index < numberOfElements; index++) {
|
|
52677
|
+
const elementOffset = index * arrayCount;
|
|
52678
|
+
attributeValueArray.push(valuesData.slice(elementOffset, elementOffset + arrayCount));
|
|
52679
|
+
}
|
|
52680
|
+
return attributeValueArray;
|
|
52681
|
+
}
|
|
52682
|
+
function getPropertyDataString(classProperty, numberOfElements, valuesDataBytes, arrayOffsets, stringOffsets) {
|
|
52683
|
+
if (arrayOffsets) {
|
|
52684
|
+
throw new Error(`Not implemented - classProperty.type=${classProperty.type}`);
|
|
52685
|
+
}
|
|
52686
|
+
if (stringOffsets) {
|
|
52687
|
+
const stringsArray = [];
|
|
52688
|
+
const textDecoder = new TextDecoder("utf8");
|
|
52689
|
+
let stringOffset = 0;
|
|
52690
|
+
for (let index = 0; index < numberOfElements; index++) {
|
|
52691
|
+
const stringByteSize = stringOffsets[index + 1] - stringOffsets[index];
|
|
52692
|
+
if (stringByteSize + stringOffset <= valuesDataBytes.length) {
|
|
52693
|
+
const stringData = valuesDataBytes.subarray(stringOffset, stringByteSize + stringOffset);
|
|
52694
|
+
const stringAttribute = textDecoder.decode(stringData);
|
|
52695
|
+
stringsArray.push(stringAttribute);
|
|
52696
|
+
stringOffset += stringByteSize;
|
|
52697
|
+
}
|
|
52698
|
+
}
|
|
52699
|
+
return stringsArray;
|
|
52700
|
+
}
|
|
52701
|
+
return [];
|
|
52702
|
+
}
|
|
52703
|
+
function getPropertyDataENUM(schema, classProperty, numberOfElements, valuesDataBytes, arrayOffsets) {
|
|
52704
|
+
const enumType = classProperty.enumType;
|
|
52705
|
+
if (!enumType) {
|
|
52706
|
+
throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");
|
|
52707
|
+
}
|
|
52708
|
+
const enumEntry = schema.enums?.[enumType];
|
|
52709
|
+
if (!enumEntry) {
|
|
52710
|
+
throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${enumType}`);
|
|
52711
|
+
}
|
|
52712
|
+
const enumValueType = enumEntry.valueType || "UINT16";
|
|
52713
|
+
const elementSize = getArrayElementByteSize(classProperty.type, enumValueType);
|
|
52714
|
+
const elementCount = valuesDataBytes.byteLength / elementSize;
|
|
52715
|
+
let valuesData = convertRawBufferToMetadataArray(valuesDataBytes, classProperty.type, enumValueType, elementCount);
|
|
52716
|
+
if (!valuesData) {
|
|
52717
|
+
valuesData = valuesDataBytes;
|
|
52718
|
+
}
|
|
52719
|
+
if (classProperty.array) {
|
|
52720
|
+
if (arrayOffsets) {
|
|
52721
|
+
return parseVariableLengthArrayENUM({
|
|
52722
|
+
valuesData,
|
|
52723
|
+
numberOfElements,
|
|
52724
|
+
arrayOffsets,
|
|
52725
|
+
valuesDataBytesLength: valuesDataBytes.length,
|
|
52726
|
+
elementSize,
|
|
52727
|
+
enumEntry
|
|
52728
|
+
});
|
|
52729
|
+
}
|
|
52730
|
+
const arrayCount = classProperty.count;
|
|
52731
|
+
if (arrayCount) {
|
|
52732
|
+
return parseFixedLengthArrayENUM(valuesData, numberOfElements, arrayCount, enumEntry);
|
|
52733
|
+
}
|
|
52734
|
+
return [];
|
|
52735
|
+
}
|
|
52736
|
+
return getEnumsArray(valuesData, 0, numberOfElements, enumEntry);
|
|
52737
|
+
}
|
|
52738
|
+
function parseVariableLengthArrayENUM(params) {
|
|
52739
|
+
const {
|
|
52740
|
+
valuesData,
|
|
52741
|
+
numberOfElements,
|
|
52742
|
+
arrayOffsets,
|
|
52743
|
+
valuesDataBytesLength,
|
|
52744
|
+
elementSize,
|
|
52745
|
+
enumEntry
|
|
52746
|
+
} = params;
|
|
52747
|
+
const attributeValueArray = [];
|
|
52748
|
+
for (let index = 0; index < numberOfElements; index++) {
|
|
52749
|
+
const arrayOffset = arrayOffsets[index];
|
|
52750
|
+
const arrayByteSize = arrayOffsets[index + 1] - arrayOffsets[index];
|
|
52751
|
+
if (arrayByteSize + arrayOffset > valuesDataBytesLength) {
|
|
52752
|
+
break;
|
|
52753
|
+
}
|
|
52754
|
+
const typedArrayOffset = arrayOffset / elementSize;
|
|
52755
|
+
const elementCount = arrayByteSize / elementSize;
|
|
52756
|
+
const array = getEnumsArray(valuesData, typedArrayOffset, elementCount, enumEntry);
|
|
52757
|
+
attributeValueArray.push(array);
|
|
52758
|
+
}
|
|
52759
|
+
return attributeValueArray;
|
|
52760
|
+
}
|
|
52761
|
+
function parseFixedLengthArrayENUM(valuesData, numberOfElements, arrayCount, enumEntry) {
|
|
52762
|
+
const attributeValueArray = [];
|
|
52763
|
+
for (let index = 0; index < numberOfElements; index++) {
|
|
52764
|
+
const elementOffset = arrayCount * index;
|
|
52765
|
+
const array = getEnumsArray(valuesData, elementOffset, arrayCount, enumEntry);
|
|
52766
|
+
attributeValueArray.push(array);
|
|
52767
|
+
}
|
|
52768
|
+
return attributeValueArray;
|
|
52769
|
+
}
|
|
52770
|
+
function getEnumsArray(valuesData, offset, count, enumEntry) {
|
|
52771
|
+
const array = [];
|
|
52772
|
+
for (let i = 0; i < count; i++) {
|
|
52773
|
+
if (valuesData instanceof BigInt64Array || valuesData instanceof BigUint64Array) {
|
|
52774
|
+
array.push("");
|
|
52775
|
+
} else {
|
|
52776
|
+
const value = valuesData[offset + i];
|
|
52777
|
+
const enumObject = getEnumByValue(enumEntry, value);
|
|
52778
|
+
if (enumObject) {
|
|
52779
|
+
array.push(enumObject.name);
|
|
52780
|
+
} else {
|
|
52781
|
+
array.push("");
|
|
52782
|
+
}
|
|
52783
|
+
}
|
|
52784
|
+
}
|
|
52785
|
+
return array;
|
|
52786
|
+
}
|
|
52787
|
+
function getEnumByValue(enumEntry, value) {
|
|
52788
|
+
for (const enumValue of enumEntry.values) {
|
|
52789
|
+
if (enumValue.value === value) {
|
|
52790
|
+
return enumValue;
|
|
52791
|
+
}
|
|
52792
|
+
}
|
|
52793
|
+
return null;
|
|
52794
|
+
}
|
|
52795
|
+
|
|
52796
|
+
// ../gltf/src/lib/extensions/EXT_mesh_features.ts
|
|
52797
|
+
var EXT_MESH_FEATURES_NAME = "EXT_mesh_features";
|
|
52798
|
+
var name2 = EXT_MESH_FEATURES_NAME;
|
|
52799
|
+
async function decode2(gltfData, options) {
|
|
52800
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
52801
|
+
decodeExtMeshFeatures(scenegraph, options);
|
|
52802
|
+
}
|
|
52803
|
+
function decodeExtMeshFeatures(scenegraph, options) {
|
|
52804
|
+
const json = scenegraph.gltf.json;
|
|
52805
|
+
if (!json.meshes) {
|
|
52806
|
+
return;
|
|
52807
|
+
}
|
|
52808
|
+
for (const mesh of json.meshes) {
|
|
52809
|
+
for (const primitive of mesh.primitives) {
|
|
52810
|
+
processMeshPrimitiveFeatures(scenegraph, primitive, options);
|
|
52811
|
+
}
|
|
52812
|
+
}
|
|
52813
|
+
}
|
|
52814
|
+
function processMeshPrimitiveFeatures(scenegraph, primitive, options) {
|
|
52815
|
+
const extension = primitive.extensions?.[EXT_MESH_FEATURES_NAME];
|
|
52816
|
+
const featureIds = extension?.featureIds;
|
|
52817
|
+
if (!featureIds)
|
|
52818
|
+
return;
|
|
52819
|
+
if (!extension.dataAttributeNames) {
|
|
52820
|
+
extension.dataAttributeNames = [];
|
|
52821
|
+
}
|
|
52822
|
+
let featureIdCount = 0;
|
|
52823
|
+
for (const featureId of featureIds) {
|
|
52824
|
+
let propertyTable = null;
|
|
52825
|
+
if (typeof featureId.propertyTable === "number") {
|
|
52826
|
+
propertyTable = getPropertyTablePopulated(scenegraph, featureId.propertyTable);
|
|
52827
|
+
}
|
|
52828
|
+
let propertyData = null;
|
|
52829
|
+
if (typeof featureId.attribute !== "undefined") {
|
|
52830
|
+
const accessorKey = `_FEATURE_ID_${featureId.attribute}`;
|
|
52831
|
+
const accessorIndex = primitive.attributes[accessorKey];
|
|
52832
|
+
const propertyDataTypedArray = scenegraph.getTypedArrayForAccessor(accessorIndex);
|
|
52833
|
+
propertyData = Array.prototype.slice.call(propertyDataTypedArray);
|
|
52834
|
+
} else if (typeof featureId.texture !== "undefined" && options?.gltf?.loadImages) {
|
|
52835
|
+
propertyData = getPrimitiveTextureData(scenegraph, featureId.texture, primitive);
|
|
52836
|
+
} else {
|
|
52837
|
+
}
|
|
52838
|
+
const attributeName = featureId.label || propertyTable?.name || `featureAttribute${featureIdCount}`;
|
|
52839
|
+
const featureTable = [];
|
|
52840
|
+
if (propertyData) {
|
|
52841
|
+
primitivePropertyDataToAttributes(scenegraph, attributeName, propertyData, featureTable, primitive);
|
|
52842
|
+
}
|
|
52843
|
+
extension.dataAttributeNames.push(attributeName);
|
|
52844
|
+
featureId.data = featureTable;
|
|
52845
|
+
featureIdCount++;
|
|
52846
|
+
}
|
|
52847
|
+
}
|
|
52848
|
+
|
|
52849
|
+
// ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
|
|
52850
|
+
var EXT_feature_metadata_exports = {};
|
|
52851
|
+
__export(EXT_feature_metadata_exports, {
|
|
52852
|
+
decode: () => decode3,
|
|
52853
|
+
name: () => name3
|
|
52854
|
+
});
|
|
52855
|
+
var EXT_FEATURE_METADATA_NAME = "EXT_feature_metadata";
|
|
52856
|
+
var name3 = EXT_FEATURE_METADATA_NAME;
|
|
52857
|
+
async function decode3(gltfData, options) {
|
|
52858
|
+
const scenegraph = new GLTFScenegraph(gltfData);
|
|
52859
|
+
decodeExtFeatureMetadata(scenegraph, options);
|
|
52860
|
+
}
|
|
52861
|
+
function decodeExtFeatureMetadata(scenegraph, options) {
|
|
52862
|
+
const extension = scenegraph.getExtension(EXT_FEATURE_METADATA_NAME);
|
|
52863
|
+
if (!extension)
|
|
52864
|
+
return;
|
|
52865
|
+
const schemaClasses = extension.schema?.classes;
|
|
52866
|
+
const { featureTables } = extension;
|
|
52867
|
+
if (schemaClasses && featureTables) {
|
|
52868
|
+
for (const schemaName in schemaClasses) {
|
|
52869
|
+
const schemaClass = schemaClasses[schemaName];
|
|
52870
|
+
const featureTable = findFeatureTableByName(featureTables, schemaName);
|
|
52871
|
+
if (featureTable) {
|
|
52872
|
+
handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
|
|
52873
|
+
}
|
|
52874
|
+
}
|
|
52875
|
+
}
|
|
52876
|
+
const { featureTextures } = extension;
|
|
52877
|
+
if (schemaClasses && featureTextures && options.gltf?.loadImages) {
|
|
52878
|
+
for (const schemaName in schemaClasses) {
|
|
52879
|
+
const schemaClass = schemaClasses[schemaName];
|
|
52880
|
+
const featureTexture = findFeatureTextureByName(featureTextures, schemaName);
|
|
52881
|
+
if (featureTexture) {
|
|
52882
|
+
handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);
|
|
52883
|
+
}
|
|
52884
|
+
}
|
|
52885
|
+
}
|
|
52886
|
+
}
|
|
52887
|
+
function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
|
|
52888
|
+
for (const propertyName in schemaClass.properties) {
|
|
52889
|
+
const schemaProperty = schemaClass.properties[propertyName];
|
|
52890
|
+
const featureTableProperty = featureTable?.properties?.[propertyName];
|
|
52891
|
+
const numberOfFeatures = featureTable.count;
|
|
52892
|
+
if (featureTableProperty) {
|
|
52893
|
+
const data = getPropertyDataFromBinarySource2(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
|
|
52894
|
+
featureTableProperty.data = data;
|
|
52895
|
+
}
|
|
52896
|
+
}
|
|
52897
|
+
}
|
|
52898
|
+
function handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass) {
|
|
52899
|
+
const attributeName = featureTexture.class;
|
|
52900
|
+
for (const propertyName in schemaClass.properties) {
|
|
52901
|
+
const featureTextureProperty = featureTexture?.properties?.[propertyName];
|
|
52902
|
+
if (featureTextureProperty) {
|
|
52903
|
+
const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);
|
|
52904
|
+
featureTextureProperty.data = data;
|
|
52905
|
+
}
|
|
52906
|
+
}
|
|
52907
|
+
}
|
|
52908
|
+
function getPropertyDataFromBinarySource2(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
|
|
52909
|
+
const bufferView = featureTableProperty.bufferView;
|
|
52910
|
+
const dataArray = scenegraph.getTypedArrayForBufferView(bufferView);
|
|
52911
|
+
if (schemaProperty.type === "STRING") {
|
|
52912
|
+
const offsetsData = getStringOffsets(scenegraph, featureTableProperty, numberOfFeatures);
|
|
52913
|
+
if (!offsetsData) {
|
|
52914
|
+
return [];
|
|
52915
|
+
}
|
|
52916
|
+
return getStringAttributes(dataArray, offsetsData, numberOfFeatures);
|
|
52917
|
+
} else if (isNumericProperty(schemaProperty.type)) {
|
|
52918
|
+
return getNumericAttributes(dataArray, schemaProperty.type, numberOfFeatures);
|
|
52919
|
+
}
|
|
52920
|
+
return dataArray;
|
|
52921
|
+
}
|
|
52922
|
+
function isNumericProperty(schemaPropertyType) {
|
|
52923
|
+
return [
|
|
52924
|
+
"UINT8",
|
|
52925
|
+
"INT16",
|
|
52926
|
+
"UINT16",
|
|
52927
|
+
"INT32",
|
|
52928
|
+
"UINT32",
|
|
52929
|
+
"INT64",
|
|
52930
|
+
"UINT64",
|
|
52931
|
+
"FLOAT32",
|
|
52932
|
+
"FLOAT64"
|
|
52933
|
+
].includes(schemaPropertyType);
|
|
52934
|
+
}
|
|
52935
|
+
function getStringOffsets(scenegraph, featureTableProperty, numberOfElements) {
|
|
52936
|
+
if (typeof featureTableProperty.stringOffsetBufferView !== "undefined") {
|
|
52937
|
+
return getOffsetsForProperty(scenegraph, featureTableProperty.stringOffsetBufferView, featureTableProperty.offsetType || "UINT32", numberOfElements);
|
|
52938
|
+
}
|
|
52939
|
+
return null;
|
|
52940
|
+
}
|
|
52941
|
+
function getNumericAttributes(valuesDataBytes, propertyType, elementCount) {
|
|
52942
|
+
let valuesData = convertRawBufferToMetadataArray(valuesDataBytes, "SCALAR", propertyType, elementCount);
|
|
52943
|
+
if (!valuesData) {
|
|
52944
|
+
valuesData = valuesDataBytes;
|
|
52945
|
+
}
|
|
52946
|
+
return valuesData;
|
|
52947
|
+
}
|
|
52948
|
+
function getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName) {
|
|
52949
|
+
const json = scenegraph.gltf.json;
|
|
52950
|
+
if (!json.meshes) {
|
|
52951
|
+
return [];
|
|
52952
|
+
}
|
|
52953
|
+
const featureTextureTable = [];
|
|
52954
|
+
for (const mesh of json.meshes) {
|
|
52955
|
+
for (const primitive of mesh.primitives) {
|
|
52956
|
+
processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive);
|
|
52957
|
+
}
|
|
52958
|
+
}
|
|
52959
|
+
return featureTextureTable;
|
|
52960
|
+
}
|
|
52961
|
+
function processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive) {
|
|
52962
|
+
const json = scenegraph.gltf.json;
|
|
52963
|
+
const textureData = [];
|
|
52964
|
+
const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;
|
|
52965
|
+
const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
|
|
52966
|
+
const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);
|
|
52967
|
+
const texCoordArray = scenegraph.getTypedArrayForBufferView(texCoordBufferView);
|
|
52968
|
+
const textureCoordinates = new Float32Array(texCoordArray.buffer, texCoordArray.byteOffset, texCoordArray.length / 4);
|
|
52969
|
+
const textureIndex = featureTextureProperty.texture.index;
|
|
52970
|
+
const texture = json.textures?.[textureIndex];
|
|
52971
|
+
const imageIndex = texture?.source;
|
|
52972
|
+
if (typeof imageIndex !== "undefined") {
|
|
52973
|
+
const image = json.images?.[imageIndex];
|
|
52974
|
+
const mimeType = image?.mimeType;
|
|
52975
|
+
const parsedImage = scenegraph.gltf.images?.[imageIndex];
|
|
52976
|
+
if (parsedImage) {
|
|
52977
|
+
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
52978
|
+
const value = getImageValueByCoordinates2(parsedImage, mimeType, textureCoordinates, index, featureTextureProperty.channels);
|
|
52979
|
+
textureData.push(value);
|
|
52980
|
+
}
|
|
52981
|
+
}
|
|
52982
|
+
}
|
|
52983
|
+
const featureIndices = [];
|
|
52984
|
+
for (const texelData of textureData) {
|
|
52985
|
+
let index = featureTextureTable.findIndex((item) => item === texelData);
|
|
52986
|
+
if (index === -1) {
|
|
52987
|
+
index = featureTextureTable.push(texelData) - 1;
|
|
52988
|
+
}
|
|
52989
|
+
featureIndices.push(index);
|
|
52990
|
+
}
|
|
52991
|
+
const typedArray = new Uint32Array(featureIndices);
|
|
52992
|
+
const bufferIndex = scenegraph.gltf.buffers.push({
|
|
52993
|
+
arrayBuffer: typedArray.buffer,
|
|
52994
|
+
byteOffset: 0,
|
|
52995
|
+
byteLength: typedArray.byteLength
|
|
52996
|
+
}) - 1;
|
|
52997
|
+
const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);
|
|
52998
|
+
const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {
|
|
52999
|
+
size: 1,
|
|
53000
|
+
componentType: getComponentTypeFromArray(typedArray),
|
|
53001
|
+
count: typedArray.length
|
|
53002
|
+
});
|
|
53003
|
+
primitive.attributes[attributeName] = accessorIndex;
|
|
53004
|
+
}
|
|
53005
|
+
function getImageValueByCoordinates2(parsedImage, mimeType, textureCoordinates, index, channels) {
|
|
53006
|
+
const CHANNELS_MAP = {
|
|
53007
|
+
r: { offset: 0, shift: 0 },
|
|
53008
|
+
g: { offset: 1, shift: 8 },
|
|
53009
|
+
b: { offset: 2, shift: 16 },
|
|
53010
|
+
a: { offset: 3, shift: 24 }
|
|
53011
|
+
};
|
|
53012
|
+
const u = textureCoordinates[index];
|
|
53013
|
+
const v = textureCoordinates[index + 1];
|
|
53014
|
+
let components = 1;
|
|
53015
|
+
if (mimeType && (mimeType.indexOf("image/jpeg") !== -1 || mimeType.indexOf("image/png") !== -1))
|
|
53016
|
+
components = 4;
|
|
53017
|
+
const offset = coordinatesToOffset2(u, v, parsedImage, components);
|
|
53018
|
+
let value = 0;
|
|
53019
|
+
for (const c of channels) {
|
|
53020
|
+
const map = CHANNELS_MAP[c];
|
|
53021
|
+
const val = getVal(parsedImage, offset + map.offset);
|
|
53022
|
+
value |= val << map.shift;
|
|
53023
|
+
}
|
|
53024
|
+
return value;
|
|
53025
|
+
}
|
|
53026
|
+
function getVal(parsedImage, offset) {
|
|
53027
|
+
const imageData = getImageData(parsedImage);
|
|
53028
|
+
if (imageData.data.length <= offset) {
|
|
53029
|
+
throw new Error(`${imageData.data.length} <= ${offset}`);
|
|
53030
|
+
}
|
|
53031
|
+
return imageData.data[offset];
|
|
53032
|
+
}
|
|
53033
|
+
function coordinatesToOffset2(u, v, parsedImage, componentsCount = 1) {
|
|
53034
|
+
const w = parsedImage.width;
|
|
53035
|
+
const iX = emod(u) * (w - 1);
|
|
53036
|
+
const indX = Math.round(iX);
|
|
53037
|
+
const h = parsedImage.height;
|
|
53038
|
+
const iY = emod(v) * (h - 1);
|
|
53039
|
+
const indY = Math.round(iY);
|
|
53040
|
+
const components = parsedImage.components ? parsedImage.components : componentsCount;
|
|
53041
|
+
const offset = (indY * w + indX) * components;
|
|
53042
|
+
return offset;
|
|
53043
|
+
}
|
|
53044
|
+
function findFeatureTableByName(featureTables, schemaClassName) {
|
|
53045
|
+
for (const featureTableName in featureTables) {
|
|
53046
|
+
const featureTable = featureTables[featureTableName];
|
|
53047
|
+
if (featureTable.class === schemaClassName) {
|
|
53048
|
+
return featureTable;
|
|
53049
|
+
}
|
|
53050
|
+
}
|
|
53051
|
+
return null;
|
|
53052
|
+
}
|
|
53053
|
+
function findFeatureTextureByName(featureTextures, schemaClassName) {
|
|
53054
|
+
for (const featureTexturesName in featureTextures) {
|
|
53055
|
+
const featureTable = featureTextures[featureTexturesName];
|
|
53056
|
+
if (featureTable.class === schemaClassName) {
|
|
53057
|
+
return featureTable;
|
|
53058
|
+
}
|
|
53059
|
+
}
|
|
53060
|
+
return null;
|
|
53061
|
+
}
|
|
53062
|
+
function getStringAttributes(data, offsetsData, stringsCount) {
|
|
53063
|
+
const stringsArray = [];
|
|
53064
|
+
const textDecoder = new TextDecoder("utf8");
|
|
53065
|
+
for (let index = 0; index < stringsCount; index++) {
|
|
53066
|
+
const stringData = data.slice(offsetsData[index], offsetsData[index + 1]);
|
|
53067
|
+
const stringAttribute = textDecoder.decode(stringData);
|
|
53068
|
+
stringsArray.push(stringAttribute);
|
|
53069
|
+
}
|
|
53070
|
+
return stringsArray;
|
|
53071
|
+
}
|
|
53072
|
+
|
|
53073
|
+
// ../gltf/src/lib/utils/version.ts
|
|
53074
|
+
var VERSION9 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
53075
|
+
|
|
51749
53076
|
// ../textures/src/lib/utils/version.ts
|
|
51750
53077
|
var VERSION10 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "beta";
|
|
51751
53078
|
|
|
@@ -52555,12 +53882,6 @@ function parseCompressedTexture(data) {
|
|
|
52555
53882
|
}
|
|
52556
53883
|
|
|
52557
53884
|
// ../textures/src/compressed-texture-loader.ts
|
|
52558
|
-
var DEFAULT_TEXTURE_LOADER_OPTIONS = {
|
|
52559
|
-
"compressed-texture": {
|
|
52560
|
-
libraryPath: "libs/",
|
|
52561
|
-
useBasis: false
|
|
52562
|
-
}
|
|
52563
|
-
};
|
|
52564
53885
|
var CompressedTextureWorkerLoader = {
|
|
52565
53886
|
name: "Texture Containers",
|
|
52566
53887
|
id: "compressed-texture",
|
|
@@ -52581,12 +53902,17 @@ var CompressedTextureWorkerLoader = {
|
|
|
52581
53902
|
"application/octet-stream"
|
|
52582
53903
|
],
|
|
52583
53904
|
binary: true,
|
|
52584
|
-
options:
|
|
53905
|
+
options: {
|
|
53906
|
+
"compressed-texture": {
|
|
53907
|
+
libraryPath: "libs/",
|
|
53908
|
+
useBasis: false
|
|
53909
|
+
}
|
|
53910
|
+
}
|
|
52585
53911
|
};
|
|
52586
53912
|
var CompressedTextureLoader = {
|
|
52587
53913
|
...CompressedTextureWorkerLoader,
|
|
52588
53914
|
parse: async (arrayBuffer, options) => {
|
|
52589
|
-
if (options["compressed-texture"]
|
|
53915
|
+
if (options?.["compressed-texture"]?.useBasis) {
|
|
52590
53916
|
options.basis = {
|
|
52591
53917
|
format: {
|
|
52592
53918
|
alpha: "BC3",
|
|
@@ -52596,7 +53922,8 @@ var CompressedTextureLoader = {
|
|
|
52596
53922
|
containerFormat: "ktx2",
|
|
52597
53923
|
module: "encoder"
|
|
52598
53924
|
};
|
|
52599
|
-
|
|
53925
|
+
const result = await parseBasis(arrayBuffer, options);
|
|
53926
|
+
return result[0];
|
|
52600
53927
|
}
|
|
52601
53928
|
return parseCompressedTexture(arrayBuffer);
|
|
52602
53929
|
}
|
|
@@ -52618,13 +53945,6 @@ var KTX2BasisWriterWorker = {
|
|
|
52618
53945
|
}
|
|
52619
53946
|
};
|
|
52620
53947
|
|
|
52621
|
-
// ../gltf/src/lib/utils/assert.ts
|
|
52622
|
-
function assert6(condition, message) {
|
|
52623
|
-
if (!condition) {
|
|
52624
|
-
throw new Error(message || "assert failed: gltf");
|
|
52625
|
-
}
|
|
52626
|
-
}
|
|
52627
|
-
|
|
52628
53948
|
// ../gltf/src/lib/parsers/parse-glb.ts
|
|
52629
53949
|
var LITTLE_ENDIAN2 = true;
|
|
52630
53950
|
var MAGIC_glTF = 1735152710;
|
|
@@ -52759,495 +54079,10 @@ function getTypedArrayForBufferView(json, buffers, bufferViewIndex) {
|
|
|
52759
54079
|
// ../gltf/src/lib/extensions/EXT_meshopt_compression.ts
|
|
52760
54080
|
var EXT_meshopt_compression_exports = {};
|
|
52761
54081
|
__export(EXT_meshopt_compression_exports, {
|
|
52762
|
-
decode: () =>
|
|
52763
|
-
name: () =>
|
|
54082
|
+
decode: () => decode5,
|
|
54083
|
+
name: () => name4
|
|
52764
54084
|
});
|
|
52765
54085
|
|
|
52766
|
-
// ../gltf/src/lib/gltf-utils/gltf-utils.ts
|
|
52767
|
-
var MIPMAP_FACTOR = 1.33;
|
|
52768
|
-
var TYPES = ["SCALAR", "VEC2", "VEC3", "VEC4"];
|
|
52769
|
-
var ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT = [
|
|
52770
|
-
[Int8Array, 5120],
|
|
52771
|
-
[Uint8Array, 5121],
|
|
52772
|
-
[Int16Array, 5122],
|
|
52773
|
-
[Uint16Array, 5123],
|
|
52774
|
-
[Uint32Array, 5125],
|
|
52775
|
-
[Float32Array, 5126],
|
|
52776
|
-
[Float64Array, 5130]
|
|
52777
|
-
];
|
|
52778
|
-
var ARRAY_TO_COMPONENT_TYPE = new Map(ARRAY_CONSTRUCTOR_TO_WEBGL_CONSTANT);
|
|
52779
|
-
var ATTRIBUTE_TYPE_TO_COMPONENTS = {
|
|
52780
|
-
SCALAR: 1,
|
|
52781
|
-
VEC2: 2,
|
|
52782
|
-
VEC3: 3,
|
|
52783
|
-
VEC4: 4,
|
|
52784
|
-
MAT2: 4,
|
|
52785
|
-
MAT3: 9,
|
|
52786
|
-
MAT4: 16
|
|
52787
|
-
};
|
|
52788
|
-
var ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE = {
|
|
52789
|
-
5120: 1,
|
|
52790
|
-
5121: 1,
|
|
52791
|
-
5122: 2,
|
|
52792
|
-
5123: 2,
|
|
52793
|
-
5125: 4,
|
|
52794
|
-
5126: 4
|
|
52795
|
-
};
|
|
52796
|
-
var ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY = {
|
|
52797
|
-
5120: Int8Array,
|
|
52798
|
-
5121: Uint8Array,
|
|
52799
|
-
5122: Int16Array,
|
|
52800
|
-
5123: Uint16Array,
|
|
52801
|
-
5125: Uint32Array,
|
|
52802
|
-
5126: Float32Array
|
|
52803
|
-
};
|
|
52804
|
-
function getAccessorTypeFromSize(size) {
|
|
52805
|
-
const type = TYPES[size - 1];
|
|
52806
|
-
return type || TYPES[0];
|
|
52807
|
-
}
|
|
52808
|
-
function getComponentTypeFromArray(typedArray) {
|
|
52809
|
-
const componentType = ARRAY_TO_COMPONENT_TYPE.get(typedArray.constructor);
|
|
52810
|
-
if (!componentType) {
|
|
52811
|
-
throw new Error("Illegal typed array");
|
|
52812
|
-
}
|
|
52813
|
-
return componentType;
|
|
52814
|
-
}
|
|
52815
|
-
function getAccessorArrayTypeAndLength(accessor, bufferView) {
|
|
52816
|
-
const ArrayType = ATTRIBUTE_COMPONENT_TYPE_TO_ARRAY[accessor.componentType];
|
|
52817
|
-
const components = ATTRIBUTE_TYPE_TO_COMPONENTS[accessor.type];
|
|
52818
|
-
const bytesPerComponent = ATTRIBUTE_COMPONENT_TYPE_TO_BYTE_SIZE[accessor.componentType];
|
|
52819
|
-
const length = accessor.count * components;
|
|
52820
|
-
const byteLength = accessor.count * components * bytesPerComponent;
|
|
52821
|
-
assert6(byteLength >= 0 && byteLength <= bufferView.byteLength);
|
|
52822
|
-
return { ArrayType, length, byteLength };
|
|
52823
|
-
}
|
|
52824
|
-
function getMemoryUsageGLTF(gltf) {
|
|
52825
|
-
let { images, bufferViews } = gltf;
|
|
52826
|
-
images = images || [];
|
|
52827
|
-
bufferViews = bufferViews || [];
|
|
52828
|
-
const imageBufferViews = images.map((i) => i.bufferView);
|
|
52829
|
-
bufferViews = bufferViews.filter((view) => !imageBufferViews.includes(view));
|
|
52830
|
-
const bufferMemory = bufferViews.reduce((acc, view) => acc + view.byteLength, 0);
|
|
52831
|
-
const pixelCount = images.reduce((acc, image) => {
|
|
52832
|
-
const { width, height } = image.image;
|
|
52833
|
-
return acc + width * height;
|
|
52834
|
-
}, 0);
|
|
52835
|
-
return bufferMemory + Math.ceil(4 * pixelCount * MIPMAP_FACTOR);
|
|
52836
|
-
}
|
|
52837
|
-
|
|
52838
|
-
// ../gltf/src/lib/api/gltf-scenegraph.ts
|
|
52839
|
-
function makeDefaultGLTFJson() {
|
|
52840
|
-
return {
|
|
52841
|
-
asset: {
|
|
52842
|
-
version: "2.0",
|
|
52843
|
-
generator: "loaders.gl"
|
|
52844
|
-
},
|
|
52845
|
-
buffers: [],
|
|
52846
|
-
extensions: {},
|
|
52847
|
-
extensionsRequired: [],
|
|
52848
|
-
extensionsUsed: []
|
|
52849
|
-
};
|
|
52850
|
-
}
|
|
52851
|
-
var GLTFScenegraph = class {
|
|
52852
|
-
constructor(gltf) {
|
|
52853
|
-
this.gltf = {
|
|
52854
|
-
json: gltf?.json || makeDefaultGLTFJson(),
|
|
52855
|
-
buffers: gltf?.buffers || [],
|
|
52856
|
-
images: gltf?.images || []
|
|
52857
|
-
};
|
|
52858
|
-
this.sourceBuffers = [];
|
|
52859
|
-
this.byteLength = 0;
|
|
52860
|
-
if (this.gltf.buffers && this.gltf.buffers[0]) {
|
|
52861
|
-
this.byteLength = this.gltf.buffers[0].byteLength;
|
|
52862
|
-
this.sourceBuffers = [this.gltf.buffers[0]];
|
|
52863
|
-
}
|
|
52864
|
-
}
|
|
52865
|
-
get json() {
|
|
52866
|
-
return this.gltf.json;
|
|
52867
|
-
}
|
|
52868
|
-
getApplicationData(key) {
|
|
52869
|
-
const data = this.json[key];
|
|
52870
|
-
return data;
|
|
52871
|
-
}
|
|
52872
|
-
getExtraData(key) {
|
|
52873
|
-
const extras = this.json.extras || {};
|
|
52874
|
-
return extras[key];
|
|
52875
|
-
}
|
|
52876
|
-
hasExtension(extensionName) {
|
|
52877
|
-
const isUsedExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
|
|
52878
|
-
const isRequiredExtension = this.getRequiredExtensions().find((name10) => name10 === extensionName);
|
|
52879
|
-
return typeof isUsedExtension === "string" || typeof isRequiredExtension === "string";
|
|
52880
|
-
}
|
|
52881
|
-
getExtension(extensionName) {
|
|
52882
|
-
const isExtension = this.getUsedExtensions().find((name10) => name10 === extensionName);
|
|
52883
|
-
const extensions = this.json.extensions || {};
|
|
52884
|
-
return isExtension ? extensions[extensionName] : null;
|
|
52885
|
-
}
|
|
52886
|
-
getRequiredExtension(extensionName) {
|
|
52887
|
-
const isRequired = this.getRequiredExtensions().find((name10) => name10 === extensionName);
|
|
52888
|
-
return isRequired ? this.getExtension(extensionName) : null;
|
|
52889
|
-
}
|
|
52890
|
-
getRequiredExtensions() {
|
|
52891
|
-
return this.json.extensionsRequired || [];
|
|
52892
|
-
}
|
|
52893
|
-
getUsedExtensions() {
|
|
52894
|
-
return this.json.extensionsUsed || [];
|
|
52895
|
-
}
|
|
52896
|
-
getRemovedExtensions() {
|
|
52897
|
-
return this.json.extensionsRemoved || [];
|
|
52898
|
-
}
|
|
52899
|
-
getObjectExtension(object, extensionName) {
|
|
52900
|
-
const extensions = object.extensions || {};
|
|
52901
|
-
return extensions[extensionName];
|
|
52902
|
-
}
|
|
52903
|
-
getScene(index) {
|
|
52904
|
-
return this.getObject("scenes", index);
|
|
52905
|
-
}
|
|
52906
|
-
getNode(index) {
|
|
52907
|
-
return this.getObject("nodes", index);
|
|
52908
|
-
}
|
|
52909
|
-
getSkin(index) {
|
|
52910
|
-
return this.getObject("skins", index);
|
|
52911
|
-
}
|
|
52912
|
-
getMesh(index) {
|
|
52913
|
-
return this.getObject("meshes", index);
|
|
52914
|
-
}
|
|
52915
|
-
getMaterial(index) {
|
|
52916
|
-
return this.getObject("materials", index);
|
|
52917
|
-
}
|
|
52918
|
-
getAccessor(index) {
|
|
52919
|
-
return this.getObject("accessors", index);
|
|
52920
|
-
}
|
|
52921
|
-
getTexture(index) {
|
|
52922
|
-
return this.getObject("textures", index);
|
|
52923
|
-
}
|
|
52924
|
-
getSampler(index) {
|
|
52925
|
-
return this.getObject("samplers", index);
|
|
52926
|
-
}
|
|
52927
|
-
getImage(index) {
|
|
52928
|
-
return this.getObject("images", index);
|
|
52929
|
-
}
|
|
52930
|
-
getBufferView(index) {
|
|
52931
|
-
return this.getObject("bufferViews", index);
|
|
52932
|
-
}
|
|
52933
|
-
getBuffer(index) {
|
|
52934
|
-
return this.getObject("buffers", index);
|
|
52935
|
-
}
|
|
52936
|
-
getObject(array, index) {
|
|
52937
|
-
if (typeof index === "object") {
|
|
52938
|
-
return index;
|
|
52939
|
-
}
|
|
52940
|
-
const object = this.json[array] && this.json[array][index];
|
|
52941
|
-
if (!object) {
|
|
52942
|
-
throw new Error(`glTF file error: Could not find ${array}[${index}]`);
|
|
52943
|
-
}
|
|
52944
|
-
return object;
|
|
52945
|
-
}
|
|
52946
|
-
getTypedArrayForBufferView(bufferView) {
|
|
52947
|
-
bufferView = this.getBufferView(bufferView);
|
|
52948
|
-
const bufferIndex = bufferView.buffer;
|
|
52949
|
-
const binChunk = this.gltf.buffers[bufferIndex];
|
|
52950
|
-
assert6(binChunk);
|
|
52951
|
-
const byteOffset = (bufferView.byteOffset || 0) + binChunk.byteOffset;
|
|
52952
|
-
return new Uint8Array(binChunk.arrayBuffer, byteOffset, bufferView.byteLength);
|
|
52953
|
-
}
|
|
52954
|
-
getTypedArrayForAccessor(accessor) {
|
|
52955
|
-
accessor = this.getAccessor(accessor);
|
|
52956
|
-
const bufferView = this.getBufferView(accessor.bufferView);
|
|
52957
|
-
const buffer = this.getBuffer(bufferView.buffer);
|
|
52958
|
-
const arrayBuffer = buffer.data;
|
|
52959
|
-
const { ArrayType, length } = getAccessorArrayTypeAndLength(accessor, bufferView);
|
|
52960
|
-
const byteOffset = bufferView.byteOffset + accessor.byteOffset;
|
|
52961
|
-
return new ArrayType(arrayBuffer, byteOffset, length);
|
|
52962
|
-
}
|
|
52963
|
-
getTypedArrayForImageData(image) {
|
|
52964
|
-
image = this.getAccessor(image);
|
|
52965
|
-
const bufferView = this.getBufferView(image.bufferView);
|
|
52966
|
-
const buffer = this.getBuffer(bufferView.buffer);
|
|
52967
|
-
const arrayBuffer = buffer.data;
|
|
52968
|
-
const byteOffset = bufferView.byteOffset || 0;
|
|
52969
|
-
return new Uint8Array(arrayBuffer, byteOffset, bufferView.byteLength);
|
|
52970
|
-
}
|
|
52971
|
-
addApplicationData(key, data) {
|
|
52972
|
-
this.json[key] = data;
|
|
52973
|
-
return this;
|
|
52974
|
-
}
|
|
52975
|
-
addExtraData(key, data) {
|
|
52976
|
-
this.json.extras = this.json.extras || {};
|
|
52977
|
-
this.json.extras[key] = data;
|
|
52978
|
-
return this;
|
|
52979
|
-
}
|
|
52980
|
-
addObjectExtension(object, extensionName, data) {
|
|
52981
|
-
object.extensions = object.extensions || {};
|
|
52982
|
-
object.extensions[extensionName] = data;
|
|
52983
|
-
this.registerUsedExtension(extensionName);
|
|
52984
|
-
return this;
|
|
52985
|
-
}
|
|
52986
|
-
setObjectExtension(object, extensionName, data) {
|
|
52987
|
-
const extensions = object.extensions || {};
|
|
52988
|
-
extensions[extensionName] = data;
|
|
52989
|
-
}
|
|
52990
|
-
removeObjectExtension(object, extensionName) {
|
|
52991
|
-
const extensions = object?.extensions || {};
|
|
52992
|
-
if (extensions[extensionName]) {
|
|
52993
|
-
this.json.extensionsRemoved = this.json.extensionsRemoved || [];
|
|
52994
|
-
const extensionsRemoved = this.json.extensionsRemoved;
|
|
52995
|
-
if (!extensionsRemoved.includes(extensionName)) {
|
|
52996
|
-
extensionsRemoved.push(extensionName);
|
|
52997
|
-
}
|
|
52998
|
-
}
|
|
52999
|
-
delete extensions[extensionName];
|
|
53000
|
-
}
|
|
53001
|
-
addExtension(extensionName, extensionData = {}) {
|
|
53002
|
-
assert6(extensionData);
|
|
53003
|
-
this.json.extensions = this.json.extensions || {};
|
|
53004
|
-
this.json.extensions[extensionName] = extensionData;
|
|
53005
|
-
this.registerUsedExtension(extensionName);
|
|
53006
|
-
return extensionData;
|
|
53007
|
-
}
|
|
53008
|
-
addRequiredExtension(extensionName, extensionData = {}) {
|
|
53009
|
-
assert6(extensionData);
|
|
53010
|
-
this.addExtension(extensionName, extensionData);
|
|
53011
|
-
this.registerRequiredExtension(extensionName);
|
|
53012
|
-
return extensionData;
|
|
53013
|
-
}
|
|
53014
|
-
registerUsedExtension(extensionName) {
|
|
53015
|
-
this.json.extensionsUsed = this.json.extensionsUsed || [];
|
|
53016
|
-
if (!this.json.extensionsUsed.find((ext) => ext === extensionName)) {
|
|
53017
|
-
this.json.extensionsUsed.push(extensionName);
|
|
53018
|
-
}
|
|
53019
|
-
}
|
|
53020
|
-
registerRequiredExtension(extensionName) {
|
|
53021
|
-
this.registerUsedExtension(extensionName);
|
|
53022
|
-
this.json.extensionsRequired = this.json.extensionsRequired || [];
|
|
53023
|
-
if (!this.json.extensionsRequired.find((ext) => ext === extensionName)) {
|
|
53024
|
-
this.json.extensionsRequired.push(extensionName);
|
|
53025
|
-
}
|
|
53026
|
-
}
|
|
53027
|
-
removeExtension(extensionName) {
|
|
53028
|
-
if (this.json.extensions?.[extensionName]) {
|
|
53029
|
-
this.json.extensionsRemoved = this.json.extensionsRemoved || [];
|
|
53030
|
-
const extensionsRemoved = this.json.extensionsRemoved;
|
|
53031
|
-
if (!extensionsRemoved.includes(extensionName)) {
|
|
53032
|
-
extensionsRemoved.push(extensionName);
|
|
53033
|
-
}
|
|
53034
|
-
}
|
|
53035
|
-
if (this.json.extensions) {
|
|
53036
|
-
delete this.json.extensions[extensionName];
|
|
53037
|
-
}
|
|
53038
|
-
if (this.json.extensionsRequired) {
|
|
53039
|
-
this._removeStringFromArray(this.json.extensionsRequired, extensionName);
|
|
53040
|
-
}
|
|
53041
|
-
if (this.json.extensionsUsed) {
|
|
53042
|
-
this._removeStringFromArray(this.json.extensionsUsed, extensionName);
|
|
53043
|
-
}
|
|
53044
|
-
}
|
|
53045
|
-
setDefaultScene(sceneIndex) {
|
|
53046
|
-
this.json.scene = sceneIndex;
|
|
53047
|
-
}
|
|
53048
|
-
addScene(scene) {
|
|
53049
|
-
const { nodeIndices } = scene;
|
|
53050
|
-
this.json.scenes = this.json.scenes || [];
|
|
53051
|
-
this.json.scenes.push({ nodes: nodeIndices });
|
|
53052
|
-
return this.json.scenes.length - 1;
|
|
53053
|
-
}
|
|
53054
|
-
addNode(node2) {
|
|
53055
|
-
const { meshIndex, matrix } = node2;
|
|
53056
|
-
this.json.nodes = this.json.nodes || [];
|
|
53057
|
-
const nodeData = { mesh: meshIndex };
|
|
53058
|
-
if (matrix) {
|
|
53059
|
-
nodeData.matrix = matrix;
|
|
53060
|
-
}
|
|
53061
|
-
this.json.nodes.push(nodeData);
|
|
53062
|
-
return this.json.nodes.length - 1;
|
|
53063
|
-
}
|
|
53064
|
-
addMesh(mesh) {
|
|
53065
|
-
const { attributes, indices, material, mode = 4 } = mesh;
|
|
53066
|
-
const accessors = this._addAttributes(attributes);
|
|
53067
|
-
const glTFMesh = {
|
|
53068
|
-
primitives: [
|
|
53069
|
-
{
|
|
53070
|
-
attributes: accessors,
|
|
53071
|
-
mode
|
|
53072
|
-
}
|
|
53073
|
-
]
|
|
53074
|
-
};
|
|
53075
|
-
if (indices) {
|
|
53076
|
-
const indicesAccessor = this._addIndices(indices);
|
|
53077
|
-
glTFMesh.primitives[0].indices = indicesAccessor;
|
|
53078
|
-
}
|
|
53079
|
-
if (Number.isFinite(material)) {
|
|
53080
|
-
glTFMesh.primitives[0].material = material;
|
|
53081
|
-
}
|
|
53082
|
-
this.json.meshes = this.json.meshes || [];
|
|
53083
|
-
this.json.meshes.push(glTFMesh);
|
|
53084
|
-
return this.json.meshes.length - 1;
|
|
53085
|
-
}
|
|
53086
|
-
addPointCloud(attributes) {
|
|
53087
|
-
const accessorIndices = this._addAttributes(attributes);
|
|
53088
|
-
const glTFMesh = {
|
|
53089
|
-
primitives: [
|
|
53090
|
-
{
|
|
53091
|
-
attributes: accessorIndices,
|
|
53092
|
-
mode: 0
|
|
53093
|
-
}
|
|
53094
|
-
]
|
|
53095
|
-
};
|
|
53096
|
-
this.json.meshes = this.json.meshes || [];
|
|
53097
|
-
this.json.meshes.push(glTFMesh);
|
|
53098
|
-
return this.json.meshes.length - 1;
|
|
53099
|
-
}
|
|
53100
|
-
addImage(imageData, mimeTypeOpt) {
|
|
53101
|
-
const metadata = getBinaryImageMetadata(imageData);
|
|
53102
|
-
const mimeType = mimeTypeOpt || metadata?.mimeType;
|
|
53103
|
-
const bufferViewIndex = this.addBufferView(imageData);
|
|
53104
|
-
const glTFImage = {
|
|
53105
|
-
bufferView: bufferViewIndex,
|
|
53106
|
-
mimeType
|
|
53107
|
-
};
|
|
53108
|
-
this.json.images = this.json.images || [];
|
|
53109
|
-
this.json.images.push(glTFImage);
|
|
53110
|
-
return this.json.images.length - 1;
|
|
53111
|
-
}
|
|
53112
|
-
addBufferView(buffer, bufferIndex = 0, byteOffset = this.byteLength) {
|
|
53113
|
-
const byteLength = buffer.byteLength;
|
|
53114
|
-
assert6(Number.isFinite(byteLength));
|
|
53115
|
-
this.sourceBuffers = this.sourceBuffers || [];
|
|
53116
|
-
this.sourceBuffers.push(buffer);
|
|
53117
|
-
const glTFBufferView = {
|
|
53118
|
-
buffer: bufferIndex,
|
|
53119
|
-
byteOffset,
|
|
53120
|
-
byteLength
|
|
53121
|
-
};
|
|
53122
|
-
this.byteLength += padToNBytes(byteLength, 4);
|
|
53123
|
-
this.json.bufferViews = this.json.bufferViews || [];
|
|
53124
|
-
this.json.bufferViews.push(glTFBufferView);
|
|
53125
|
-
return this.json.bufferViews.length - 1;
|
|
53126
|
-
}
|
|
53127
|
-
addAccessor(bufferViewIndex, accessor) {
|
|
53128
|
-
const glTFAccessor = {
|
|
53129
|
-
bufferView: bufferViewIndex,
|
|
53130
|
-
type: getAccessorTypeFromSize(accessor.size),
|
|
53131
|
-
componentType: accessor.componentType,
|
|
53132
|
-
count: accessor.count,
|
|
53133
|
-
max: accessor.max,
|
|
53134
|
-
min: accessor.min
|
|
53135
|
-
};
|
|
53136
|
-
this.json.accessors = this.json.accessors || [];
|
|
53137
|
-
this.json.accessors.push(glTFAccessor);
|
|
53138
|
-
return this.json.accessors.length - 1;
|
|
53139
|
-
}
|
|
53140
|
-
addBinaryBuffer(sourceBuffer, accessor = { size: 3 }) {
|
|
53141
|
-
const bufferViewIndex = this.addBufferView(sourceBuffer);
|
|
53142
|
-
let minMax = { min: accessor.min, max: accessor.max };
|
|
53143
|
-
if (!minMax.min || !minMax.max) {
|
|
53144
|
-
minMax = this._getAccessorMinMax(sourceBuffer, accessor.size);
|
|
53145
|
-
}
|
|
53146
|
-
const accessorDefaults = {
|
|
53147
|
-
size: accessor.size,
|
|
53148
|
-
componentType: getComponentTypeFromArray(sourceBuffer),
|
|
53149
|
-
count: Math.round(sourceBuffer.length / accessor.size),
|
|
53150
|
-
min: minMax.min,
|
|
53151
|
-
max: minMax.max
|
|
53152
|
-
};
|
|
53153
|
-
return this.addAccessor(bufferViewIndex, Object.assign(accessorDefaults, accessor));
|
|
53154
|
-
}
|
|
53155
|
-
addTexture(texture) {
|
|
53156
|
-
const { imageIndex } = texture;
|
|
53157
|
-
const glTFTexture = {
|
|
53158
|
-
source: imageIndex
|
|
53159
|
-
};
|
|
53160
|
-
this.json.textures = this.json.textures || [];
|
|
53161
|
-
this.json.textures.push(glTFTexture);
|
|
53162
|
-
return this.json.textures.length - 1;
|
|
53163
|
-
}
|
|
53164
|
-
addMaterial(pbrMaterialInfo) {
|
|
53165
|
-
this.json.materials = this.json.materials || [];
|
|
53166
|
-
this.json.materials.push(pbrMaterialInfo);
|
|
53167
|
-
return this.json.materials.length - 1;
|
|
53168
|
-
}
|
|
53169
|
-
createBinaryChunk() {
|
|
53170
|
-
this.gltf.buffers = [];
|
|
53171
|
-
const totalByteLength = this.byteLength;
|
|
53172
|
-
const arrayBuffer = new ArrayBuffer(totalByteLength);
|
|
53173
|
-
const targetArray = new Uint8Array(arrayBuffer);
|
|
53174
|
-
let dstByteOffset = 0;
|
|
53175
|
-
for (const sourceBuffer of this.sourceBuffers || []) {
|
|
53176
|
-
dstByteOffset = copyToArray(sourceBuffer, targetArray, dstByteOffset);
|
|
53177
|
-
}
|
|
53178
|
-
if (this.json?.buffers?.[0]) {
|
|
53179
|
-
this.json.buffers[0].byteLength = totalByteLength;
|
|
53180
|
-
} else {
|
|
53181
|
-
this.json.buffers = [{ byteLength: totalByteLength }];
|
|
53182
|
-
}
|
|
53183
|
-
this.gltf.binary = arrayBuffer;
|
|
53184
|
-
this.sourceBuffers = [arrayBuffer];
|
|
53185
|
-
}
|
|
53186
|
-
_removeStringFromArray(array, string) {
|
|
53187
|
-
let found = true;
|
|
53188
|
-
while (found) {
|
|
53189
|
-
const index = array.indexOf(string);
|
|
53190
|
-
if (index > -1) {
|
|
53191
|
-
array.splice(index, 1);
|
|
53192
|
-
} else {
|
|
53193
|
-
found = false;
|
|
53194
|
-
}
|
|
53195
|
-
}
|
|
53196
|
-
}
|
|
53197
|
-
_addAttributes(attributes = {}) {
|
|
53198
|
-
const result = {};
|
|
53199
|
-
for (const attributeKey in attributes) {
|
|
53200
|
-
const attributeData = attributes[attributeKey];
|
|
53201
|
-
const attrName = this._getGltfAttributeName(attributeKey);
|
|
53202
|
-
const accessor = this.addBinaryBuffer(attributeData.value, attributeData);
|
|
53203
|
-
result[attrName] = accessor;
|
|
53204
|
-
}
|
|
53205
|
-
return result;
|
|
53206
|
-
}
|
|
53207
|
-
_addIndices(indices) {
|
|
53208
|
-
return this.addBinaryBuffer(indices, { size: 1 });
|
|
53209
|
-
}
|
|
53210
|
-
_getGltfAttributeName(attributeName) {
|
|
53211
|
-
switch (attributeName.toLowerCase()) {
|
|
53212
|
-
case "position":
|
|
53213
|
-
case "positions":
|
|
53214
|
-
case "vertices":
|
|
53215
|
-
return "POSITION";
|
|
53216
|
-
case "normal":
|
|
53217
|
-
case "normals":
|
|
53218
|
-
return "NORMAL";
|
|
53219
|
-
case "color":
|
|
53220
|
-
case "colors":
|
|
53221
|
-
return "COLOR_0";
|
|
53222
|
-
case "texcoord":
|
|
53223
|
-
case "texcoords":
|
|
53224
|
-
return "TEXCOORD_0";
|
|
53225
|
-
default:
|
|
53226
|
-
return attributeName;
|
|
53227
|
-
}
|
|
53228
|
-
}
|
|
53229
|
-
_getAccessorMinMax(buffer, size) {
|
|
53230
|
-
const result = { min: null, max: null };
|
|
53231
|
-
if (buffer.length < size) {
|
|
53232
|
-
return result;
|
|
53233
|
-
}
|
|
53234
|
-
result.min = [];
|
|
53235
|
-
result.max = [];
|
|
53236
|
-
const initValues = buffer.subarray(0, size);
|
|
53237
|
-
for (const value of initValues) {
|
|
53238
|
-
result.min.push(value);
|
|
53239
|
-
result.max.push(value);
|
|
53240
|
-
}
|
|
53241
|
-
for (let index = size; index < buffer.length; index += size) {
|
|
53242
|
-
for (let componentIndex = 0; componentIndex < size; componentIndex++) {
|
|
53243
|
-
result.min[0 + componentIndex] = Math.min(result.min[0 + componentIndex], buffer[index + componentIndex]);
|
|
53244
|
-
result.max[0 + componentIndex] = Math.max(result.max[0 + componentIndex], buffer[index + componentIndex]);
|
|
53245
|
-
}
|
|
53246
|
-
}
|
|
53247
|
-
return result;
|
|
53248
|
-
}
|
|
53249
|
-
};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FCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB";
|
|
@@ -53386,7 +54221,7 @@ var DECODERS = {
|
|
|
53386
54221
|
};
|
|
53387
54222
|
async function meshoptDecodeGltfBuffer(target, count, size, source, mode, filter = "NONE") {
|
|
53388
54223
|
const instance = await loadWasmInstance();
|
|
53389
|
-
|
|
54224
|
+
decode4(instance, instance.exports[DECODERS[mode]], target, count, size, source, instance.exports[FILTERS[filter || "NONE"]]);
|
|
53390
54225
|
}
|
|
53391
54226
|
var wasmPromise;
|
|
53392
54227
|
async function loadWasmInstance() {
|
|
@@ -53417,7 +54252,7 @@ function unpack(data) {
|
|
|
53417
54252
|
}
|
|
53418
54253
|
return result.buffer.slice(0, write);
|
|
53419
54254
|
}
|
|
53420
|
-
function
|
|
54255
|
+
function decode4(instance, fun, target, count, size, source, filter) {
|
|
53421
54256
|
const sbrk = instance.exports.sbrk;
|
|
53422
54257
|
const count4 = count + 3 & ~3;
|
|
53423
54258
|
const tp = sbrk(count4 * size);
|
|
@@ -53437,8 +54272,8 @@ function decode(instance, fun, target, count, size, source, filter) {
|
|
|
53437
54272
|
|
|
53438
54273
|
// ../gltf/src/lib/extensions/EXT_meshopt_compression.ts
|
|
53439
54274
|
var EXT_MESHOPT_COMPRESSION = "EXT_meshopt_compression";
|
|
53440
|
-
var
|
|
53441
|
-
async function
|
|
54275
|
+
var name4 = EXT_MESHOPT_COMPRESSION;
|
|
54276
|
+
async function decode5(gltfData, options) {
|
|
53442
54277
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
53443
54278
|
if (!options?.gltf?.decompressMeshes || !options.gltf?.loadBuffers) {
|
|
53444
54279
|
return;
|
|
@@ -53473,11 +54308,11 @@ async function decodeMeshoptBufferView(scenegraph, bufferView) {
|
|
|
53473
54308
|
// ../gltf/src/lib/extensions/EXT_texture_webp.ts
|
|
53474
54309
|
var EXT_texture_webp_exports = {};
|
|
53475
54310
|
__export(EXT_texture_webp_exports, {
|
|
53476
|
-
name: () =>
|
|
54311
|
+
name: () => name5,
|
|
53477
54312
|
preprocess: () => preprocess
|
|
53478
54313
|
});
|
|
53479
54314
|
var EXT_TEXTURE_WEBP = "EXT_texture_webp";
|
|
53480
|
-
var
|
|
54315
|
+
var name5 = EXT_TEXTURE_WEBP;
|
|
53481
54316
|
function preprocess(gltfData, options) {
|
|
53482
54317
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
53483
54318
|
if (!isImageFormatSupported("image/webp")) {
|
|
@@ -53500,11 +54335,11 @@ function preprocess(gltfData, options) {
|
|
|
53500
54335
|
// ../gltf/src/lib/extensions/KHR_texture_basisu.ts
|
|
53501
54336
|
var KHR_texture_basisu_exports = {};
|
|
53502
54337
|
__export(KHR_texture_basisu_exports, {
|
|
53503
|
-
name: () =>
|
|
54338
|
+
name: () => name6,
|
|
53504
54339
|
preprocess: () => preprocess2
|
|
53505
54340
|
});
|
|
53506
54341
|
var KHR_TEXTURE_BASISU = "KHR_texture_basisu";
|
|
53507
|
-
var
|
|
54342
|
+
var name6 = KHR_TEXTURE_BASISU;
|
|
53508
54343
|
function preprocess2(gltfData, options) {
|
|
53509
54344
|
const scene = new GLTFScenegraph(gltfData);
|
|
53510
54345
|
const { json } = scene;
|
|
@@ -53521,20 +54356,20 @@ function preprocess2(gltfData, options) {
|
|
|
53521
54356
|
// ../gltf/src/lib/extensions/KHR_draco_mesh_compression.ts
|
|
53522
54357
|
var KHR_draco_mesh_compression_exports = {};
|
|
53523
54358
|
__export(KHR_draco_mesh_compression_exports, {
|
|
53524
|
-
decode: () =>
|
|
54359
|
+
decode: () => decode6,
|
|
53525
54360
|
encode: () => encode2,
|
|
53526
|
-
name: () =>
|
|
54361
|
+
name: () => name7,
|
|
53527
54362
|
preprocess: () => preprocess3
|
|
53528
54363
|
});
|
|
53529
54364
|
|
|
53530
54365
|
// ../gltf/src/lib/gltf-utils/gltf-attribute-utils.ts
|
|
53531
54366
|
function getGLTFAccessors(attributes) {
|
|
53532
54367
|
const accessors = {};
|
|
53533
|
-
for (const
|
|
53534
|
-
const attribute = attributes[
|
|
53535
|
-
if (
|
|
54368
|
+
for (const name12 in attributes) {
|
|
54369
|
+
const attribute = attributes[name12];
|
|
54370
|
+
if (name12 !== "indices") {
|
|
53536
54371
|
const glTFAccessor = getGLTFAccessor(attribute);
|
|
53537
|
-
accessors[
|
|
54372
|
+
accessors[name12] = glTFAccessor;
|
|
53538
54373
|
}
|
|
53539
54374
|
}
|
|
53540
54375
|
return accessors;
|
|
@@ -53582,7 +54417,7 @@ function toTypedArray(array, ArrayType, convertTypedArrays = false) {
|
|
|
53582
54417
|
|
|
53583
54418
|
// ../gltf/src/lib/extensions/KHR_draco_mesh_compression.ts
|
|
53584
54419
|
var KHR_DRACO_MESH_COMPRESSION = "KHR_draco_mesh_compression";
|
|
53585
|
-
var
|
|
54420
|
+
var name7 = KHR_DRACO_MESH_COMPRESSION;
|
|
53586
54421
|
function preprocess3(gltfData, options, context) {
|
|
53587
54422
|
const scenegraph = new GLTFScenegraph(gltfData);
|
|
53588
54423
|
for (const primitive of makeMeshPrimitiveIterator(scenegraph)) {
|
|
@@ -53590,7 +54425,7 @@ function preprocess3(gltfData, options, context) {
|
|
|
53590
54425
|
}
|
|
53591
54426
|
}
|
|
53592
54427
|
}
|
|
53593
|
-
async function
|
|
54428
|
+
async function decode6(gltfData, options, context) {
|
|
53594
54429
|
if (!options?.gltf?.decompressMeshes) {
|
|
53595
54430
|
return;
|
|
53596
54431
|
}
|
|
@@ -53679,8 +54514,8 @@ function* makeMeshPrimitiveIterator(scenegraph) {
|
|
|
53679
54514
|
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
53680
54515
|
var KHR_texture_transform_exports = {};
|
|
53681
54516
|
__export(KHR_texture_transform_exports, {
|
|
53682
|
-
decode: () =>
|
|
53683
|
-
name: () =>
|
|
54517
|
+
decode: () => decode7,
|
|
54518
|
+
name: () => name8
|
|
53684
54519
|
});
|
|
53685
54520
|
var import_core6 = __toModule(require_es5());
|
|
53686
54521
|
|
|
@@ -53705,11 +54540,11 @@ var BYTES = {
|
|
|
53705
54540
|
|
|
53706
54541
|
// ../gltf/src/lib/extensions/KHR_texture_transform.ts
|
|
53707
54542
|
var EXT_MESHOPT_TRANSFORM = "KHR_texture_transform";
|
|
53708
|
-
var
|
|
54543
|
+
var name8 = EXT_MESHOPT_TRANSFORM;
|
|
53709
54544
|
var scratchVector = new import_core6.Vector3();
|
|
53710
54545
|
var scratchRotationMatrix = new import_core6.Matrix3();
|
|
53711
54546
|
var scratchScaleMatrix = new import_core6.Matrix3();
|
|
53712
|
-
async function
|
|
54547
|
+
async function decode7(gltfData, options) {
|
|
53713
54548
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
53714
54549
|
const hasExtension = gltfScenegraph.hasExtension(EXT_MESHOPT_TRANSFORM);
|
|
53715
54550
|
if (!hasExtension || !options.gltf?.loadBuffers) {
|
|
@@ -53855,13 +54690,13 @@ function makeTransformationMatrix(extensionData) {
|
|
|
53855
54690
|
// ../gltf/src/lib/extensions/deprecated/KHR_lights_punctual.ts
|
|
53856
54691
|
var KHR_lights_punctual_exports = {};
|
|
53857
54692
|
__export(KHR_lights_punctual_exports, {
|
|
53858
|
-
decode: () =>
|
|
54693
|
+
decode: () => decode8,
|
|
53859
54694
|
encode: () => encode3,
|
|
53860
|
-
name: () =>
|
|
54695
|
+
name: () => name9
|
|
53861
54696
|
});
|
|
53862
54697
|
var KHR_LIGHTS_PUNCTUAL = "KHR_lights_punctual";
|
|
53863
|
-
var
|
|
53864
|
-
async function
|
|
54698
|
+
var name9 = KHR_LIGHTS_PUNCTUAL;
|
|
54699
|
+
async function decode8(gltfData) {
|
|
53865
54700
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
53866
54701
|
const { json } = gltfScenegraph;
|
|
53867
54702
|
const extension = gltfScenegraph.getExtension(KHR_LIGHTS_PUNCTUAL);
|
|
@@ -53898,13 +54733,13 @@ async function encode3(gltfData) {
|
|
|
53898
54733
|
// ../gltf/src/lib/extensions/deprecated/KHR_materials_unlit.ts
|
|
53899
54734
|
var KHR_materials_unlit_exports = {};
|
|
53900
54735
|
__export(KHR_materials_unlit_exports, {
|
|
53901
|
-
decode: () =>
|
|
54736
|
+
decode: () => decode9,
|
|
53902
54737
|
encode: () => encode4,
|
|
53903
|
-
name: () =>
|
|
54738
|
+
name: () => name10
|
|
53904
54739
|
});
|
|
53905
54740
|
var KHR_MATERIALS_UNLIT = "KHR_materials_unlit";
|
|
53906
|
-
var
|
|
53907
|
-
async function
|
|
54741
|
+
var name10 = KHR_MATERIALS_UNLIT;
|
|
54742
|
+
async function decode9(gltfData) {
|
|
53908
54743
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
53909
54744
|
const { json } = gltfScenegraph;
|
|
53910
54745
|
for (const material of json.materials || []) {
|
|
@@ -53933,13 +54768,13 @@ function encode4(gltfData) {
|
|
|
53933
54768
|
// ../gltf/src/lib/extensions/deprecated/KHR_techniques_webgl.ts
|
|
53934
54769
|
var KHR_techniques_webgl_exports = {};
|
|
53935
54770
|
__export(KHR_techniques_webgl_exports, {
|
|
53936
|
-
decode: () =>
|
|
54771
|
+
decode: () => decode10,
|
|
53937
54772
|
encode: () => encode5,
|
|
53938
|
-
name: () =>
|
|
54773
|
+
name: () => name11
|
|
53939
54774
|
});
|
|
53940
54775
|
var KHR_TECHNIQUES_WEBGL = "KHR_techniques_webgl";
|
|
53941
|
-
var
|
|
53942
|
-
async function
|
|
54776
|
+
var name11 = KHR_TECHNIQUES_WEBGL;
|
|
54777
|
+
async function decode10(gltfData) {
|
|
53943
54778
|
const gltfScenegraph = new GLTFScenegraph(gltfData);
|
|
53944
54779
|
const { json } = gltfScenegraph;
|
|
53945
54780
|
const extension = gltfScenegraph.getExtension(KHR_TECHNIQUES_WEBGL);
|
|
@@ -53992,213 +54827,10 @@ function resolveValues(technique, gltfScenegraph) {
|
|
|
53992
54827
|
return values;
|
|
53993
54828
|
}
|
|
53994
54829
|
|
|
53995
|
-
// ../gltf/src/lib/extensions/deprecated/EXT_feature_metadata.ts
|
|
53996
|
-
var EXT_feature_metadata_exports = {};
|
|
53997
|
-
__export(EXT_feature_metadata_exports, {
|
|
53998
|
-
decode: () => decode8,
|
|
53999
|
-
name: () => name9
|
|
54000
|
-
});
|
|
54001
|
-
var EXT_FEATURE_METADATA = "EXT_feature_metadata";
|
|
54002
|
-
var name9 = EXT_FEATURE_METADATA;
|
|
54003
|
-
async function decode8(gltfData, options) {
|
|
54004
|
-
const scenegraph = new GLTFScenegraph(gltfData);
|
|
54005
|
-
decodeExtFeatureMetadata(scenegraph, options);
|
|
54006
|
-
}
|
|
54007
|
-
function decodeExtFeatureMetadata(scenegraph, options) {
|
|
54008
|
-
const extension = scenegraph.getExtension(EXT_FEATURE_METADATA);
|
|
54009
|
-
if (!extension)
|
|
54010
|
-
return;
|
|
54011
|
-
const schemaClasses = extension.schema?.classes;
|
|
54012
|
-
const { featureTables } = extension;
|
|
54013
|
-
if (schemaClasses && featureTables) {
|
|
54014
|
-
for (const schemaName in schemaClasses) {
|
|
54015
|
-
const schemaClass = schemaClasses[schemaName];
|
|
54016
|
-
const featureTable = findFeatureTableByName(featureTables, schemaName);
|
|
54017
|
-
if (featureTable) {
|
|
54018
|
-
handleFeatureTableProperties(scenegraph, featureTable, schemaClass);
|
|
54019
|
-
}
|
|
54020
|
-
}
|
|
54021
|
-
}
|
|
54022
|
-
const { featureTextures } = extension;
|
|
54023
|
-
if (schemaClasses && featureTextures && options.gltf?.loadImages) {
|
|
54024
|
-
for (const schemaName in schemaClasses) {
|
|
54025
|
-
const schemaClass = schemaClasses[schemaName];
|
|
54026
|
-
const featureTexture = findFeatureTextureByName(featureTextures, schemaName);
|
|
54027
|
-
if (featureTexture) {
|
|
54028
|
-
handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass);
|
|
54029
|
-
}
|
|
54030
|
-
}
|
|
54031
|
-
}
|
|
54032
|
-
}
|
|
54033
|
-
function handleFeatureTableProperties(scenegraph, featureTable, schemaClass) {
|
|
54034
|
-
for (const propertyName in schemaClass.properties) {
|
|
54035
|
-
const schemaProperty = schemaClass.properties[propertyName];
|
|
54036
|
-
const featureTableProperty = featureTable?.properties?.[propertyName];
|
|
54037
|
-
const numberOfFeatures = featureTable.count;
|
|
54038
|
-
if (featureTableProperty) {
|
|
54039
|
-
const data = getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty);
|
|
54040
|
-
featureTableProperty.data = data;
|
|
54041
|
-
}
|
|
54042
|
-
}
|
|
54043
|
-
}
|
|
54044
|
-
function handleFeatureTextureProperties(scenegraph, featureTexture, schemaClass) {
|
|
54045
|
-
const attributeName = featureTexture.class;
|
|
54046
|
-
for (const propertyName in schemaClass.properties) {
|
|
54047
|
-
const featureTextureProperty = featureTexture?.properties?.[propertyName];
|
|
54048
|
-
if (featureTextureProperty) {
|
|
54049
|
-
const data = getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName);
|
|
54050
|
-
featureTextureProperty.data = data;
|
|
54051
|
-
}
|
|
54052
|
-
}
|
|
54053
|
-
}
|
|
54054
|
-
function getPropertyDataFromBinarySource(scenegraph, schemaProperty, numberOfFeatures, featureTableProperty) {
|
|
54055
|
-
const bufferView = featureTableProperty.bufferView;
|
|
54056
|
-
const dataArray = scenegraph.getTypedArrayForBufferView(bufferView);
|
|
54057
|
-
switch (schemaProperty.type) {
|
|
54058
|
-
case "STRING": {
|
|
54059
|
-
const stringOffsetBufferView = featureTableProperty.stringOffsetBufferView;
|
|
54060
|
-
const offsetsData = scenegraph.getTypedArrayForBufferView(stringOffsetBufferView);
|
|
54061
|
-
return getStringAttributes(dataArray, offsetsData, numberOfFeatures);
|
|
54062
|
-
}
|
|
54063
|
-
default:
|
|
54064
|
-
}
|
|
54065
|
-
return dataArray;
|
|
54066
|
-
}
|
|
54067
|
-
function getPropertyDataFromTexture(scenegraph, featureTextureProperty, attributeName) {
|
|
54068
|
-
const json = scenegraph.gltf.json;
|
|
54069
|
-
if (!json.meshes) {
|
|
54070
|
-
return [];
|
|
54071
|
-
}
|
|
54072
|
-
const featureTextureTable = [];
|
|
54073
|
-
for (const mesh of json.meshes) {
|
|
54074
|
-
for (const primitive of mesh.primitives) {
|
|
54075
|
-
processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive);
|
|
54076
|
-
}
|
|
54077
|
-
}
|
|
54078
|
-
return featureTextureTable;
|
|
54079
|
-
}
|
|
54080
|
-
function processPrimitiveTextures(scenegraph, attributeName, featureTextureProperty, featureTextureTable, primitive) {
|
|
54081
|
-
const json = scenegraph.gltf.json;
|
|
54082
|
-
const textureData = [];
|
|
54083
|
-
const texCoordAccessorKey = `TEXCOORD_${featureTextureProperty.texture.texCoord}`;
|
|
54084
|
-
const texCoordAccessorIndex = primitive.attributes[texCoordAccessorKey];
|
|
54085
|
-
const texCoordBufferView = scenegraph.getBufferView(texCoordAccessorIndex);
|
|
54086
|
-
const texCoordArray = scenegraph.getTypedArrayForBufferView(texCoordBufferView);
|
|
54087
|
-
const textureCoordinates = new Float32Array(texCoordArray.buffer, texCoordArray.byteOffset, texCoordArray.length / 4);
|
|
54088
|
-
const textureIndex = featureTextureProperty.texture.index;
|
|
54089
|
-
const texture = json.textures?.[textureIndex];
|
|
54090
|
-
const imageIndex = texture?.source;
|
|
54091
|
-
if (typeof imageIndex !== "undefined") {
|
|
54092
|
-
const image = json.images?.[imageIndex];
|
|
54093
|
-
const mimeType = image?.mimeType;
|
|
54094
|
-
const parsedImage = scenegraph.gltf.images?.[imageIndex];
|
|
54095
|
-
if (parsedImage) {
|
|
54096
|
-
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
54097
|
-
const value = getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, featureTextureProperty.channels);
|
|
54098
|
-
textureData.push(value);
|
|
54099
|
-
}
|
|
54100
|
-
}
|
|
54101
|
-
}
|
|
54102
|
-
const featureIndices = [];
|
|
54103
|
-
for (const texelData of textureData) {
|
|
54104
|
-
let index = featureTextureTable.findIndex((item) => item === texelData);
|
|
54105
|
-
if (index === -1) {
|
|
54106
|
-
index = featureTextureTable.push(texelData) - 1;
|
|
54107
|
-
}
|
|
54108
|
-
featureIndices.push(index);
|
|
54109
|
-
}
|
|
54110
|
-
const typedArray = new Uint32Array(featureIndices);
|
|
54111
|
-
const bufferIndex = scenegraph.gltf.buffers.push({
|
|
54112
|
-
arrayBuffer: typedArray.buffer,
|
|
54113
|
-
byteOffset: 0,
|
|
54114
|
-
byteLength: typedArray.byteLength
|
|
54115
|
-
}) - 1;
|
|
54116
|
-
const bufferViewIndex = scenegraph.addBufferView(typedArray, bufferIndex, 0);
|
|
54117
|
-
const accessorIndex = scenegraph.addAccessor(bufferViewIndex, {
|
|
54118
|
-
size: 1,
|
|
54119
|
-
componentType: getComponentTypeFromArray(typedArray),
|
|
54120
|
-
count: typedArray.length
|
|
54121
|
-
});
|
|
54122
|
-
primitive.attributes[attributeName] = accessorIndex;
|
|
54123
|
-
}
|
|
54124
|
-
function getImageValueByCoordinates(parsedImage, mimeType, textureCoordinates, index, channels) {
|
|
54125
|
-
const CHANNELS_MAP = {
|
|
54126
|
-
r: { offset: 0, shift: 0 },
|
|
54127
|
-
g: { offset: 1, shift: 8 },
|
|
54128
|
-
b: { offset: 2, shift: 16 },
|
|
54129
|
-
a: { offset: 3, shift: 24 }
|
|
54130
|
-
};
|
|
54131
|
-
const u = textureCoordinates[index];
|
|
54132
|
-
const v = textureCoordinates[index + 1];
|
|
54133
|
-
let components = 1;
|
|
54134
|
-
if (mimeType && (mimeType.indexOf("image/jpeg") !== -1 || mimeType.indexOf("image/png") !== -1))
|
|
54135
|
-
components = 4;
|
|
54136
|
-
const offset = coordinatesToOffset(u, v, parsedImage, components);
|
|
54137
|
-
let value = 0;
|
|
54138
|
-
for (const c of channels) {
|
|
54139
|
-
const map = CHANNELS_MAP[c];
|
|
54140
|
-
const val = getVal(parsedImage, offset + map.offset);
|
|
54141
|
-
value |= val << map.shift;
|
|
54142
|
-
}
|
|
54143
|
-
return value;
|
|
54144
|
-
}
|
|
54145
|
-
function getVal(parsedImage, offset) {
|
|
54146
|
-
const imageData = getImageData(parsedImage);
|
|
54147
|
-
if (imageData.data.length <= offset) {
|
|
54148
|
-
throw new Error(`${imageData.data.length} <= ${offset}`);
|
|
54149
|
-
}
|
|
54150
|
-
return imageData.data[offset];
|
|
54151
|
-
}
|
|
54152
|
-
function coordinatesToOffset(u, v, parsedImage, componentsCount = 1) {
|
|
54153
|
-
const w = parsedImage.width;
|
|
54154
|
-
const iX = emod(u) * (w - 1);
|
|
54155
|
-
const indX = Math.round(iX);
|
|
54156
|
-
const h = parsedImage.height;
|
|
54157
|
-
const iY = emod(v) * (h - 1);
|
|
54158
|
-
const indY = Math.round(iY);
|
|
54159
|
-
const components = parsedImage.components ? parsedImage.components : componentsCount;
|
|
54160
|
-
const offset = (indY * w + indX) * components;
|
|
54161
|
-
return offset;
|
|
54162
|
-
}
|
|
54163
|
-
function emod(n) {
|
|
54164
|
-
const a = (n % 1 + 1) % 1;
|
|
54165
|
-
return a;
|
|
54166
|
-
}
|
|
54167
|
-
function findFeatureTableByName(featureTables, schemaClassName) {
|
|
54168
|
-
for (const featureTableName in featureTables) {
|
|
54169
|
-
const featureTable = featureTables[featureTableName];
|
|
54170
|
-
if (featureTable.class === schemaClassName) {
|
|
54171
|
-
return featureTable;
|
|
54172
|
-
}
|
|
54173
|
-
}
|
|
54174
|
-
return null;
|
|
54175
|
-
}
|
|
54176
|
-
function findFeatureTextureByName(featureTextures, schemaClassName) {
|
|
54177
|
-
for (const featureTexturesName in featureTextures) {
|
|
54178
|
-
const featureTable = featureTextures[featureTexturesName];
|
|
54179
|
-
if (featureTable.class === schemaClassName) {
|
|
54180
|
-
return featureTable;
|
|
54181
|
-
}
|
|
54182
|
-
}
|
|
54183
|
-
return null;
|
|
54184
|
-
}
|
|
54185
|
-
function getStringAttributes(data, offsetsData, stringsCount) {
|
|
54186
|
-
const stringsArray = [];
|
|
54187
|
-
const textDecoder = new TextDecoder("utf8");
|
|
54188
|
-
let stringOffset = 0;
|
|
54189
|
-
const bytesPerStringSize = 4;
|
|
54190
|
-
for (let index = 0; index < stringsCount; index++) {
|
|
54191
|
-
const stringByteSize = offsetsData[(index + 1) * bytesPerStringSize] - offsetsData[index * bytesPerStringSize];
|
|
54192
|
-
const stringData = data.subarray(stringOffset, stringByteSize + stringOffset);
|
|
54193
|
-
const stringAttribute = textDecoder.decode(stringData);
|
|
54194
|
-
stringsArray.push(stringAttribute);
|
|
54195
|
-
stringOffset += stringByteSize;
|
|
54196
|
-
}
|
|
54197
|
-
return stringsArray;
|
|
54198
|
-
}
|
|
54199
|
-
|
|
54200
54830
|
// ../gltf/src/lib/api/gltf-extensions.ts
|
|
54201
54831
|
var EXTENSIONS2 = [
|
|
54832
|
+
EXT_mesh_features_exports,
|
|
54833
|
+
EXT_structural_metadata_exports,
|
|
54202
54834
|
EXT_meshopt_compression_exports,
|
|
54203
54835
|
EXT_texture_webp_exports,
|
|
54204
54836
|
KHR_texture_basisu_exports,
|
|
@@ -54568,7 +55200,7 @@ var GLTFLoader = {
|
|
|
54568
55200
|
name: "glTF",
|
|
54569
55201
|
id: "gltf",
|
|
54570
55202
|
module: "gltf",
|
|
54571
|
-
version:
|
|
55203
|
+
version: VERSION9,
|
|
54572
55204
|
extensions: ["gltf", "glb"],
|
|
54573
55205
|
mimeTypes: ["model/gltf+json", "model/gltf-binary"],
|
|
54574
55206
|
text: true,
|
|
@@ -54666,7 +55298,7 @@ var GLTFWriter = {
|
|
|
54666
55298
|
name: "glTF",
|
|
54667
55299
|
id: "gltf",
|
|
54668
55300
|
module: "gltf",
|
|
54669
|
-
version:
|
|
55301
|
+
version: VERSION9,
|
|
54670
55302
|
extensions: ["glb"],
|
|
54671
55303
|
mimeTypes: ["model/gltf-binary"],
|
|
54672
55304
|
binary: true,
|
|
@@ -55275,7 +55907,7 @@ async function parseComposite3DTile(tile, arrayBuffer, byteOffset, options, cont
|
|
|
55275
55907
|
byteOffset += 4;
|
|
55276
55908
|
tile.tiles = [];
|
|
55277
55909
|
while (tile.tiles.length < tile.tilesLength && (tile.byteLength || 0) - byteOffset > 12) {
|
|
55278
|
-
const subtile = {};
|
|
55910
|
+
const subtile = { shape: "tile3d" };
|
|
55279
55911
|
tile.tiles.push(subtile);
|
|
55280
55912
|
byteOffset = await parse3DTile2(arrayBuffer, byteOffset, options, context, subtile);
|
|
55281
55913
|
}
|
|
@@ -55288,7 +55920,7 @@ async function parseGltf3DTile(tile, arrayBuffer, options, context) {
|
|
|
55288
55920
|
tile.gltfUpAxis = options?.["3d-tiles"]?.assetGltfUpAxis ? options["3d-tiles"].assetGltfUpAxis : "Y";
|
|
55289
55921
|
if (options?.["3d-tiles"]?.loadGLTF) {
|
|
55290
55922
|
if (!context) {
|
|
55291
|
-
return;
|
|
55923
|
+
return arrayBuffer.byteLength;
|
|
55292
55924
|
}
|
|
55293
55925
|
const gltfWithBuffers = await parseFromContext(arrayBuffer, GLTFLoader, options, context);
|
|
55294
55926
|
tile.gltf = postProcessGLTF(gltfWithBuffers);
|
|
@@ -55296,10 +55928,11 @@ async function parseGltf3DTile(tile, arrayBuffer, options, context) {
|
|
|
55296
55928
|
} else {
|
|
55297
55929
|
tile.gltfArrayBuffer = arrayBuffer;
|
|
55298
55930
|
}
|
|
55931
|
+
return arrayBuffer.byteLength;
|
|
55299
55932
|
}
|
|
55300
55933
|
|
|
55301
55934
|
// ../3d-tiles/src/lib/parsers/parse-3d-tile.ts
|
|
55302
|
-
async function parse3DTile(arrayBuffer, byteOffset = 0, options, context, tile = {}) {
|
|
55935
|
+
async function parse3DTile(arrayBuffer, byteOffset = 0, options, context, tile = { shape: "tile3d" }) {
|
|
55303
55936
|
tile.byteOffset = byteOffset;
|
|
55304
55937
|
tile.type = getMagicString3(arrayBuffer, byteOffset);
|
|
55305
55938
|
switch (tile.type) {
|
|
@@ -55553,7 +56186,7 @@ function autobind2(obj) {
|
|
|
55553
56186
|
for (const key of propNames) {
|
|
55554
56187
|
const value = object[key];
|
|
55555
56188
|
if (typeof value === "function") {
|
|
55556
|
-
if (!predefined.find((
|
|
56189
|
+
if (!predefined.find((name12) => key === name12)) {
|
|
55557
56190
|
object[key] = value.bind(obj);
|
|
55558
56191
|
}
|
|
55559
56192
|
}
|
|
@@ -57512,6 +58145,7 @@ async function parseTileset(data, options, context) {
|
|
|
57512
58145
|
const normalizedRoot = await normalizeTileHeaders(tilesetJson, basePath, options || {});
|
|
57513
58146
|
const tilesetJsonPostprocessed = {
|
|
57514
58147
|
...tilesetJson,
|
|
58148
|
+
shape: "tileset3d",
|
|
57515
58149
|
loader: Tiles3DLoader,
|
|
57516
58150
|
url: tilesetUrl,
|
|
57517
58151
|
queryString: context?.queryString || "",
|
|
@@ -57526,6 +58160,7 @@ async function parseTileset(data, options, context) {
|
|
|
57526
58160
|
async function parseTile(arrayBuffer, options, context) {
|
|
57527
58161
|
const tile = {
|
|
57528
58162
|
content: {
|
|
58163
|
+
shape: "tile3d",
|
|
57529
58164
|
featureIds: null
|
|
57530
58165
|
}
|
|
57531
58166
|
};
|
|
@@ -57617,94 +58252,6 @@ var CesiumIonLoader = {
|
|
|
57617
58252
|
}
|
|
57618
58253
|
};
|
|
57619
58254
|
|
|
57620
|
-
// ../zip/src/file-provider/file-handle.ts
|
|
57621
|
-
var import_fs3 = __toModule(require("fs"));
|
|
57622
|
-
var _FileHandle = class {
|
|
57623
|
-
constructor(fileDescriptor, stats) {
|
|
57624
|
-
this.read = (buffer, offset, length, position) => {
|
|
57625
|
-
return new Promise((s) => {
|
|
57626
|
-
(0, import_fs3.read)(this.fileDescriptor, buffer, offset, length, position, (_err, bytesRead, buffer2) => s({ bytesRead, buffer: buffer2 }));
|
|
57627
|
-
});
|
|
57628
|
-
};
|
|
57629
|
-
this.fileDescriptor = fileDescriptor;
|
|
57630
|
-
this.stats = stats;
|
|
57631
|
-
}
|
|
57632
|
-
async close() {
|
|
57633
|
-
return new Promise((resolve2) => {
|
|
57634
|
-
(0, import_fs3.close)(this.fileDescriptor, (_err) => resolve2());
|
|
57635
|
-
});
|
|
57636
|
-
}
|
|
57637
|
-
get stat() {
|
|
57638
|
-
return this.stats;
|
|
57639
|
-
}
|
|
57640
|
-
};
|
|
57641
|
-
var FileHandle = _FileHandle;
|
|
57642
|
-
FileHandle.open = async (path2) => {
|
|
57643
|
-
const [fd, stats] = await Promise.all([
|
|
57644
|
-
new Promise((s) => {
|
|
57645
|
-
(0, import_fs3.open)(path2, void 0, void 0, (_err, fd2) => s(fd2));
|
|
57646
|
-
}),
|
|
57647
|
-
new Promise((s) => {
|
|
57648
|
-
(0, import_fs3.stat)(path2, { bigint: true }, (_err, stats2) => s(stats2));
|
|
57649
|
-
})
|
|
57650
|
-
]);
|
|
57651
|
-
return new _FileHandle(fd, stats);
|
|
57652
|
-
};
|
|
57653
|
-
|
|
57654
|
-
// ../zip/src/file-provider/file-handle-file.ts
|
|
57655
|
-
var FileHandleFile = class {
|
|
57656
|
-
static async from(path2) {
|
|
57657
|
-
const fileDescriptor = await FileHandle.open(path2);
|
|
57658
|
-
return new FileHandleFile(fileDescriptor, fileDescriptor.stat.size);
|
|
57659
|
-
}
|
|
57660
|
-
constructor(fileDescriptor, size) {
|
|
57661
|
-
this.fileDescriptor = fileDescriptor;
|
|
57662
|
-
this.size = size;
|
|
57663
|
-
}
|
|
57664
|
-
async destroy() {
|
|
57665
|
-
await this.fileDescriptor.close();
|
|
57666
|
-
}
|
|
57667
|
-
async getUint8(offset) {
|
|
57668
|
-
const val = new Uint8Array((await this.fileDescriptor.read(Buffer.alloc(1), 0, 1, offset)).buffer.buffer).at(0);
|
|
57669
|
-
if (val === void 0) {
|
|
57670
|
-
throw new Error("something went wrong");
|
|
57671
|
-
}
|
|
57672
|
-
return val;
|
|
57673
|
-
}
|
|
57674
|
-
async getUint16(offset) {
|
|
57675
|
-
const val = new Uint16Array((await this.fileDescriptor.read(Buffer.alloc(2), 0, 2, offset)).buffer.buffer).at(0);
|
|
57676
|
-
if (val === void 0) {
|
|
57677
|
-
throw new Error("something went wrong");
|
|
57678
|
-
}
|
|
57679
|
-
return val;
|
|
57680
|
-
}
|
|
57681
|
-
async getUint32(offset) {
|
|
57682
|
-
const val = new Uint32Array((await this.fileDescriptor.read(Buffer.alloc(4), 0, 4, offset)).buffer.buffer).at(0);
|
|
57683
|
-
if (val === void 0) {
|
|
57684
|
-
throw new Error("something went wrong");
|
|
57685
|
-
}
|
|
57686
|
-
return val;
|
|
57687
|
-
}
|
|
57688
|
-
async getBigUint64(offset) {
|
|
57689
|
-
const val = new BigInt64Array((await this.fileDescriptor.read(Buffer.alloc(8), 0, 8, offset)).buffer.buffer).at(0);
|
|
57690
|
-
if (val === void 0) {
|
|
57691
|
-
throw new Error("something went wrong");
|
|
57692
|
-
}
|
|
57693
|
-
return val;
|
|
57694
|
-
}
|
|
57695
|
-
async slice(startOffsset, endOffset) {
|
|
57696
|
-
const bigLength = endOffset - startOffsset;
|
|
57697
|
-
if (bigLength > Number.MAX_SAFE_INTEGER) {
|
|
57698
|
-
throw new Error("too big slice");
|
|
57699
|
-
}
|
|
57700
|
-
const length = Number(bigLength);
|
|
57701
|
-
return (await this.fileDescriptor.read(Buffer.alloc(length), 0, length, startOffsset)).buffer.buffer;
|
|
57702
|
-
}
|
|
57703
|
-
get length() {
|
|
57704
|
-
return this.size;
|
|
57705
|
-
}
|
|
57706
|
-
};
|
|
57707
|
-
|
|
57708
58255
|
// ../zip/src/parse-zip/search-from-the-end.ts
|
|
57709
58256
|
var searchFromTheEnd = async (file, target) => {
|
|
57710
58257
|
const searchWindow = [
|
|
@@ -57895,11 +58442,6 @@ var findBin = (hashToSearch, hashArray) => {
|
|
|
57895
58442
|
return void 0;
|
|
57896
58443
|
};
|
|
57897
58444
|
|
|
57898
|
-
// ../zip/src/file-provider/file-provider.ts
|
|
57899
|
-
var isFileProvider = (fileProvider) => {
|
|
57900
|
-
return fileProvider?.getUint8 && fileProvider?.slice && fileProvider?.length;
|
|
57901
|
-
};
|
|
57902
|
-
|
|
57903
58445
|
// ../compression/src/lib/compression.ts
|
|
57904
58446
|
var Compression = class {
|
|
57905
58447
|
constructor(options) {
|
|
@@ -58836,7 +59378,7 @@ async function getTotalFilesSize(dirPath) {
|
|
|
58836
59378
|
}
|
|
58837
59379
|
|
|
58838
59380
|
// src/i3s-converter/helpers/geometry-converter.ts
|
|
58839
|
-
var
|
|
59381
|
+
var import_core16 = __toModule(require_es5());
|
|
58840
59382
|
var import_geospatial6 = __toModule(require_es52());
|
|
58841
59383
|
var import_md53 = __toModule(require_md5());
|
|
58842
59384
|
|
|
@@ -58919,6 +59461,11 @@ function makeAttributeObjects(attributes) {
|
|
|
58919
59461
|
let colorsList = new Uint8Array(colors);
|
|
58920
59462
|
let texCoordsList = new Float32Array(texCoords);
|
|
58921
59463
|
let uvRegionsList = new Uint16Array(uvRegions);
|
|
59464
|
+
let positionsOffset = 0;
|
|
59465
|
+
let normalsOffset = 0;
|
|
59466
|
+
let colorsOffset = 0;
|
|
59467
|
+
let uvRegionsOffset = 0;
|
|
59468
|
+
let texCoordsOffset = 0;
|
|
58922
59469
|
for (let index = 0; index < featureIds.length; index++) {
|
|
58923
59470
|
const startIndex = faceRange[index * 2];
|
|
58924
59471
|
const endIndex = faceRange[index * 2 + 1];
|
|
@@ -58929,19 +59476,19 @@ function makeAttributeObjects(attributes) {
|
|
|
58929
59476
|
const texCoordsCount = getSliceAttributeCount("texCoords", startIndex, endIndex);
|
|
58930
59477
|
groupedData.push({
|
|
58931
59478
|
featureId: featureIds[index],
|
|
58932
|
-
positions: positionsList.
|
|
58933
|
-
normals: normalsList.
|
|
58934
|
-
colors: colorsList.
|
|
58935
|
-
uvRegions: uvRegionsList.
|
|
58936
|
-
texCoords: texCoordsList.
|
|
59479
|
+
positions: positionsList.subarray(positionsOffset, positionsOffset + positionsCount),
|
|
59480
|
+
normals: normalsList.subarray(normalsOffset, normalsOffset + normalsCount),
|
|
59481
|
+
colors: colorsList.subarray(colorsOffset, colorsOffset + colorsCount),
|
|
59482
|
+
uvRegions: uvRegionsList.subarray(uvRegionsOffset, uvRegionsOffset + uvRegionsCount),
|
|
59483
|
+
texCoords: texCoordsList.subarray(texCoordsOffset, texCoordsOffset + texCoordsCount)
|
|
58937
59484
|
});
|
|
58938
|
-
|
|
58939
|
-
|
|
58940
|
-
|
|
58941
|
-
|
|
58942
|
-
|
|
59485
|
+
positionsOffset += positionsCount;
|
|
59486
|
+
normalsOffset += normalsCount;
|
|
59487
|
+
colorsOffset += colorsCount;
|
|
59488
|
+
uvRegionsOffset += uvRegionsCount;
|
|
59489
|
+
texCoordsOffset += texCoordsCount;
|
|
58943
59490
|
}
|
|
58944
|
-
return groupedData
|
|
59491
|
+
return groupedData;
|
|
58945
59492
|
}
|
|
58946
59493
|
function getSliceAttributeCount(attributeName, startIndex, endIndex) {
|
|
58947
59494
|
const itemsPerVertex4 = 4;
|
|
@@ -58962,70 +59509,86 @@ function getSliceAttributeCount(attributeName, startIndex, endIndex) {
|
|
|
58962
59509
|
}
|
|
58963
59510
|
}
|
|
58964
59511
|
function unifyObjectsByFeatureId(sortedData) {
|
|
58965
|
-
const
|
|
58966
|
-
for (
|
|
58967
|
-
const
|
|
58968
|
-
const existingObject = uniqueObjects.find((obj) => obj.featureId === currentObject.featureId);
|
|
59512
|
+
const groupedMetadata = [];
|
|
59513
|
+
for (const data of sortedData) {
|
|
59514
|
+
const existingObject = groupedMetadata.find((obj) => obj.featureId === data.featureId);
|
|
58969
59515
|
if (existingObject) {
|
|
58970
|
-
existingObject.
|
|
58971
|
-
existingObject.normals = concatenateTypedArrays(existingObject.normals, currentObject.normals);
|
|
58972
|
-
existingObject.colors = concatenateTypedArrays(existingObject.colors, currentObject.colors);
|
|
58973
|
-
existingObject.texCoords = concatenateTypedArrays(existingObject.texCoords, currentObject.texCoords);
|
|
58974
|
-
existingObject.uvRegions = concatenateTypedArrays(existingObject.uvRegions, currentObject.uvRegions);
|
|
59516
|
+
existingObject.attributes.push(data);
|
|
58975
59517
|
} else {
|
|
58976
|
-
|
|
59518
|
+
groupedMetadata.push({
|
|
59519
|
+
featureId: data.featureId,
|
|
59520
|
+
attributes: [data]
|
|
59521
|
+
});
|
|
58977
59522
|
}
|
|
58978
59523
|
}
|
|
59524
|
+
const uniqueObjects = [];
|
|
59525
|
+
for (const metatada of groupedMetadata) {
|
|
59526
|
+
const attributes = concatenateAttributes(metatada.attributes);
|
|
59527
|
+
uniqueObjects.push({
|
|
59528
|
+
featureId: metatada.featureId,
|
|
59529
|
+
...attributes
|
|
59530
|
+
});
|
|
59531
|
+
}
|
|
58979
59532
|
return uniqueObjects;
|
|
58980
59533
|
}
|
|
58981
59534
|
function groupAttributesAndRangesByFeatureId(unifiedObjects, featureCount) {
|
|
58982
59535
|
const firstAttributeObject = unifiedObjects[0];
|
|
58983
59536
|
const featureIds = [firstAttributeObject.featureId || 0];
|
|
58984
|
-
let positions = new Float32Array(firstAttributeObject.positions);
|
|
58985
|
-
let normals = new Float32Array(firstAttributeObject.normals);
|
|
58986
|
-
let colors = new Uint8Array(firstAttributeObject.colors);
|
|
58987
|
-
let uvRegions = new Uint16Array(firstAttributeObject.uvRegions);
|
|
58988
|
-
let texCoords = new Float32Array(firstAttributeObject.texCoords);
|
|
58989
59537
|
const range = [0];
|
|
58990
59538
|
let objIndex = 0;
|
|
58991
59539
|
let sum = 0;
|
|
58992
59540
|
for (let index = 1; index < unifiedObjects.length; index++) {
|
|
58993
59541
|
const currentAttributesObject = unifiedObjects[index];
|
|
58994
59542
|
featureIds.push(currentAttributesObject.featureId || 0);
|
|
58995
|
-
positions = concatenateTypedArrays(positions, currentAttributesObject.positions);
|
|
58996
|
-
normals = concatenateTypedArrays(normals, currentAttributesObject.normals);
|
|
58997
|
-
colors = concatenateTypedArrays(colors, currentAttributesObject.colors);
|
|
58998
|
-
uvRegions = concatenateTypedArrays(uvRegions, currentAttributesObject.uvRegions);
|
|
58999
|
-
texCoords = concatenateTypedArrays(texCoords, currentAttributesObject.texCoords);
|
|
59000
59543
|
const groupedObject = unifiedObjects[objIndex];
|
|
59001
59544
|
range.push(groupedObject.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE - 1 + sum);
|
|
59002
59545
|
range.push(groupedObject.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE + sum);
|
|
59003
59546
|
sum += groupedObject.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE;
|
|
59004
59547
|
objIndex += 1;
|
|
59005
59548
|
}
|
|
59006
|
-
|
|
59549
|
+
const attributes = concatenateAttributes(unifiedObjects);
|
|
59550
|
+
range.push(attributes.positions.length / POSITIONS_AND_NORMALS_PER_TRIANGLE - 1);
|
|
59007
59551
|
const faceRange = new Uint32Array(range);
|
|
59008
|
-
return { faceRange, featureIds,
|
|
59552
|
+
return { faceRange, featureIds, featureCount, ...attributes };
|
|
59553
|
+
}
|
|
59554
|
+
function concatenateAttributes(attributes) {
|
|
59555
|
+
const positionGroups = attributes.map(({ positions: positions2 }) => positions2);
|
|
59556
|
+
const positions = positionGroups.length > 1 ? concatenateTypedArrays(...positionGroups) : positionGroups[0];
|
|
59557
|
+
const normalGroups = attributes.map(({ normals: normals2 }) => normals2);
|
|
59558
|
+
const normals = normalGroups.length > 1 ? concatenateTypedArrays(...normalGroups) : normalGroups[0];
|
|
59559
|
+
const colorGroups = attributes.map(({ colors: colors2 }) => colors2);
|
|
59560
|
+
const colors = colorGroups.length > 1 ? concatenateTypedArrays(...colorGroups) : colorGroups[0];
|
|
59561
|
+
const texCoordGroups = attributes.map(({ texCoords: texCoords2 }) => texCoords2);
|
|
59562
|
+
const texCoords = texCoordGroups.length > 1 ? concatenateTypedArrays(...texCoordGroups) : texCoordGroups[0];
|
|
59563
|
+
const uvRegionGroups = attributes.map(({ uvRegions: uvRegions2 }) => uvRegions2);
|
|
59564
|
+
const uvRegions = uvRegionGroups.length > 1 ? concatenateTypedArrays(...uvRegionGroups) : uvRegionGroups[0];
|
|
59565
|
+
return {
|
|
59566
|
+
positions,
|
|
59567
|
+
normals,
|
|
59568
|
+
colors,
|
|
59569
|
+
texCoords,
|
|
59570
|
+
uvRegions
|
|
59571
|
+
};
|
|
59009
59572
|
}
|
|
59010
59573
|
|
|
59011
59574
|
// src/i3s-converter/helpers/coordinate-converter.ts
|
|
59012
|
-
var
|
|
59575
|
+
var import_core14 = __toModule(require_es5());
|
|
59013
59576
|
var import_geospatial4 = __toModule(require_es52());
|
|
59014
59577
|
var import_culling3 = __toModule(require_es53());
|
|
59015
59578
|
function createBoundingVolumes(sourceBoundingVolume, geoidHeightModel) {
|
|
59016
59579
|
let radius;
|
|
59017
59580
|
let halfSize;
|
|
59018
59581
|
let quaternion;
|
|
59019
|
-
const cartographicCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(sourceBoundingVolume.center, new
|
|
59582
|
+
const cartographicCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(sourceBoundingVolume.center, new import_core14.Vector3());
|
|
59020
59583
|
cartographicCenter[2] = cartographicCenter[2] - geoidHeightModel.getHeight(cartographicCenter[1], cartographicCenter[0]);
|
|
59021
59584
|
if (sourceBoundingVolume instanceof import_culling3.OrientedBoundingBox) {
|
|
59022
59585
|
halfSize = sourceBoundingVolume.halfSize;
|
|
59023
|
-
radius = new
|
|
59586
|
+
radius = new import_core14.Vector3(halfSize[0], halfSize[1], halfSize[2]).len();
|
|
59024
59587
|
quaternion = sourceBoundingVolume.quaternion;
|
|
59025
59588
|
} else {
|
|
59026
59589
|
radius = sourceBoundingVolume.radius;
|
|
59027
59590
|
halfSize = [radius, radius, radius];
|
|
59028
|
-
quaternion = new
|
|
59591
|
+
quaternion = new import_core14.Quaternion().fromMatrix3(new import_core14.Matrix3([halfSize[0], 0, 0, 0, halfSize[1], 0, 0, 0, halfSize[2]])).normalize();
|
|
59029
59592
|
}
|
|
59030
59593
|
return {
|
|
59031
59594
|
mbs: [cartographicCenter[0], cartographicCenter[1], cartographicCenter[2], radius],
|
|
@@ -59040,8 +59603,8 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
|
|
|
59040
59603
|
const positionVectors = convertPositionsToVectors(cartesianPositions);
|
|
59041
59604
|
const geometryObb = (0, import_culling3.makeOrientedBoundingBoxFromPoints)(positionVectors);
|
|
59042
59605
|
const geometryMbs = (0, import_culling3.makeBoundingSphereFromPoints)(positionVectors);
|
|
59043
|
-
let mbsCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new
|
|
59044
|
-
let obbCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new
|
|
59606
|
+
let mbsCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryMbs.center, new import_core14.Vector3());
|
|
59607
|
+
let obbCenter = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(geometryObb.center, new import_core14.Vector3());
|
|
59045
59608
|
mbsCenter[2] = mbsCenter[2] - geoidHeightModel.getHeight(mbsCenter[1], mbsCenter[0]);
|
|
59046
59609
|
obbCenter[2] = obbCenter[2] - geoidHeightModel.getHeight(obbCenter[1], obbCenter[0]);
|
|
59047
59610
|
return {
|
|
@@ -59056,7 +59619,7 @@ function createBoundingVolumesFromGeometry(cartesianPositions, geoidHeightModel)
|
|
|
59056
59619
|
function convertPositionsToVectors(positions) {
|
|
59057
59620
|
const result = [];
|
|
59058
59621
|
for (let i = 0; i < positions.length; i += 3) {
|
|
59059
|
-
const positionVector = new
|
|
59622
|
+
const positionVector = new import_core14.Vector3([positions[i], positions[i + 1], positions[i + 2]]);
|
|
59060
59623
|
result.push(positionVector);
|
|
59061
59624
|
}
|
|
59062
59625
|
return result;
|
|
@@ -59070,8 +59633,8 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
|
|
|
59070
59633
|
}
|
|
59071
59634
|
const center = sphere.center;
|
|
59072
59635
|
const radius = sphere.radius;
|
|
59073
|
-
const vertexMax = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new
|
|
59074
|
-
const vertexMin = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new
|
|
59636
|
+
const vertexMax = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new import_core14.Vector3(center[0] + radius, center[1] + radius, center[2] + radius), new import_core14.Vector3());
|
|
59637
|
+
const vertexMin = import_geospatial4.Ellipsoid.WGS84.cartesianToCartographic(new import_core14.Vector3(center[0] - radius, center[1] - radius, center[2] - radius), new import_core14.Vector3());
|
|
59075
59638
|
return {
|
|
59076
59639
|
xmin: Math.min(vertexMin[0], vertexMax[0]),
|
|
59077
59640
|
xmax: Math.max(vertexMin[0], vertexMax[0]),
|
|
@@ -59083,13 +59646,13 @@ function convertBoundingVolumeToI3SFullExtent(boundingVolume) {
|
|
|
59083
59646
|
}
|
|
59084
59647
|
function createObbFromMbs(mbs) {
|
|
59085
59648
|
const radius = mbs[3];
|
|
59086
|
-
const center = new
|
|
59087
|
-
const halfAxex = new
|
|
59649
|
+
const center = new import_core14.Vector3(mbs[0], mbs[1], mbs[2]);
|
|
59650
|
+
const halfAxex = new import_core14.Matrix3([radius, 0, 0, 0, radius, 0, 0, 0, radius]);
|
|
59088
59651
|
return new import_culling3.OrientedBoundingBox(center, halfAxex);
|
|
59089
59652
|
}
|
|
59090
59653
|
|
|
59091
59654
|
// src/i3s-converter/helpers/gltf-attributes.ts
|
|
59092
|
-
var
|
|
59655
|
+
var import_core15 = __toModule(require_es5());
|
|
59093
59656
|
var import_geospatial5 = __toModule(require_es52());
|
|
59094
59657
|
function prepareDataForAttributesConversion(tileContent, tileTransform, boundingVolume) {
|
|
59095
59658
|
let nodes = tileContent.gltf?.scene?.nodes || tileContent.gltf?.scenes?.[0]?.nodes || tileContent.gltf?.nodes || [];
|
|
@@ -59131,7 +59694,7 @@ function getB3DMAttributesWithoutBufferView(attributes) {
|
|
|
59131
59694
|
function calculateTransformProps(tileContent, tileTransform, boundingVolume) {
|
|
59132
59695
|
const { rtcCenter, gltfUpAxis } = tileContent;
|
|
59133
59696
|
const { center } = boundingVolume;
|
|
59134
|
-
let modelMatrix = new
|
|
59697
|
+
let modelMatrix = new import_core15.Matrix4(tileTransform);
|
|
59135
59698
|
if (rtcCenter) {
|
|
59136
59699
|
modelMatrix.translate(rtcCenter);
|
|
59137
59700
|
}
|
|
@@ -59139,18 +59702,18 @@ function calculateTransformProps(tileContent, tileTransform, boundingVolume) {
|
|
|
59139
59702
|
case "Z":
|
|
59140
59703
|
break;
|
|
59141
59704
|
case "Y":
|
|
59142
|
-
const rotationY = new
|
|
59705
|
+
const rotationY = new import_core15.Matrix4().rotateX(Math.PI / 2);
|
|
59143
59706
|
modelMatrix = modelMatrix.multiplyRight(rotationY);
|
|
59144
59707
|
break;
|
|
59145
59708
|
case "X":
|
|
59146
|
-
const rotationX = new
|
|
59709
|
+
const rotationX = new import_core15.Matrix4().rotateY(-Math.PI / 2);
|
|
59147
59710
|
modelMatrix = modelMatrix.multiplyRight(rotationX);
|
|
59148
59711
|
break;
|
|
59149
59712
|
default:
|
|
59150
59713
|
break;
|
|
59151
59714
|
}
|
|
59152
|
-
const cartesianOrigin = new
|
|
59153
|
-
const cartographicOrigin = import_geospatial5.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new
|
|
59715
|
+
const cartesianOrigin = new import_core15.Vector3(center);
|
|
59716
|
+
const cartographicOrigin = import_geospatial5.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new import_core15.Vector3());
|
|
59154
59717
|
return { modelMatrix, cartographicOrigin };
|
|
59155
59718
|
}
|
|
59156
59719
|
function prepareNodes(nodes) {
|
|
@@ -59179,14 +59742,9 @@ function prepareNodes(nodes) {
|
|
|
59179
59742
|
}
|
|
59180
59743
|
}
|
|
59181
59744
|
|
|
59182
|
-
// src/constants.ts
|
|
59183
|
-
var BROWSER_ERROR_MESSAGE = "Tile converter does not work in browser, only in node js environment";
|
|
59184
|
-
var EXT_MESH_FEATURES = "EXT_mesh_features";
|
|
59185
|
-
var EXT_FEATURE_METADATA2 = "EXT_feature_metadata";
|
|
59186
|
-
|
|
59187
59745
|
// src/i3s-converter/helpers/batch-ids-extensions.ts
|
|
59188
59746
|
function getTextureByMetadataClass(tileContent, metadataClass) {
|
|
59189
|
-
const extFeatureMetadata = tileContent.gltf?.extensions?.[
|
|
59747
|
+
const extFeatureMetadata = tileContent.gltf?.extensions?.[name3];
|
|
59190
59748
|
if (!extFeatureMetadata?.featureTextures) {
|
|
59191
59749
|
return null;
|
|
59192
59750
|
}
|
|
@@ -59205,17 +59763,34 @@ function handleBatchIdsExtensions(attributes, primitive, images, featureTexture)
|
|
|
59205
59763
|
}
|
|
59206
59764
|
for (const [extensionName, extensionData] of Object.entries(extensions || {})) {
|
|
59207
59765
|
switch (extensionName) {
|
|
59208
|
-
case
|
|
59766
|
+
case name3:
|
|
59209
59767
|
return handleExtFeatureMetadataExtension(attributes, extensionData, images, featureTexture);
|
|
59210
|
-
case
|
|
59211
|
-
|
|
59212
|
-
|
|
59768
|
+
case name2:
|
|
59769
|
+
return handleExtMeshFeaturesExtension(attributes, extensionData);
|
|
59770
|
+
case name:
|
|
59771
|
+
return handleExtStructuralMetadataExtension(attributes, extensionData);
|
|
59213
59772
|
default:
|
|
59214
59773
|
return [];
|
|
59215
59774
|
}
|
|
59216
59775
|
}
|
|
59217
59776
|
return [];
|
|
59218
59777
|
}
|
|
59778
|
+
function handleExtStructuralMetadataExtension(attributes, extStructuralMetadata) {
|
|
59779
|
+
const dataAttributeNames = extStructuralMetadata?.dataAttributeNames;
|
|
59780
|
+
if (dataAttributeNames?.length) {
|
|
59781
|
+
const batchIdsAttribute = attributes[dataAttributeNames[0]];
|
|
59782
|
+
return batchIdsAttribute.value;
|
|
59783
|
+
}
|
|
59784
|
+
return [];
|
|
59785
|
+
}
|
|
59786
|
+
function handleExtMeshFeaturesExtension(attributes, extMeshFeatures) {
|
|
59787
|
+
const dataAttributeNames = extMeshFeatures?.dataAttributeNames;
|
|
59788
|
+
if (dataAttributeNames?.length) {
|
|
59789
|
+
const batchIdsAttribute = attributes[dataAttributeNames[0]];
|
|
59790
|
+
return batchIdsAttribute.value;
|
|
59791
|
+
}
|
|
59792
|
+
return [];
|
|
59793
|
+
}
|
|
59219
59794
|
function handleExtFeatureMetadataExtension(attributes, extFeatureMetadata, images, featureTexture) {
|
|
59220
59795
|
const featureIdAttribute = extFeatureMetadata?.featureIdAttributes?.[0];
|
|
59221
59796
|
if (featureIdAttribute?.featureIds?.attribute) {
|
|
@@ -59279,8 +59854,8 @@ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, image
|
|
|
59279
59854
|
for (let index = 0; index < textureCoordinates.length; index += 2) {
|
|
59280
59855
|
const u = textureCoordinates[index];
|
|
59281
59856
|
const v = textureCoordinates[index + 1];
|
|
59282
|
-
const tx = Math.min(
|
|
59283
|
-
const ty = Math.min(
|
|
59857
|
+
const tx = Math.min(emod(u) * image.width | 0, image.width - 1);
|
|
59858
|
+
const ty = Math.min(emod(v) * image.height | 0, image.height - 1);
|
|
59284
59859
|
const offset = (ty * image.width + tx) * image.components + channels;
|
|
59285
59860
|
const batchId = new Uint8Array(image.data)[offset];
|
|
59286
59861
|
batchIds.push(batchId);
|
|
@@ -59290,31 +59865,30 @@ function generateBatchIdsFromTexture(featureIdTexture, textureCoordinates, image
|
|
|
59290
59865
|
}
|
|
59291
59866
|
return batchIds;
|
|
59292
59867
|
}
|
|
59293
|
-
function emod2(n) {
|
|
59294
|
-
return (n % 1 + 1) % 1;
|
|
59295
|
-
}
|
|
59296
59868
|
|
|
59297
59869
|
// src/i3s-converter/helpers/feature-attributes.ts
|
|
59298
|
-
function flattenPropertyTableByFeatureIds(
|
|
59870
|
+
function flattenPropertyTableByFeatureIds(featureIdsMap, propertyTable) {
|
|
59299
59871
|
const resultPropertyTable = {};
|
|
59300
59872
|
for (const propertyName in propertyTable) {
|
|
59301
59873
|
const properties = propertyTable[propertyName];
|
|
59302
|
-
resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties,
|
|
59874
|
+
resultPropertyTable[propertyName] = getPropertiesByFeatureIds(properties, featureIdsMap);
|
|
59303
59875
|
}
|
|
59304
59876
|
return resultPropertyTable;
|
|
59305
59877
|
}
|
|
59306
|
-
function getPropertiesByFeatureIds(properties,
|
|
59878
|
+
function getPropertiesByFeatureIds(properties, featureIdsMap) {
|
|
59307
59879
|
const resultProperties = [];
|
|
59308
|
-
|
|
59309
|
-
const
|
|
59310
|
-
|
|
59880
|
+
if (properties) {
|
|
59881
|
+
for (const featureIdKey in featureIdsMap) {
|
|
59882
|
+
const property = properties[featureIdKey] || null;
|
|
59883
|
+
resultProperties.push(property);
|
|
59884
|
+
}
|
|
59311
59885
|
}
|
|
59312
59886
|
return resultProperties;
|
|
59313
59887
|
}
|
|
59314
59888
|
function checkPropertiesLength(featureIds, propertyTable) {
|
|
59315
59889
|
let needFlatten = false;
|
|
59316
59890
|
for (const attribute of Object.values(propertyTable)) {
|
|
59317
|
-
if (featureIds.length !== attribute.length) {
|
|
59891
|
+
if (!featureIds || !attribute || featureIds.length !== attribute.length) {
|
|
59318
59892
|
needFlatten = true;
|
|
59319
59893
|
}
|
|
59320
59894
|
}
|
|
@@ -59453,7 +60027,7 @@ var SHORT_INT_TYPE2 = "Int32";
|
|
|
59453
60027
|
var DOUBLE_TYPE2 = "Float64";
|
|
59454
60028
|
var OBJECT_ID_TYPE2 = "Oid32";
|
|
59455
60029
|
var BATCHED_ID_POSSIBLE_ATTRIBUTE_NAMES = ["CUSTOM_ATTRIBUTE_2", "_BATCHID", "BATCHID"];
|
|
59456
|
-
var scratchVector4 = new
|
|
60030
|
+
var scratchVector4 = new import_core16.Vector3();
|
|
59457
60031
|
async function convertB3dmToI3sGeometry(tileContent, tileTransform, tileBoundingVolume, addNodeToNodePage, propertyTable, featuresHashArray, attributeStorageInfo, draco, generateBoundingVolumes, shouldMergeMaterials, geoidHeightModel, libraries, metadataClass) {
|
|
59458
60032
|
const useCartesianPositions = generateBoundingVolumes;
|
|
59459
60033
|
const materialAndTextureList = await convertMaterials(tileContent.gltf?.materials, shouldMergeMaterials);
|
|
@@ -59522,8 +60096,9 @@ async function _makeNodeResources({
|
|
|
59522
60096
|
const boundingVolumes = convertedAttributes.boundingVolumes;
|
|
59523
60097
|
const vertexCount = convertedAttributes.positions.length / VALUES_PER_VERTEX2;
|
|
59524
60098
|
const { faceRange, featureIds, positions, normals, colors, uvRegions, texCoords, featureCount } = generateAttributes(convertedAttributes);
|
|
59525
|
-
|
|
59526
|
-
|
|
60099
|
+
let featureIdsMap = {};
|
|
60100
|
+
if (propertyTable) {
|
|
60101
|
+
featureIdsMap = makeFeatureIdsUnique(featureIds, convertedAttributes.featureIndices, featuresHashArray, propertyTable);
|
|
59527
60102
|
}
|
|
59528
60103
|
const header = new Uint32Array(2);
|
|
59529
60104
|
const typedFeatureIds = generateBigUint64Array(featureIds);
|
|
@@ -59540,7 +60115,7 @@ async function _makeNodeResources({
|
|
|
59540
60115
|
}, libraries) : null;
|
|
59541
60116
|
let attributes = [];
|
|
59542
60117
|
if (attributeStorageInfo && propertyTable) {
|
|
59543
|
-
attributes = convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo);
|
|
60118
|
+
attributes = convertPropertyTableToAttributeBuffers(featureIds, featureIdsMap, propertyTable, attributeStorageInfo);
|
|
59544
60119
|
}
|
|
59545
60120
|
return {
|
|
59546
60121
|
nodeId,
|
|
@@ -59592,7 +60167,7 @@ async function convertAttributes(attributesData, materialAndTextureList, useCart
|
|
|
59592
60167
|
}
|
|
59593
60168
|
return attributesMap;
|
|
59594
60169
|
}
|
|
59595
|
-
function convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new
|
|
60170
|
+
function convertNodes(nodes, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core16.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
|
|
59596
60171
|
if (nodes) {
|
|
59597
60172
|
for (const node2 of nodes) {
|
|
59598
60173
|
convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix, featureTexture);
|
|
@@ -59616,7 +60191,7 @@ function getCompositeTransformationMatrix(node2, matrix) {
|
|
|
59616
60191
|
}
|
|
59617
60192
|
return transformationMatrix;
|
|
59618
60193
|
}
|
|
59619
|
-
function convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new
|
|
60194
|
+
function convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, matrix = new import_core16.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
|
|
59620
60195
|
const transformationMatrix = getCompositeTransformationMatrix(node2, matrix);
|
|
59621
60196
|
const mesh = node2.mesh;
|
|
59622
60197
|
if (mesh) {
|
|
@@ -59624,7 +60199,7 @@ function convertNode(node2, images, cartographicOrigin, cartesianModelMatrix, at
|
|
|
59624
60199
|
}
|
|
59625
60200
|
convertNodes(node2.children || [], images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions, transformationMatrix, featureTexture);
|
|
59626
60201
|
}
|
|
59627
|
-
function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new
|
|
60202
|
+
function convertMesh(mesh, images, cartographicOrigin, cartesianModelMatrix, attributesMap, useCartesianPositions = false, matrix = new import_core16.Matrix4([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]), featureTexture) {
|
|
59628
60203
|
for (const primitive of mesh.primitives) {
|
|
59629
60204
|
let outputAttributes = null;
|
|
59630
60205
|
let materialUvRegion;
|
|
@@ -59702,7 +60277,7 @@ function transformVertexArray(args) {
|
|
|
59702
60277
|
for (let i = 0; i < indices.length; i++) {
|
|
59703
60278
|
const coordIndex = indices[i] * VALUES_PER_VERTEX2;
|
|
59704
60279
|
const vertex = vertices.subarray(coordIndex, coordIndex + VALUES_PER_VERTEX2);
|
|
59705
|
-
let vertexVector = new
|
|
60280
|
+
let vertexVector = new import_core16.Vector3(Array.from(vertex));
|
|
59706
60281
|
vertexVector = attributeSpecificTransformation(vertexVector, args);
|
|
59707
60282
|
newVertices[i * VALUES_PER_VERTEX2] = vertexVector.x;
|
|
59708
60283
|
newVertices[i * VALUES_PER_VERTEX2 + 1] = vertexVector.y;
|
|
@@ -59954,10 +60529,10 @@ function convertGLTFMaterialToI3sSharedResources(gltfMaterial, nodeId) {
|
|
|
59954
60529
|
}
|
|
59955
60530
|
function extractSharedResourcesMaterialInfo(baseColorFactor, metallicFactor = 1) {
|
|
59956
60531
|
const matDielectricColorComponent = 0.04 / 255;
|
|
59957
|
-
const black = new
|
|
59958
|
-
const unitVector = new
|
|
59959
|
-
const dielectricSpecular = new
|
|
59960
|
-
const baseColorVector = new
|
|
60532
|
+
const black = new import_core16.Vector4(0, 0, 0, 1);
|
|
60533
|
+
const unitVector = new import_core16.Vector4(1, 1, 1, 1);
|
|
60534
|
+
const dielectricSpecular = new import_core16.Vector4(matDielectricColorComponent, matDielectricColorComponent, matDielectricColorComponent, 0);
|
|
60535
|
+
const baseColorVector = new import_core16.Vector4(baseColorFactor);
|
|
59961
60536
|
const firstOperand = unitVector.subtract(dielectricSpecular).multiply(baseColorVector);
|
|
59962
60537
|
const diffuse = firstOperand.lerp(firstOperand, black, metallicFactor);
|
|
59963
60538
|
dielectricSpecular[3] = 1;
|
|
@@ -60004,6 +60579,7 @@ function makeFeatureIdsUnique(featureIds, featureIndices, featuresHashArray, bat
|
|
|
60004
60579
|
const replaceMap = getFeaturesReplaceMap(featureIds, batchTable, featuresHashArray);
|
|
60005
60580
|
replaceIndicesByUnique(featureIndices, replaceMap);
|
|
60006
60581
|
replaceIndicesByUnique(featureIds, replaceMap);
|
|
60582
|
+
return replaceMap;
|
|
60007
60583
|
}
|
|
60008
60584
|
function getFeaturesReplaceMap(featureIds, batchTable, featuresHashArray) {
|
|
60009
60585
|
const featureMap = {};
|
|
@@ -60034,19 +60610,21 @@ function replaceIndicesByUnique(indicesArray, featureMap) {
|
|
|
60034
60610
|
indicesArray[index] = featureMap[indicesArray[index]];
|
|
60035
60611
|
}
|
|
60036
60612
|
}
|
|
60037
|
-
function convertPropertyTableToAttributeBuffers(featureIds, propertyTable, attributeStorageInfo) {
|
|
60613
|
+
function convertPropertyTableToAttributeBuffers(featureIds, featureIdsMap, propertyTable, attributeStorageInfo) {
|
|
60038
60614
|
const attributeBuffers = [];
|
|
60039
60615
|
const needFlattenPropertyTable = checkPropertiesLength(featureIds, propertyTable);
|
|
60040
|
-
const properties = needFlattenPropertyTable ? flattenPropertyTableByFeatureIds(
|
|
60616
|
+
const properties = needFlattenPropertyTable ? flattenPropertyTableByFeatureIds(featureIdsMap, propertyTable) : propertyTable;
|
|
60041
60617
|
const propertyTableWithObjectIds = {
|
|
60042
60618
|
OBJECTID: featureIds,
|
|
60043
60619
|
...properties
|
|
60044
60620
|
};
|
|
60045
60621
|
for (const propertyName in propertyTableWithObjectIds) {
|
|
60046
60622
|
const type = getAttributeType2(propertyName, attributeStorageInfo);
|
|
60047
|
-
|
|
60048
|
-
|
|
60049
|
-
|
|
60623
|
+
if (type) {
|
|
60624
|
+
const value = propertyTableWithObjectIds[propertyName];
|
|
60625
|
+
const attributeBuffer = generateAttributeBuffer(type, value);
|
|
60626
|
+
attributeBuffers.push(attributeBuffer);
|
|
60627
|
+
}
|
|
60050
60628
|
}
|
|
60051
60629
|
return attributeBuffers;
|
|
60052
60630
|
}
|
|
@@ -60070,6 +60648,14 @@ function generateAttributeBuffer(type, value) {
|
|
|
60070
60648
|
}
|
|
60071
60649
|
function getAttributeType2(key, attributeStorageInfo) {
|
|
60072
60650
|
const attribute = attributeStorageInfo.find((attr) => attr.name === key);
|
|
60651
|
+
if (!attribute) {
|
|
60652
|
+
console.error(`attribute is null, key=${key}, attributeStorageInfo=${JSON.stringify(attributeStorageInfo, null, 2)}`);
|
|
60653
|
+
return "";
|
|
60654
|
+
}
|
|
60655
|
+
if (!attribute.attributeValues) {
|
|
60656
|
+
console.error(`attributeValues is null, attribute=${attribute}`);
|
|
60657
|
+
return "";
|
|
60658
|
+
}
|
|
60073
60659
|
return attribute.attributeValues.valueType;
|
|
60074
60660
|
}
|
|
60075
60661
|
function generateShortIntegerAttributeBuffer(featureIds) {
|
|
@@ -60166,25 +60752,35 @@ function getPropertyTable(tileContent, metadataClass) {
|
|
|
60166
60752
|
if (!tileContent) {
|
|
60167
60753
|
return null;
|
|
60168
60754
|
}
|
|
60755
|
+
let propertyTable;
|
|
60169
60756
|
const batchTableJson = tileContent?.batchTableJson;
|
|
60170
60757
|
if (batchTableJson) {
|
|
60171
60758
|
return batchTableJson;
|
|
60172
60759
|
}
|
|
60173
60760
|
const { extensionName, extension } = getPropertyTableExtension(tileContent);
|
|
60174
60761
|
switch (extensionName) {
|
|
60175
|
-
case
|
|
60176
|
-
|
|
60177
|
-
return
|
|
60762
|
+
case name2: {
|
|
60763
|
+
propertyTable = getPropertyTableFromExtMeshFeatures(extension, metadataClass);
|
|
60764
|
+
return propertyTable;
|
|
60178
60765
|
}
|
|
60179
|
-
case
|
|
60180
|
-
|
|
60766
|
+
case name: {
|
|
60767
|
+
propertyTable = getPropertyTableFromExtStructuralMetadata(extension, metadataClass);
|
|
60768
|
+
return propertyTable;
|
|
60769
|
+
}
|
|
60770
|
+
case name3: {
|
|
60771
|
+
propertyTable = getPropertyTableFromExtFeatureMetadata(extension, metadataClass);
|
|
60772
|
+
return propertyTable;
|
|
60181
60773
|
}
|
|
60182
60774
|
default:
|
|
60183
60775
|
return null;
|
|
60184
60776
|
}
|
|
60185
60777
|
}
|
|
60186
60778
|
function getPropertyTableExtension(tileContent) {
|
|
60187
|
-
const extensionsWithPropertyTables = [
|
|
60779
|
+
const extensionsWithPropertyTables = [
|
|
60780
|
+
name3,
|
|
60781
|
+
name,
|
|
60782
|
+
name2
|
|
60783
|
+
];
|
|
60188
60784
|
const extensionsUsed = tileContent?.gltf?.extensionsUsed;
|
|
60189
60785
|
if (!extensionsUsed) {
|
|
60190
60786
|
return { extensionName: null, extension: null };
|
|
@@ -60234,6 +60830,40 @@ function getPropertyTableFromExtFeatureMetadata(extension, metadataClass) {
|
|
|
60234
60830
|
console.warn("The I3S converter couldn't handle EXT_feature_metadata extension: There is neither featureTables, no featureTextures in the extension.");
|
|
60235
60831
|
return null;
|
|
60236
60832
|
}
|
|
60833
|
+
function getPropertyTableFromExtStructuralMetadata(extension, metadataClass) {
|
|
60834
|
+
if (extension?.propertyTables) {
|
|
60835
|
+
const firstPropertyTable = extension?.propertyTables[0];
|
|
60836
|
+
const propertyTableWithData = {};
|
|
60837
|
+
for (const propertyName in firstPropertyTable.properties) {
|
|
60838
|
+
propertyTableWithData[propertyName] = firstPropertyTable.properties[propertyName].data;
|
|
60839
|
+
}
|
|
60840
|
+
return propertyTableWithData;
|
|
60841
|
+
}
|
|
60842
|
+
if (extension?.propertyTextures) {
|
|
60843
|
+
if (extension?.propertyTextures) {
|
|
60844
|
+
const firstPropertyTexture = extension?.propertyTextures[0];
|
|
60845
|
+
const propertyTableWithData = {};
|
|
60846
|
+
for (const propertyName in firstPropertyTexture.properties) {
|
|
60847
|
+
propertyTableWithData[propertyName] = firstPropertyTexture.properties[propertyName].data;
|
|
60848
|
+
}
|
|
60849
|
+
return propertyTableWithData;
|
|
60850
|
+
}
|
|
60851
|
+
}
|
|
60852
|
+
console.warn("The I3S converter couldn't handle EXT_structural_metadata extension: There is neither propertyTables, no propertyTextures in the extension.");
|
|
60853
|
+
return null;
|
|
60854
|
+
}
|
|
60855
|
+
function getPropertyTableFromExtMeshFeatures(extension, metadataClass) {
|
|
60856
|
+
if (extension?.featureIds) {
|
|
60857
|
+
const firstFeatureId = extension?.featureIds[0];
|
|
60858
|
+
const propertyTableWithData = {};
|
|
60859
|
+
if (!firstFeatureId.propertyTable) {
|
|
60860
|
+
console.warn("Should be implemented as we have the tileset with Ext_mesh_features not linked with EXT_structural_metadata extension");
|
|
60861
|
+
}
|
|
60862
|
+
return propertyTableWithData;
|
|
60863
|
+
}
|
|
60864
|
+
console.warn("The I3S converter couldn't handle EXT_mesh_features extension: There is no featureIds in the extension.");
|
|
60865
|
+
return null;
|
|
60866
|
+
}
|
|
60237
60867
|
|
|
60238
60868
|
// src/i3s-converter/helpers/create-scene-server-path.ts
|
|
60239
60869
|
var import_json_map_transform2 = __toModule(require_json_map_transform());
|
|
@@ -60327,10 +60957,12 @@ var PGMLoader = {
|
|
|
60327
60957
|
module: "tile-converter",
|
|
60328
60958
|
version: VERSION12,
|
|
60329
60959
|
mimeTypes: ["image/x-portable-graymap"],
|
|
60330
|
-
parse: async (arrayBuffer, options) => (0, import_geoid.parsePGM)(new Uint8Array(arrayBuffer), options),
|
|
60960
|
+
parse: async (arrayBuffer, options) => (0, import_geoid.parsePGM)(new Uint8Array(arrayBuffer), options?.pgm || {}),
|
|
60331
60961
|
extensions: ["pgm"],
|
|
60332
60962
|
options: {
|
|
60333
|
-
|
|
60963
|
+
pgm: {
|
|
60964
|
+
cubic: false
|
|
60965
|
+
}
|
|
60334
60966
|
}
|
|
60335
60967
|
};
|
|
60336
60968
|
|
|
@@ -60779,7 +61411,7 @@ function transfromTextureDefinitions(textureDefinitionInfos, thisObject, origina
|
|
|
60779
61411
|
|
|
60780
61412
|
// src/i3s-converter/helpers/node-debug.ts
|
|
60781
61413
|
var import_culling4 = __toModule(require_es53());
|
|
60782
|
-
var
|
|
61414
|
+
var import_core18 = __toModule(require_es5());
|
|
60783
61415
|
var import_geospatial7 = __toModule(require_es52());
|
|
60784
61416
|
var CUBE_POSITIONS = new Float32Array([
|
|
60785
61417
|
-1,
|
|
@@ -60896,7 +61528,7 @@ function getTileObbVertices(node2) {
|
|
|
60896
61528
|
const obbCenterCartesian = import_geospatial7.Ellipsoid.WGS84.cartographicToCartesian(node2.obb.center);
|
|
60897
61529
|
let vertices = [];
|
|
60898
61530
|
for (let i = 0; i < positions.length; i += 3) {
|
|
60899
|
-
const positionsVector = new
|
|
61531
|
+
const positionsVector = new import_core18.Vector3(positions[i] *= halfSize[0], positions[i + 1] *= halfSize[1], positions[i + 2] *= halfSize[2]);
|
|
60900
61532
|
const rotatedPositions = positionsVector.transformByQuaternion(node2.obb.quaternion).add(obbCenterCartesian);
|
|
60901
61533
|
vertices = vertices.concat(rotatedPositions);
|
|
60902
61534
|
}
|
|
@@ -61016,6 +61648,9 @@ var WriteQueue = class extends Queue {
|
|
|
61016
61648
|
}
|
|
61017
61649
|
};
|
|
61018
61650
|
|
|
61651
|
+
// src/constants.ts
|
|
61652
|
+
var BROWSER_ERROR_MESSAGE = "Tile converter does not work in browser, only in node js environment";
|
|
61653
|
+
|
|
61019
61654
|
// src/i3s-converter/helpers/node-index-document.ts
|
|
61020
61655
|
var import_path7 = __toModule(require("path"));
|
|
61021
61656
|
var import_json_map_transform7 = __toModule(require_json_map_transform());
|
|
@@ -61270,7 +61905,8 @@ var NodeIndexDocument = class {
|
|
|
61270
61905
|
}
|
|
61271
61906
|
if (attributes && attributes.length && parentNode.converter.layers0?.attributeStorageInfo?.length) {
|
|
61272
61907
|
node2.attributeData = [];
|
|
61273
|
-
|
|
61908
|
+
const minimumLength = attributes.length < parentNode.converter.layers0.attributeStorageInfo.length ? attributes.length : parentNode.converter.layers0.attributeStorageInfo.length;
|
|
61909
|
+
for (let index = 0; index < minimumLength; index++) {
|
|
61274
61910
|
const folderName = parentNode.converter.layers0.attributeStorageInfo[index].key;
|
|
61275
61911
|
node2.attributeData.push({ href: `./attributes/${folderName}/0` });
|
|
61276
61912
|
}
|
|
@@ -61344,7 +61980,7 @@ function isNestedTileset(tile) {
|
|
|
61344
61980
|
}
|
|
61345
61981
|
|
|
61346
61982
|
// src/i3s-converter/i3s-converter.ts
|
|
61347
|
-
var
|
|
61983
|
+
var import_core22 = __toModule(require_es5());
|
|
61348
61984
|
|
|
61349
61985
|
// src/i3s-converter/helpers/tileset-traversal.ts
|
|
61350
61986
|
var traverseDatasetWith = async (tile, traversalProps, processTile, postprocessTile, maxDepth, level = 0) => {
|
|
@@ -61407,7 +62043,7 @@ var getMeshTypesFromGltf = (gltfJson) => {
|
|
|
61407
62043
|
};
|
|
61408
62044
|
var getMetadataClassesFromGltf = (gltfJson) => {
|
|
61409
62045
|
const result = new Set();
|
|
61410
|
-
const classes = gltfJson.extensions?.[
|
|
62046
|
+
const classes = gltfJson.extensions?.[name3]?.schema?.classes;
|
|
61411
62047
|
if (classes) {
|
|
61412
62048
|
for (const classKey of Object.keys(classes)) {
|
|
61413
62049
|
result.add(classKey);
|
|
@@ -61625,7 +62261,7 @@ var I3SConverter = class {
|
|
|
61625
62261
|
this.materialDefinitions = [];
|
|
61626
62262
|
this.materialMap = new Map();
|
|
61627
62263
|
const sourceRootTile = this.sourceTileset.root;
|
|
61628
|
-
const sourceBoundingVolume = createBoundingVolume(sourceRootTile.boundingVolume, new
|
|
62264
|
+
const sourceBoundingVolume = createBoundingVolume(sourceRootTile.boundingVolume, new import_core22.Matrix4(sourceRootTile.transform), null);
|
|
61629
62265
|
this._formLayers0(tilesetName, sourceBoundingVolume, this.sourceTileset?.root?.boundingVolume?.region);
|
|
61630
62266
|
const boundingVolumes = createBoundingVolumes(sourceBoundingVolume, this.geoidHeightModel);
|
|
61631
62267
|
await this.nodePages.push({
|
|
@@ -61636,7 +62272,7 @@ var I3SConverter = class {
|
|
|
61636
62272
|
});
|
|
61637
62273
|
const rootNode = await NodeIndexDocument.createRootNode(boundingVolumes, this);
|
|
61638
62274
|
await traverseDatasetWith(sourceRootTile, {
|
|
61639
|
-
transform: new
|
|
62275
|
+
transform: new import_core22.Matrix4(sourceRootTile.transform),
|
|
61640
62276
|
parentNodes: [rootNode]
|
|
61641
62277
|
}, this.convertTile.bind(this), this.finalizeTile.bind(this), this.options.maxDepth);
|
|
61642
62278
|
this.layers0.materialDefinitions = this.materialDefinitions;
|
|
@@ -61756,7 +62392,7 @@ var I3SConverter = class {
|
|
|
61756
62392
|
const sourceBoundingVolume = createBoundingVolume(sourceTile.boundingVolume, transformationMatrix, null);
|
|
61757
62393
|
let boundingVolumes = createBoundingVolumes(sourceBoundingVolume, this.geoidHeightModel);
|
|
61758
62394
|
const propertyTable = getPropertyTable(tileContent, this.options.metadataClass);
|
|
61759
|
-
if (propertyTable
|
|
62395
|
+
if (propertyTable) {
|
|
61760
62396
|
this._convertPropertyTableToNodeAttributes(propertyTable);
|
|
61761
62397
|
}
|
|
61762
62398
|
const resourcesData = await this._convertResources(sourceTile, transformationMatrix, sourceBoundingVolume, tileContent, parentNode.inPageId, propertyTable);
|
|
@@ -61967,16 +62603,16 @@ var I3SConverter = class {
|
|
|
61967
62603
|
}
|
|
61968
62604
|
}
|
|
61969
62605
|
}
|
|
61970
|
-
async writeTextureFile(textureData,
|
|
62606
|
+
async writeTextureFile(textureData, name12, format, childPath, slpkChildPath) {
|
|
61971
62607
|
if (this.options.slpk) {
|
|
61972
62608
|
const slpkTexturePath = (0, import_path8.join)(childPath, "textures");
|
|
61973
62609
|
const compress = false;
|
|
61974
62610
|
await this.writeQueue.enqueue({
|
|
61975
|
-
archiveKey: `${slpkChildPath}/textures/${
|
|
61976
|
-
writePromise: () => writeFileForSlpk(slpkTexturePath, textureData, `${
|
|
62611
|
+
archiveKey: `${slpkChildPath}/textures/${name12}.${format}`,
|
|
62612
|
+
writePromise: () => writeFileForSlpk(slpkTexturePath, textureData, `${name12}.${format}`, compress)
|
|
61977
62613
|
});
|
|
61978
62614
|
} else {
|
|
61979
|
-
const texturePath = (0, import_path8.join)(childPath, `textures/${
|
|
62615
|
+
const texturePath = (0, import_path8.join)(childPath, `textures/${name12}/`);
|
|
61980
62616
|
await this.writeQueue.enqueue({
|
|
61981
62617
|
writePromise: () => writeFile3(texturePath, textureData, `index.${format}`)
|
|
61982
62618
|
});
|
|
@@ -61984,7 +62620,8 @@ var I3SConverter = class {
|
|
|
61984
62620
|
}
|
|
61985
62621
|
async _writeAttributes(attributes = [], childPath, slpkChildPath) {
|
|
61986
62622
|
if (attributes?.length && this.layers0?.attributeStorageInfo?.length) {
|
|
61987
|
-
|
|
62623
|
+
const minimumLength = attributes.length < this.layers0.attributeStorageInfo.length ? attributes.length : this.layers0.attributeStorageInfo.length;
|
|
62624
|
+
for (let index = 0; index < minimumLength; index++) {
|
|
61988
62625
|
const folderName = this.layers0.attributeStorageInfo[index].key;
|
|
61989
62626
|
const fileBuffer = new Uint8Array(attributes[index]);
|
|
61990
62627
|
if (this.options.slpk) {
|
|
@@ -62040,16 +62677,19 @@ var I3SConverter = class {
|
|
|
62040
62677
|
...propertyTable
|
|
62041
62678
|
};
|
|
62042
62679
|
for (const key in propertyTableWithObjectId) {
|
|
62043
|
-
const
|
|
62044
|
-
|
|
62045
|
-
|
|
62046
|
-
|
|
62047
|
-
|
|
62048
|
-
|
|
62049
|
-
|
|
62050
|
-
|
|
62051
|
-
|
|
62052
|
-
|
|
62680
|
+
const found = this.layers0.attributeStorageInfo.find((element) => element.name === key);
|
|
62681
|
+
if (!found) {
|
|
62682
|
+
const firstAttribute = propertyTableWithObjectId[key][0];
|
|
62683
|
+
const attributeType = getAttributeType(key, firstAttribute);
|
|
62684
|
+
const storageAttribute = createdStorageAttribute(attributeIndex, key, attributeType);
|
|
62685
|
+
const fieldAttributeType = getFieldAttributeType(attributeType);
|
|
62686
|
+
const fieldAttribute = createFieldAttribute(key, fieldAttributeType);
|
|
62687
|
+
const popupInfo = createPopupInfo(propertyTableWithObjectId);
|
|
62688
|
+
this.layers0.attributeStorageInfo.push(storageAttribute);
|
|
62689
|
+
this.layers0.fields.push(fieldAttribute);
|
|
62690
|
+
this.layers0.popupInfo = popupInfo;
|
|
62691
|
+
this.layers0.layerType = _3D_OBJECT_LAYER_TYPE;
|
|
62692
|
+
}
|
|
62053
62693
|
attributeIndex += 1;
|
|
62054
62694
|
}
|
|
62055
62695
|
}
|
|
@@ -62112,7 +62752,7 @@ var import_process3 = __toModule(require("process"));
|
|
|
62112
62752
|
var import_json_map_transform10 = __toModule(require_json_map_transform());
|
|
62113
62753
|
|
|
62114
62754
|
// ../i3s/src/lib/parsers/constants.ts
|
|
62115
|
-
var
|
|
62755
|
+
var import_constants11 = __toModule(require_es55());
|
|
62116
62756
|
function getConstructorForDataFormat(dataType) {
|
|
62117
62757
|
switch (dataType) {
|
|
62118
62758
|
case "UInt8":
|
|
@@ -62130,11 +62770,11 @@ function getConstructorForDataFormat(dataType) {
|
|
|
62130
62770
|
}
|
|
62131
62771
|
}
|
|
62132
62772
|
var GL_TYPE_MAP = {
|
|
62133
|
-
UInt8:
|
|
62134
|
-
UInt16:
|
|
62135
|
-
Float32:
|
|
62136
|
-
UInt32:
|
|
62137
|
-
UInt64:
|
|
62773
|
+
UInt8: import_constants11.default.UNSIGNED_BYTE,
|
|
62774
|
+
UInt16: import_constants11.default.UNSIGNED_SHORT,
|
|
62775
|
+
Float32: import_constants11.default.FLOAT,
|
|
62776
|
+
UInt32: import_constants11.default.UNSIGNED_INT,
|
|
62777
|
+
UInt64: import_constants11.default.DOUBLE
|
|
62138
62778
|
};
|
|
62139
62779
|
function sizeOf(dataType) {
|
|
62140
62780
|
switch (dataType) {
|
|
@@ -62169,7 +62809,7 @@ var COORDINATE_SYSTEM;
|
|
|
62169
62809
|
})(COORDINATE_SYSTEM || (COORDINATE_SYSTEM = {}));
|
|
62170
62810
|
|
|
62171
62811
|
// ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
|
|
62172
|
-
var
|
|
62812
|
+
var import_core25 = __toModule(require_es5());
|
|
62173
62813
|
var import_geospatial8 = __toModule(require_es52());
|
|
62174
62814
|
|
|
62175
62815
|
// ../i3s/src/types.ts
|
|
@@ -62286,7 +62926,7 @@ async function customizeColors(colors, featureIds, tileOptions, tilesetOptions,
|
|
|
62286
62926
|
if (!options?.i3s?.colorsByAttribute) {
|
|
62287
62927
|
return colors;
|
|
62288
62928
|
}
|
|
62289
|
-
const colorizeAttributeField = tilesetOptions.fields.find(({ name:
|
|
62929
|
+
const colorizeAttributeField = tilesetOptions.fields.find(({ name: name12 }) => name12 === options?.i3s?.colorsByAttribute?.attributeName);
|
|
62290
62930
|
if (!colorizeAttributeField || !["esriFieldTypeDouble", "esriFieldTypeInteger", "esriFieldTypeSmallInteger"].includes(colorizeAttributeField.type)) {
|
|
62291
62931
|
return colors;
|
|
62292
62932
|
}
|
|
@@ -62334,7 +62974,7 @@ function calculateColorForAttribute(attributeValue, options) {
|
|
|
62334
62974
|
return color;
|
|
62335
62975
|
}
|
|
62336
62976
|
async function loadFeatureAttributeData(attributeName, { attributeUrls }, { attributeStorageInfo }, options) {
|
|
62337
|
-
const attributeIndex = attributeStorageInfo.findIndex(({ name:
|
|
62977
|
+
const attributeIndex = attributeStorageInfo.findIndex(({ name: name12 }) => attributeName === name12);
|
|
62338
62978
|
if (attributeIndex === -1) {
|
|
62339
62979
|
return null;
|
|
62340
62980
|
}
|
|
@@ -62348,7 +62988,7 @@ async function loadFeatureAttributeData(attributeName, { attributeUrls }, { attr
|
|
|
62348
62988
|
}
|
|
62349
62989
|
|
|
62350
62990
|
// ../i3s/src/lib/parsers/parse-i3s-tile-content.ts
|
|
62351
|
-
var scratchVector5 = new
|
|
62991
|
+
var scratchVector5 = new import_core25.Vector3([0, 0, 0]);
|
|
62352
62992
|
function getLoaderForTextureFormat(textureFormat) {
|
|
62353
62993
|
switch (textureFormat) {
|
|
62354
62994
|
case "ktx-etc2":
|
|
@@ -62369,7 +63009,7 @@ async function parseI3STileContent(arrayBuffer, tileOptions, tilesetOptions, opt
|
|
|
62369
63009
|
indices: null,
|
|
62370
63010
|
featureIds: [],
|
|
62371
63011
|
vertexCount: 0,
|
|
62372
|
-
modelMatrix: new
|
|
63012
|
+
modelMatrix: new import_core25.Matrix4(),
|
|
62373
63013
|
coordinateSystem: 0,
|
|
62374
63014
|
byteLength: 0,
|
|
62375
63015
|
texture: null
|
|
@@ -62596,9 +63236,9 @@ function parsePositions2(attribute, options) {
|
|
|
62596
63236
|
const mbs = options.mbs;
|
|
62597
63237
|
const value = attribute.value;
|
|
62598
63238
|
const metadata = attribute.metadata;
|
|
62599
|
-
const enuMatrix = new
|
|
62600
|
-
const cartographicOrigin = new
|
|
62601
|
-
const cartesianOrigin = new
|
|
63239
|
+
const enuMatrix = new import_core25.Matrix4();
|
|
63240
|
+
const cartographicOrigin = new import_core25.Vector3(mbs[0], mbs[1], mbs[2]);
|
|
63241
|
+
const cartesianOrigin = new import_core25.Vector3();
|
|
62602
63242
|
import_geospatial8.Ellipsoid.WGS84.cartographicToCartesian(cartographicOrigin, cartesianOrigin);
|
|
62603
63243
|
import_geospatial8.Ellipsoid.WGS84.eastNorthUpToFixedFrame(cartesianOrigin, enuMatrix);
|
|
62604
63244
|
attribute.value = offsetsToCartesians(value, metadata, cartographicOrigin);
|
|
@@ -62625,7 +63265,7 @@ function getModelMatrix(positions) {
|
|
|
62625
63265
|
const metadata = positions.metadata;
|
|
62626
63266
|
const scaleX = metadata?.["i3s-scale_x"]?.double || 1;
|
|
62627
63267
|
const scaleY = metadata?.["i3s-scale_y"]?.double || 1;
|
|
62628
|
-
const modelMatrix = new
|
|
63268
|
+
const modelMatrix = new import_core25.Matrix4();
|
|
62629
63269
|
modelMatrix[0] = scaleX;
|
|
62630
63270
|
modelMatrix[5] = scaleY;
|
|
62631
63271
|
return modelMatrix;
|
|
@@ -62755,9 +63395,6 @@ var import_geospatial9 = __toModule(require_es52());
|
|
|
62755
63395
|
|
|
62756
63396
|
// ../i3s/src/i3s-node-page-loader.ts
|
|
62757
63397
|
var VERSION15 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
|
|
62758
|
-
async function parseNodePage(data, options) {
|
|
62759
|
-
return JSON.parse(new TextDecoder().decode(data));
|
|
62760
|
-
}
|
|
62761
63398
|
var I3SNodePageLoader = {
|
|
62762
63399
|
name: "I3S Node Page",
|
|
62763
63400
|
id: "i3s-node-page",
|
|
@@ -62766,8 +63403,13 @@ var I3SNodePageLoader = {
|
|
|
62766
63403
|
mimeTypes: ["application/json"],
|
|
62767
63404
|
parse: parseNodePage,
|
|
62768
63405
|
extensions: ["json"],
|
|
62769
|
-
options: {
|
|
63406
|
+
options: {
|
|
63407
|
+
i3s: {}
|
|
63408
|
+
}
|
|
62770
63409
|
};
|
|
63410
|
+
async function parseNodePage(data, options) {
|
|
63411
|
+
return JSON.parse(new TextDecoder().decode(data));
|
|
63412
|
+
}
|
|
62771
63413
|
|
|
62772
63414
|
// ../i3s/src/lib/helpers/i3s-nodepages-tiles.ts
|
|
62773
63415
|
var I3SNodePagesTiles = class {
|
|
@@ -63107,7 +63749,7 @@ function getMagicNumber(data) {
|
|
|
63107
63749
|
}
|
|
63108
63750
|
|
|
63109
63751
|
// src/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.ts
|
|
63110
|
-
var
|
|
63752
|
+
var import_core29 = __toModule(require_es5());
|
|
63111
63753
|
var import_geospatial10 = __toModule(require_es52());
|
|
63112
63754
|
var import_culling6 = __toModule(require_es53());
|
|
63113
63755
|
function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
|
|
@@ -63116,7 +63758,7 @@ function i3sObbTo3dTilesObb(i3SObb, geoidHeightModel) {
|
|
|
63116
63758
|
i3SObb.center[1],
|
|
63117
63759
|
i3SObb.center[2] + geoidHeightModel.getHeight(i3SObb.center[1], i3SObb.center[0])
|
|
63118
63760
|
];
|
|
63119
|
-
const cartesianCenter = import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new
|
|
63761
|
+
const cartesianCenter = import_geospatial10.Ellipsoid.WGS84.cartographicToCartesian(tiles3DCenter, new import_core29.Vector3());
|
|
63120
63762
|
const tiles3DObb = new import_culling6.OrientedBoundingBox().fromCenterHalfSizeQuaternion(cartesianCenter, i3SObb.halfSize, i3SObb.quaternion);
|
|
63121
63763
|
return [...tiles3DObb.center, ...tiles3DObb.halfAxes.toArray()];
|
|
63122
63764
|
}
|
|
@@ -63160,7 +63802,7 @@ var TILESET = () => ({
|
|
|
63160
63802
|
});
|
|
63161
63803
|
|
|
63162
63804
|
// src/3d-tiles-converter/helpers/b3dm-converter.ts
|
|
63163
|
-
var
|
|
63805
|
+
var import_core31 = __toModule(require_es5());
|
|
63164
63806
|
var import_geospatial11 = __toModule(require_es52());
|
|
63165
63807
|
|
|
63166
63808
|
// src/3d-tiles-converter/helpers/texture-atlas.ts
|
|
@@ -63195,8 +63837,8 @@ function normalizeRegions(regions) {
|
|
|
63195
63837
|
}
|
|
63196
63838
|
|
|
63197
63839
|
// src/3d-tiles-converter/helpers/b3dm-converter.ts
|
|
63198
|
-
var Z_UP_TO_Y_UP_MATRIX = new
|
|
63199
|
-
var scratchVector6 = new
|
|
63840
|
+
var Z_UP_TO_Y_UP_MATRIX = new import_core31.Matrix4([1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0, 1]);
|
|
63841
|
+
var scratchVector6 = new import_core31.Vector3();
|
|
63200
63842
|
var B3dmConverter = class {
|
|
63201
63843
|
async convert(i3sAttributesData, featureAttributes = null) {
|
|
63202
63844
|
const gltf = await this.buildGltf(i3sAttributesData, featureAttributes);
|
|
@@ -63220,8 +63862,8 @@ var B3dmConverter = class {
|
|
|
63220
63862
|
if (attributes.uvRegions && attributes.texCoords) {
|
|
63221
63863
|
attributes.texCoords.value = convertTextureAtlas(attributes.texCoords.value, attributes.uvRegions.value);
|
|
63222
63864
|
}
|
|
63223
|
-
const cartesianOrigin = new
|
|
63224
|
-
const cartographicOrigin = import_geospatial11.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new
|
|
63865
|
+
const cartesianOrigin = new import_core31.Vector3(box);
|
|
63866
|
+
const cartographicOrigin = import_geospatial11.Ellipsoid.WGS84.cartesianToCartographic(cartesianOrigin, new import_core31.Vector3());
|
|
63225
63867
|
attributes.positions.value = this._normalizePositions(positionsValue, cartesianOrigin, cartographicOrigin, modelMatrix);
|
|
63226
63868
|
this._createBatchIds(tileContent, featureAttributes);
|
|
63227
63869
|
if (attributes.normals && !this._checkNormals(attributes.normals.value)) {
|
|
@@ -63261,8 +63903,8 @@ var B3dmConverter = class {
|
|
|
63261
63903
|
const newPositionsValue = new Float32Array(positionsValue.length);
|
|
63262
63904
|
for (let index = 0; index < positionsValue.length; index += 3) {
|
|
63263
63905
|
const vertex = positionsValue.subarray(index, index + 3);
|
|
63264
|
-
const cartesianOriginVector = new
|
|
63265
|
-
let vertexVector = new
|
|
63906
|
+
const cartesianOriginVector = new import_core31.Vector3(cartesianOrigin);
|
|
63907
|
+
let vertexVector = new import_core31.Vector3(Array.from(vertex)).transform(modelMatrix).add(cartographicOrigin);
|
|
63266
63908
|
import_geospatial11.Ellipsoid.WGS84.cartographicToCartesian(vertexVector, scratchVector6);
|
|
63267
63909
|
vertexVector = scratchVector6.subtract(cartesianOriginVector);
|
|
63268
63910
|
newPositionsValue.set(vertexVector, index);
|
|
@@ -63270,7 +63912,7 @@ var B3dmConverter = class {
|
|
|
63270
63912
|
return newPositionsValue;
|
|
63271
63913
|
}
|
|
63272
63914
|
_generateTransformMatrix(cartesianOrigin) {
|
|
63273
|
-
const translateOriginMatrix = new
|
|
63915
|
+
const translateOriginMatrix = new import_core31.Matrix4().translate(cartesianOrigin);
|
|
63274
63916
|
const result = translateOriginMatrix.multiplyLeft(Z_UP_TO_Y_UP_MATRIX);
|
|
63275
63917
|
return result;
|
|
63276
63918
|
}
|