@loaders.gl/tile-converter 3.4.14 → 3.4.15
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-attributes-worker.js +1 -1
- package/dist/converter.min.js +78 -77
- package/dist/dist.min.js +2081 -1557
- package/dist/es5/3d-tiles-attributes-worker.js +3 -3
- package/dist/es5/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js +203 -417
- package/dist/es5/3d-tiles-converter/3d-tiles-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js +197 -266
- package/dist/es5/3d-tiles-converter/helpers/b3dm-converter.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js +4 -6
- package/dist/es5/3d-tiles-converter/helpers/i3s-obb-to-3d-tiles-obb.js.map +1 -1
- package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js +12 -12
- package/dist/es5/3d-tiles-converter/helpers/texture-atlas.js.map +1 -1
- package/dist/es5/3d-tiles-converter/json-templates/tileset.js +35 -51
- package/dist/es5/3d-tiles-converter/json-templates/tileset.js.map +1 -1
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/constants.js +1 -1
- package/dist/es5/constants.js.map +1 -1
- package/dist/es5/converter-cli.js +78 -133
- package/dist/es5/converter-cli.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +38 -110
- package/dist/es5/deps-installer/deps-installer.js.map +1 -1
- package/dist/es5/i3s-attributes-worker.js +3 -3
- package/dist/es5/i3s-attributes-worker.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js +31 -36
- package/dist/es5/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js +23 -23
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/create-scene-server-path.js +9 -27
- package/dist/es5/i3s-converter/helpers/create-scene-server-path.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/feature-attributes.js +27 -42
- package/dist/es5/i3s-converter/helpers/feature-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js +97 -114
- package/dist/es5/i3s-converter/helpers/geometry-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +523 -798
- package/dist/es5/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js +24 -25
- package/dist/es5/i3s-converter/helpers/gltf-attributes.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/node-debug.js +27 -25
- package/dist/es5/i3s-converter/helpers/node-debug.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/node-index-document.js +165 -461
- package/dist/es5/i3s-converter/helpers/node-index-document.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/node-pages.js +169 -474
- package/dist/es5/i3s-converter/helpers/node-pages.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +663 -1401
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/geometry-definitions.js +82 -92
- package/dist/es5/i3s-converter/json-templates/geometry-definitions.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/layers.js +130 -152
- package/dist/es5/i3s-converter/json-templates/layers.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/metadata.js +21 -23
- package/dist/es5/i3s-converter/json-templates/metadata.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/node.js +78 -89
- package/dist/es5/i3s-converter/json-templates/node.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/scene-server.js +27 -31
- package/dist/es5/i3s-converter/json-templates/scene-server.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/shared-resources.js +110 -152
- package/dist/es5/i3s-converter/json-templates/shared-resources.js.map +1 -1
- package/dist/es5/i3s-converter/json-templates/store.js +2 -4
- package/dist/es5/i3s-converter/json-templates/store.js.map +1 -1
- package/dist/es5/i3s-server/app.js +6 -6
- package/dist/es5/i3s-server/app.js.map +1 -1
- package/dist/es5/i3s-server/controllers/index-controller.js +20 -49
- package/dist/es5/i3s-server/controllers/index-controller.js.map +1 -1
- package/dist/es5/i3s-server/routes/index.js +14 -33
- package/dist/es5/i3s-server/routes/index.js.map +1 -1
- package/dist/es5/index.js +2 -2
- package/dist/es5/lib/utils/compress-util.js +127 -295
- package/dist/es5/lib/utils/compress-util.js.map +1 -1
- package/dist/es5/lib/utils/file-utils.js +65 -174
- package/dist/es5/lib/utils/file-utils.js.map +1 -1
- package/dist/es5/lib/utils/lod-conversion-utils.js +9 -9
- package/dist/es5/lib/utils/lod-conversion-utils.js.map +1 -1
- package/dist/es5/lib/utils/queue.js +13 -38
- package/dist/es5/lib/utils/queue.js.map +1 -1
- package/dist/es5/lib/utils/statistic-utills.js +39 -117
- package/dist/es5/lib/utils/statistic-utills.js.map +1 -1
- package/dist/es5/lib/utils/write-queue.js +74 -195
- package/dist/es5/lib/utils/write-queue.js.map +1 -1
- package/dist/es5/pgm-loader.js +3 -22
- package/dist/es5/pgm-loader.js.map +1 -1
- package/dist/es5/workers/3d-tiles-attributes-worker.js +5 -22
- package/dist/es5/workers/3d-tiles-attributes-worker.js.map +1 -1
- package/dist/es5/workers/i3s-attributes-worker.js +4 -25
- package/dist/es5/workers/i3s-attributes-worker.js.map +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +1 -1
- package/dist/esm/deps-installer/deps-installer.js +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/package.json +15 -15
|
@@ -1,16 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
14
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
9
|
var _core = require("@loaders.gl/core");
|
|
16
10
|
var _tiles = require("@loaders.gl/tiles");
|
|
@@ -43,22 +37,16 @@ var _constants = require("../constants");
|
|
|
43
37
|
var _featureAttributes = require("./helpers/feature-attributes");
|
|
44
38
|
var _nodeIndexDocument = require("./helpers/node-index-document");
|
|
45
39
|
var _process$env;
|
|
46
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function
|
|
47
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null ||
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
var _3D_OBJECT_LAYER_TYPE = '3DObject';
|
|
57
|
-
var REFRESH_TOKEN_TIMEOUT = 1800;
|
|
58
|
-
var CESIUM_DATASET_PREFIX = 'https://';
|
|
59
|
-
var I3SConverter = function () {
|
|
60
|
-
function I3SConverter() {
|
|
61
|
-
(0, _classCallCheck2.default)(this, I3SConverter);
|
|
40
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
42
|
+
const ION_DEFAULT_TOKEN = ((_process$env = _process.default.env) === null || _process$env === void 0 ? void 0 : _process$env.IonToken) || 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJlYWMxMzcyYy0zZjJkLTQwODctODNlNi01MDRkZmMzMjIxOWIiLCJpZCI6OTYyMCwic2NvcGVzIjpbImFzbCIsImFzciIsImdjIl0sImlhdCI6MTU2Mjg2NjI3M30.1FNiClUyk00YH_nWfSGpiQAjR5V2OvREDq1PJ5QMjWQ';
|
|
43
|
+
const HARDCODED_NODES_PER_PAGE = 64;
|
|
44
|
+
const _3D_TILES = '3DTILES';
|
|
45
|
+
const _3D_OBJECT_LAYER_TYPE = '3DObject';
|
|
46
|
+
const REFRESH_TOKEN_TIMEOUT = 1800;
|
|
47
|
+
const CESIUM_DATASET_PREFIX = 'https://';
|
|
48
|
+
class I3SConverter {
|
|
49
|
+
constructor() {
|
|
62
50
|
(0, _defineProperty2.default)(this, "nodePages", void 0);
|
|
63
51
|
(0, _defineProperty2.default)(this, "options", void 0);
|
|
64
52
|
(0, _defineProperty2.default)(this, "layers0Path", void 0);
|
|
@@ -103,1421 +91,695 @@ var I3SConverter = function () {
|
|
|
103
91
|
this.layersHasTexture = false;
|
|
104
92
|
this.compressList = null;
|
|
105
93
|
}
|
|
106
|
-
(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
var tilesetName, slpk, egmFilePath, inputUrl, validate, outputPath, _options$draco, draco, sevenZipExe, maxDepth, token, generateTextures, generateBoundingVolumes, _options$instantNodeW, instantNodeWriting, _options$mergeMateria, mergeMaterials, _sourceTilesetJson$ro, _sourceTilesetJson$ro2, preloadOptions, tilesetOptions, tilesetUrl, sourceTilesetJson, workerFarm;
|
|
111
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
112
|
-
while (1) switch (_context.prev = _context.next) {
|
|
113
|
-
case 0:
|
|
114
|
-
if (!_core.isBrowser) {
|
|
115
|
-
_context.next = 3;
|
|
116
|
-
break;
|
|
117
|
-
}
|
|
118
|
-
console.log(_constants.BROWSER_ERROR_MESSAGE);
|
|
119
|
-
return _context.abrupt("return", _constants.BROWSER_ERROR_MESSAGE);
|
|
120
|
-
case 3:
|
|
121
|
-
this.conversionStartTime = _process.default.hrtime();
|
|
122
|
-
tilesetName = options.tilesetName, slpk = options.slpk, egmFilePath = options.egmFilePath, inputUrl = options.inputUrl, validate = options.validate, outputPath = options.outputPath, _options$draco = options.draco, draco = _options$draco === void 0 ? true : _options$draco, sevenZipExe = options.sevenZipExe, maxDepth = options.maxDepth, token = options.token, generateTextures = options.generateTextures, generateBoundingVolumes = options.generateBoundingVolumes, _options$instantNodeW = options.instantNodeWriting, instantNodeWriting = _options$instantNodeW === void 0 ? false : _options$instantNodeW, _options$mergeMateria = options.mergeMaterials, mergeMaterials = _options$mergeMateria === void 0 ? true : _options$mergeMateria;
|
|
123
|
-
this.options = {
|
|
124
|
-
maxDepth: maxDepth,
|
|
125
|
-
slpk: slpk,
|
|
126
|
-
sevenZipExe: sevenZipExe,
|
|
127
|
-
egmFilePath: egmFilePath,
|
|
128
|
-
draco: draco,
|
|
129
|
-
token: token,
|
|
130
|
-
inputUrl: inputUrl,
|
|
131
|
-
instantNodeWriting: instantNodeWriting,
|
|
132
|
-
mergeMaterials: mergeMaterials
|
|
133
|
-
};
|
|
134
|
-
this.compressList = this.options.instantNodeWriting && [] || null;
|
|
135
|
-
this.validate = Boolean(validate);
|
|
136
|
-
this.Loader = inputUrl.indexOf(CESIUM_DATASET_PREFIX) !== -1 ? _dTiles.CesiumIonLoader : _dTiles.Tiles3DLoader;
|
|
137
|
-
this.generateTextures = Boolean(generateTextures);
|
|
138
|
-
this.generateBoundingVolumes = Boolean(generateBoundingVolumes);
|
|
139
|
-
this.writeQueue = new _writeQueue.default();
|
|
140
|
-
this.writeQueue.startListening();
|
|
141
|
-
console.log('Loading egm file...');
|
|
142
|
-
_context.next = 16;
|
|
143
|
-
return (0, _core.load)(egmFilePath, _pgmLoader.PGMLoader);
|
|
144
|
-
case 16:
|
|
145
|
-
this.geoidHeightModel = _context.sent;
|
|
146
|
-
console.log('Loading egm file completed!');
|
|
147
|
-
if (slpk) {
|
|
148
|
-
this.nodePages.useWriteFunction(_fileUtils.writeFileForSlpk);
|
|
149
|
-
}
|
|
150
|
-
_context.next = 21;
|
|
151
|
-
return this.loadWorkers();
|
|
152
|
-
case 21:
|
|
153
|
-
_context.prev = 21;
|
|
154
|
-
_context.next = 24;
|
|
155
|
-
return this._fetchPreloadOptions();
|
|
156
|
-
case 24:
|
|
157
|
-
preloadOptions = _context.sent;
|
|
158
|
-
tilesetOptions = {
|
|
159
|
-
loadOptions: {
|
|
160
|
-
_nodeWorkers: true,
|
|
161
|
-
reuseWorkers: true,
|
|
162
|
-
basis: {
|
|
163
|
-
format: 'rgba32'
|
|
164
|
-
},
|
|
165
|
-
'basis-nodejs': {
|
|
166
|
-
format: 'rgba32',
|
|
167
|
-
workerUrl: './modules/textures/dist/basis-nodejs-worker.js'
|
|
168
|
-
},
|
|
169
|
-
'draco-nodejs': {
|
|
170
|
-
workerUrl: './modules/draco/dist/draco-nodejs-worker.js'
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
tilesetUrl = inputUrl;
|
|
175
|
-
if (preloadOptions.url) {
|
|
176
|
-
tilesetUrl = preloadOptions.url;
|
|
177
|
-
}
|
|
178
|
-
if (preloadOptions.headers) {
|
|
179
|
-
tilesetOptions.loadOptions.fetch = {
|
|
180
|
-
headers: preloadOptions.headers
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
Object.assign(tilesetOptions, preloadOptions);
|
|
184
|
-
_context.next = 32;
|
|
185
|
-
return (0, _core.load)(tilesetUrl, this.Loader, tilesetOptions.loadOptions);
|
|
186
|
-
case 32:
|
|
187
|
-
sourceTilesetJson = _context.sent;
|
|
188
|
-
this.sourceTileset = new _tiles.Tileset3D(sourceTilesetJson, tilesetOptions);
|
|
189
|
-
_context.next = 36;
|
|
190
|
-
return this._createAndSaveTileset(outputPath, tilesetName, sourceTilesetJson === null || sourceTilesetJson === void 0 ? void 0 : (_sourceTilesetJson$ro = sourceTilesetJson.root) === null || _sourceTilesetJson$ro === void 0 ? void 0 : (_sourceTilesetJson$ro2 = _sourceTilesetJson$ro.boundingVolume) === null || _sourceTilesetJson$ro2 === void 0 ? void 0 : _sourceTilesetJson$ro2.region);
|
|
191
|
-
case 36:
|
|
192
|
-
_context.next = 38;
|
|
193
|
-
return this._finishConversion({
|
|
194
|
-
slpk: Boolean(slpk),
|
|
195
|
-
outputPath: outputPath,
|
|
196
|
-
tilesetName: tilesetName
|
|
197
|
-
});
|
|
198
|
-
case 38:
|
|
199
|
-
return _context.abrupt("return", sourceTilesetJson);
|
|
200
|
-
case 41:
|
|
201
|
-
_context.prev = 41;
|
|
202
|
-
_context.t0 = _context["catch"](21);
|
|
203
|
-
throw _context.t0;
|
|
204
|
-
case 44:
|
|
205
|
-
_context.prev = 44;
|
|
206
|
-
workerFarm = _workerUtils.WorkerFarm.getWorkerFarm({});
|
|
207
|
-
workerFarm.destroy();
|
|
208
|
-
return _context.finish(44);
|
|
209
|
-
case 48:
|
|
210
|
-
case "end":
|
|
211
|
-
return _context.stop();
|
|
212
|
-
}
|
|
213
|
-
}, _callee, this, [[21, 41, 44, 48]]);
|
|
214
|
-
}));
|
|
215
|
-
function convert(_x) {
|
|
216
|
-
return _convert.apply(this, arguments);
|
|
217
|
-
}
|
|
218
|
-
return convert;
|
|
219
|
-
}()
|
|
220
|
-
}, {
|
|
221
|
-
key: "_createAndSaveTileset",
|
|
222
|
-
value: function () {
|
|
223
|
-
var _createAndSaveTileset2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee2(outputPath, tilesetName, boundingVolumeRegion) {
|
|
224
|
-
var _this = this;
|
|
225
|
-
var tilesetPath, sourceRootTile, boundingVolumes, rootNode, _iterator, _step, filePath;
|
|
226
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
227
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
228
|
-
case 0:
|
|
229
|
-
tilesetPath = (0, _path.join)("".concat(outputPath), "".concat(tilesetName));
|
|
230
|
-
_context2.prev = 1;
|
|
231
|
-
_context2.next = 4;
|
|
232
|
-
return (0, _fileUtils.removeDir)(tilesetPath);
|
|
233
|
-
case 4:
|
|
234
|
-
_context2.next = 8;
|
|
235
|
-
break;
|
|
236
|
-
case 6:
|
|
237
|
-
_context2.prev = 6;
|
|
238
|
-
_context2.t0 = _context2["catch"](1);
|
|
239
|
-
case 8:
|
|
240
|
-
this.layers0Path = (0, _path.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
241
|
-
this._formLayers0(tilesetName, boundingVolumeRegion);
|
|
242
|
-
this.materialDefinitions = [];
|
|
243
|
-
this.materialMap = new Map();
|
|
244
|
-
sourceRootTile = this.sourceTileset.root;
|
|
245
|
-
boundingVolumes = (0, _coordinateConverter.createBoundingVolumes)(sourceRootTile, this.geoidHeightModel);
|
|
246
|
-
_context2.next = 16;
|
|
247
|
-
return this.nodePages.push({
|
|
248
|
-
index: 0,
|
|
249
|
-
lodThreshold: 0,
|
|
250
|
-
obb: boundingVolumes.obb,
|
|
251
|
-
children: []
|
|
252
|
-
});
|
|
253
|
-
case 16:
|
|
254
|
-
_context2.next = 18;
|
|
255
|
-
return _nodeIndexDocument.NodeIndexDocument.createRootNode(boundingVolumes, this);
|
|
256
|
-
case 18:
|
|
257
|
-
rootNode = _context2.sent;
|
|
258
|
-
_context2.next = 21;
|
|
259
|
-
return this._convertNodesTree(rootNode, sourceRootTile);
|
|
260
|
-
case 21:
|
|
261
|
-
this.layers0.materialDefinitions = this.materialDefinitions;
|
|
262
|
-
this.layers0.geometryDefinitions = (0, _jsonMapTransform.default)(this.geometryConfigs.map(function (config) {
|
|
263
|
-
return {
|
|
264
|
-
geometryConfig: _objectSpread(_objectSpread({}, config), {}, {
|
|
265
|
-
draco: _this.options.draco
|
|
266
|
-
})
|
|
267
|
-
};
|
|
268
|
-
}), (0, _geometryDefinitions.GEOMETRY_DEFINITION)());
|
|
269
|
-
if (this.layersHasTexture === false) {
|
|
270
|
-
this.layers0.store.defaultGeometrySchema.ordering = this.layers0.store.defaultGeometrySchema.ordering.filter(function (attribute) {
|
|
271
|
-
return attribute !== 'uv0';
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
_context2.next = 26;
|
|
275
|
-
return this._writeLayers0();
|
|
276
|
-
case 26:
|
|
277
|
-
(0, _createSceneServerPath.createSceneServerPath)(tilesetName, this.layers0, tilesetPath);
|
|
278
|
-
_iterator = _createForOfIteratorHelper(this.compressList || []);
|
|
279
|
-
_context2.prev = 28;
|
|
280
|
-
_iterator.s();
|
|
281
|
-
case 30:
|
|
282
|
-
if ((_step = _iterator.n()).done) {
|
|
283
|
-
_context2.next = 38;
|
|
284
|
-
break;
|
|
285
|
-
}
|
|
286
|
-
filePath = _step.value;
|
|
287
|
-
_context2.next = 34;
|
|
288
|
-
return (0, _compressUtil.compressFileWithGzip)(filePath);
|
|
289
|
-
case 34:
|
|
290
|
-
_context2.next = 36;
|
|
291
|
-
return (0, _fileUtils.removeFile)(filePath);
|
|
292
|
-
case 36:
|
|
293
|
-
_context2.next = 30;
|
|
294
|
-
break;
|
|
295
|
-
case 38:
|
|
296
|
-
_context2.next = 43;
|
|
297
|
-
break;
|
|
298
|
-
case 40:
|
|
299
|
-
_context2.prev = 40;
|
|
300
|
-
_context2.t1 = _context2["catch"](28);
|
|
301
|
-
_iterator.e(_context2.t1);
|
|
302
|
-
case 43:
|
|
303
|
-
_context2.prev = 43;
|
|
304
|
-
_iterator.f();
|
|
305
|
-
return _context2.finish(43);
|
|
306
|
-
case 46:
|
|
307
|
-
_context2.next = 48;
|
|
308
|
-
return this.nodePages.save();
|
|
309
|
-
case 48:
|
|
310
|
-
_context2.next = 50;
|
|
311
|
-
return this.writeQueue.finalize();
|
|
312
|
-
case 50:
|
|
313
|
-
_context2.next = 52;
|
|
314
|
-
return this._createSlpk(tilesetPath);
|
|
315
|
-
case 52:
|
|
316
|
-
case "end":
|
|
317
|
-
return _context2.stop();
|
|
318
|
-
}
|
|
319
|
-
}, _callee2, this, [[1, 6], [28, 40, 43, 46]]);
|
|
320
|
-
}));
|
|
321
|
-
function _createAndSaveTileset(_x2, _x3, _x4) {
|
|
322
|
-
return _createAndSaveTileset2.apply(this, arguments);
|
|
323
|
-
}
|
|
324
|
-
return _createAndSaveTileset;
|
|
325
|
-
}()
|
|
326
|
-
}, {
|
|
327
|
-
key: "_formLayers0",
|
|
328
|
-
value: function _formLayers0(tilesetName, boundingVolumeRegion) {
|
|
329
|
-
var _this$sourceTileset, _this$sourceTileset2, _this$sourceTileset2$;
|
|
330
|
-
var fullExtent = (0, _coordinateConverter.convertBoundingVolumeToI3SFullExtent)(((_this$sourceTileset = this.sourceTileset) === null || _this$sourceTileset === void 0 ? void 0 : _this$sourceTileset.boundingVolume) || ((_this$sourceTileset2 = this.sourceTileset) === null || _this$sourceTileset2 === void 0 ? void 0 : (_this$sourceTileset2$ = _this$sourceTileset2.root) === null || _this$sourceTileset2$ === void 0 ? void 0 : _this$sourceTileset2$.boundingVolume));
|
|
331
|
-
if (boundingVolumeRegion) {
|
|
332
|
-
fullExtent.zmin = boundingVolumeRegion[4];
|
|
333
|
-
fullExtent.zmax = boundingVolumeRegion[5];
|
|
334
|
-
}
|
|
335
|
-
var extent = [fullExtent.xmin, fullExtent.ymin, fullExtent.xmax, fullExtent.ymax];
|
|
336
|
-
var layers0data = {
|
|
337
|
-
version: "{".concat((0, _uuid.v4)().toUpperCase(), "}"),
|
|
338
|
-
id: 0,
|
|
339
|
-
name: tilesetName,
|
|
340
|
-
href: './layers/0',
|
|
341
|
-
store: {
|
|
342
|
-
id: "{".concat((0, _uuid.v4)().toUpperCase(), "}"),
|
|
343
|
-
extent: extent
|
|
344
|
-
},
|
|
345
|
-
nodePages: {
|
|
346
|
-
nodesPerPage: HARDCODED_NODES_PER_PAGE
|
|
347
|
-
},
|
|
348
|
-
compressGeometry: this.options.draco,
|
|
349
|
-
fullExtent: fullExtent
|
|
350
|
-
};
|
|
351
|
-
this.layers0 = (0, _jsonMapTransform.default)(layers0data, (0, _layers.LAYERS)());
|
|
94
|
+
async convert(options) {
|
|
95
|
+
if (_core.isBrowser) {
|
|
96
|
+
console.log(_constants.BROWSER_ERROR_MESSAGE);
|
|
97
|
+
return _constants.BROWSER_ERROR_MESSAGE;
|
|
352
98
|
}
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
_context3.next = 31;
|
|
412
|
-
return sourceRootTile.unloadContent();
|
|
413
|
-
case 31:
|
|
414
|
-
_context3.next = 33;
|
|
415
|
-
return rootNode.save();
|
|
416
|
-
case 33:
|
|
417
|
-
case "end":
|
|
418
|
-
return _context3.stop();
|
|
419
|
-
}
|
|
420
|
-
}, _callee3, this, [[7, 17, 20, 23]]);
|
|
421
|
-
}));
|
|
422
|
-
function _convertNodesTree(_x5, _x6) {
|
|
423
|
-
return _convertNodesTree2.apply(this, arguments);
|
|
424
|
-
}
|
|
425
|
-
return _convertNodesTree;
|
|
426
|
-
}()
|
|
427
|
-
}, {
|
|
428
|
-
key: "_writeLayers0",
|
|
429
|
-
value: function () {
|
|
430
|
-
var _writeLayers = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee4() {
|
|
431
|
-
var _this2 = this;
|
|
432
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
433
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
434
|
-
case 0:
|
|
435
|
-
if (!this.options.slpk) {
|
|
436
|
-
_context4.next = 5;
|
|
437
|
-
break;
|
|
438
|
-
}
|
|
439
|
-
_context4.next = 3;
|
|
440
|
-
return this.writeQueue.enqueue({
|
|
441
|
-
archiveKey: '3dSceneLayer.json.gz',
|
|
442
|
-
writePromise: function writePromise() {
|
|
443
|
-
return (0, _fileUtils.writeFileForSlpk)(_this2.layers0Path, JSON.stringify(_this2.layers0), '3dSceneLayer.json');
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
case 3:
|
|
447
|
-
_context4.next = 7;
|
|
448
|
-
break;
|
|
449
|
-
case 5:
|
|
450
|
-
_context4.next = 7;
|
|
451
|
-
return this.writeQueue.enqueue({
|
|
452
|
-
writePromise: function writePromise() {
|
|
453
|
-
return (0, _fileUtils.writeFile)(_this2.layers0Path, JSON.stringify(_this2.layers0));
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
case 7:
|
|
457
|
-
case "end":
|
|
458
|
-
return _context4.stop();
|
|
459
|
-
}
|
|
460
|
-
}, _callee4, this);
|
|
461
|
-
}));
|
|
462
|
-
function _writeLayers0() {
|
|
463
|
-
return _writeLayers.apply(this, arguments);
|
|
464
|
-
}
|
|
465
|
-
return _writeLayers0;
|
|
466
|
-
}()
|
|
467
|
-
}, {
|
|
468
|
-
key: "_createSlpk",
|
|
469
|
-
value: function () {
|
|
470
|
-
var _createSlpk2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee5(tilesetPath) {
|
|
471
|
-
var slpkTilesetPath, slpkFileName;
|
|
472
|
-
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
473
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
474
|
-
case 0:
|
|
475
|
-
if (!this.options.slpk) {
|
|
476
|
-
_context5.next = 12;
|
|
477
|
-
break;
|
|
478
|
-
}
|
|
479
|
-
slpkTilesetPath = (0, _path.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
480
|
-
slpkFileName = "".concat(tilesetPath, ".slpk");
|
|
481
|
-
_context5.next = 5;
|
|
482
|
-
return (0, _compressUtil.compressWithChildProcess)(slpkTilesetPath, slpkFileName, 0, '.', this.options.sevenZipExe);
|
|
483
|
-
case 5:
|
|
484
|
-
_context5.prev = 5;
|
|
485
|
-
_context5.next = 8;
|
|
486
|
-
return (0, _fileUtils.removeDir)(tilesetPath);
|
|
487
|
-
case 8:
|
|
488
|
-
_context5.next = 12;
|
|
489
|
-
break;
|
|
490
|
-
case 10:
|
|
491
|
-
_context5.prev = 10;
|
|
492
|
-
_context5.t0 = _context5["catch"](5);
|
|
493
|
-
case 12:
|
|
494
|
-
case "end":
|
|
495
|
-
return _context5.stop();
|
|
496
|
-
}
|
|
497
|
-
}, _callee5, this, [[5, 10]]);
|
|
498
|
-
}));
|
|
499
|
-
function _createSlpk(_x7) {
|
|
500
|
-
return _createSlpk2.apply(this, arguments);
|
|
501
|
-
}
|
|
502
|
-
return _createSlpk;
|
|
503
|
-
}()
|
|
504
|
-
}, {
|
|
505
|
-
key: "_addChildrenWithNeighborsAndWriteFile",
|
|
506
|
-
value: function () {
|
|
507
|
-
var _addChildrenWithNeighborsAndWriteFile2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee6(data) {
|
|
508
|
-
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
509
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
510
|
-
case 0:
|
|
511
|
-
_context6.next = 2;
|
|
512
|
-
return this._addChildren(data);
|
|
513
|
-
case 2:
|
|
514
|
-
_context6.next = 4;
|
|
515
|
-
return data.parentNode.addNeighbors();
|
|
516
|
-
case 4:
|
|
517
|
-
case "end":
|
|
518
|
-
return _context6.stop();
|
|
99
|
+
this.conversionStartTime = _process.default.hrtime();
|
|
100
|
+
const {
|
|
101
|
+
tilesetName,
|
|
102
|
+
slpk,
|
|
103
|
+
egmFilePath,
|
|
104
|
+
inputUrl,
|
|
105
|
+
validate,
|
|
106
|
+
outputPath,
|
|
107
|
+
draco = true,
|
|
108
|
+
sevenZipExe,
|
|
109
|
+
maxDepth,
|
|
110
|
+
token,
|
|
111
|
+
generateTextures,
|
|
112
|
+
generateBoundingVolumes,
|
|
113
|
+
instantNodeWriting = false,
|
|
114
|
+
mergeMaterials = true
|
|
115
|
+
} = options;
|
|
116
|
+
this.options = {
|
|
117
|
+
maxDepth,
|
|
118
|
+
slpk,
|
|
119
|
+
sevenZipExe,
|
|
120
|
+
egmFilePath,
|
|
121
|
+
draco,
|
|
122
|
+
token,
|
|
123
|
+
inputUrl,
|
|
124
|
+
instantNodeWriting,
|
|
125
|
+
mergeMaterials
|
|
126
|
+
};
|
|
127
|
+
this.compressList = this.options.instantNodeWriting && [] || null;
|
|
128
|
+
this.validate = Boolean(validate);
|
|
129
|
+
this.Loader = inputUrl.indexOf(CESIUM_DATASET_PREFIX) !== -1 ? _dTiles.CesiumIonLoader : _dTiles.Tiles3DLoader;
|
|
130
|
+
this.generateTextures = Boolean(generateTextures);
|
|
131
|
+
this.generateBoundingVolumes = Boolean(generateBoundingVolumes);
|
|
132
|
+
this.writeQueue = new _writeQueue.default();
|
|
133
|
+
this.writeQueue.startListening();
|
|
134
|
+
console.log('Loading egm file...');
|
|
135
|
+
this.geoidHeightModel = await (0, _core.load)(egmFilePath, _pgmLoader.PGMLoader);
|
|
136
|
+
console.log('Loading egm file completed!');
|
|
137
|
+
if (slpk) {
|
|
138
|
+
this.nodePages.useWriteFunction(_fileUtils.writeFileForSlpk);
|
|
139
|
+
}
|
|
140
|
+
await this.loadWorkers();
|
|
141
|
+
try {
|
|
142
|
+
var _sourceTilesetJson$ro, _sourceTilesetJson$ro2;
|
|
143
|
+
const preloadOptions = await this._fetchPreloadOptions();
|
|
144
|
+
const tilesetOptions = {
|
|
145
|
+
loadOptions: {
|
|
146
|
+
_nodeWorkers: true,
|
|
147
|
+
reuseWorkers: true,
|
|
148
|
+
basis: {
|
|
149
|
+
format: 'rgba32'
|
|
150
|
+
},
|
|
151
|
+
'basis-nodejs': {
|
|
152
|
+
format: 'rgba32',
|
|
153
|
+
workerUrl: './modules/textures/dist/basis-nodejs-worker.js'
|
|
154
|
+
},
|
|
155
|
+
'draco-nodejs': {
|
|
156
|
+
workerUrl: './modules/draco/dist/draco-nodejs-worker.js'
|
|
519
157
|
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
let tilesetUrl = inputUrl;
|
|
161
|
+
if (preloadOptions.url) {
|
|
162
|
+
tilesetUrl = preloadOptions.url;
|
|
524
163
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
value: function () {
|
|
530
|
-
var _convertNestedTileset = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee7(_ref) {
|
|
531
|
-
var parentNode, sourceTile, level;
|
|
532
|
-
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
533
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
534
|
-
case 0:
|
|
535
|
-
parentNode = _ref.parentNode, sourceTile = _ref.sourceTile, level = _ref.level;
|
|
536
|
-
_context7.next = 3;
|
|
537
|
-
return this.sourceTileset._loadTile(sourceTile);
|
|
538
|
-
case 3:
|
|
539
|
-
_context7.next = 5;
|
|
540
|
-
return this._addChildren({
|
|
541
|
-
parentNode: parentNode,
|
|
542
|
-
sourceTiles: sourceTile.children,
|
|
543
|
-
level: level + 1
|
|
544
|
-
});
|
|
545
|
-
case 5:
|
|
546
|
-
_context7.next = 7;
|
|
547
|
-
return sourceTile.unloadContent();
|
|
548
|
-
case 7:
|
|
549
|
-
case "end":
|
|
550
|
-
return _context7.stop();
|
|
551
|
-
}
|
|
552
|
-
}, _callee7, this);
|
|
553
|
-
}));
|
|
554
|
-
function convertNestedTileset(_x9) {
|
|
555
|
-
return _convertNestedTileset.apply(this, arguments);
|
|
164
|
+
if (preloadOptions.headers) {
|
|
165
|
+
tilesetOptions.loadOptions.fetch = {
|
|
166
|
+
headers: preloadOptions.headers
|
|
167
|
+
};
|
|
556
168
|
}
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
169
|
+
Object.assign(tilesetOptions, preloadOptions);
|
|
170
|
+
const sourceTilesetJson = await (0, _core.load)(tilesetUrl, this.Loader, tilesetOptions.loadOptions);
|
|
171
|
+
this.sourceTileset = new _tiles.Tileset3D(sourceTilesetJson, tilesetOptions);
|
|
172
|
+
await this._createAndSaveTileset(outputPath, tilesetName, sourceTilesetJson === null || sourceTilesetJson === void 0 ? void 0 : (_sourceTilesetJson$ro = sourceTilesetJson.root) === null || _sourceTilesetJson$ro === void 0 ? void 0 : (_sourceTilesetJson$ro2 = _sourceTilesetJson$ro.boundingVolume) === null || _sourceTilesetJson$ro2 === void 0 ? void 0 : _sourceTilesetJson$ro2.region);
|
|
173
|
+
await this._finishConversion({
|
|
174
|
+
slpk: Boolean(slpk),
|
|
175
|
+
outputPath,
|
|
176
|
+
tilesetName
|
|
177
|
+
});
|
|
178
|
+
return sourceTilesetJson;
|
|
179
|
+
} catch (error) {
|
|
180
|
+
throw error;
|
|
181
|
+
} finally {
|
|
182
|
+
const workerFarm = _workerUtils.WorkerFarm.getWorkerFarm({});
|
|
183
|
+
workerFarm.destroy();
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
async _createAndSaveTileset(outputPath, tilesetName, boundingVolumeRegion) {
|
|
187
|
+
const tilesetPath = (0, _path.join)("".concat(outputPath), "".concat(tilesetName));
|
|
188
|
+
try {
|
|
189
|
+
await (0, _fileUtils.removeDir)(tilesetPath);
|
|
190
|
+
} catch (e) {}
|
|
191
|
+
this.layers0Path = (0, _path.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
192
|
+
this._formLayers0(tilesetName, boundingVolumeRegion);
|
|
193
|
+
this.materialDefinitions = [];
|
|
194
|
+
this.materialMap = new Map();
|
|
195
|
+
const sourceRootTile = this.sourceTileset.root;
|
|
196
|
+
const boundingVolumes = (0, _coordinateConverter.createBoundingVolumes)(sourceRootTile, this.geoidHeightModel);
|
|
197
|
+
await this.nodePages.push({
|
|
198
|
+
index: 0,
|
|
199
|
+
lodThreshold: 0,
|
|
200
|
+
obb: boundingVolumes.obb,
|
|
201
|
+
children: []
|
|
202
|
+
});
|
|
203
|
+
const rootNode = await _nodeIndexDocument.NodeIndexDocument.createRootNode(boundingVolumes, this);
|
|
204
|
+
await this._convertNodesTree(rootNode, sourceRootTile);
|
|
205
|
+
this.layers0.materialDefinitions = this.materialDefinitions;
|
|
206
|
+
this.layers0.geometryDefinitions = (0, _jsonMapTransform.default)(this.geometryConfigs.map(config => ({
|
|
207
|
+
geometryConfig: {
|
|
208
|
+
...config,
|
|
209
|
+
draco: this.options.draco
|
|
582
210
|
}
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
});
|
|
629
|
-
case 15:
|
|
630
|
-
if (sourceTile.id) {
|
|
631
|
-
console.log(sourceTile.id);
|
|
632
|
-
}
|
|
633
|
-
case 16:
|
|
634
|
-
_context9.next = 6;
|
|
635
|
-
break;
|
|
636
|
-
case 18:
|
|
637
|
-
_context9.next = 23;
|
|
638
|
-
break;
|
|
639
|
-
case 20:
|
|
640
|
-
_context9.prev = 20;
|
|
641
|
-
_context9.t0 = _context9["catch"](4);
|
|
642
|
-
_iterator3.e(_context9.t0);
|
|
643
|
-
case 23:
|
|
644
|
-
_context9.prev = 23;
|
|
645
|
-
_iterator3.f();
|
|
646
|
-
return _context9.finish(23);
|
|
647
|
-
case 26:
|
|
648
|
-
case "end":
|
|
649
|
-
return _context9.stop();
|
|
650
|
-
}
|
|
651
|
-
}, _callee9, this, [[4, 20, 23, 26]]);
|
|
652
|
-
}));
|
|
653
|
-
function _addChildren(_x11) {
|
|
654
|
-
return _addChildren2.apply(this, arguments);
|
|
211
|
+
})), (0, _geometryDefinitions.GEOMETRY_DEFINITION)());
|
|
212
|
+
if (this.layersHasTexture === false) {
|
|
213
|
+
this.layers0.store.defaultGeometrySchema.ordering = this.layers0.store.defaultGeometrySchema.ordering.filter(attribute => attribute !== 'uv0');
|
|
214
|
+
}
|
|
215
|
+
await this._writeLayers0();
|
|
216
|
+
(0, _createSceneServerPath.createSceneServerPath)(tilesetName, this.layers0, tilesetPath);
|
|
217
|
+
for (const filePath of this.compressList || []) {
|
|
218
|
+
await (0, _compressUtil.compressFileWithGzip)(filePath);
|
|
219
|
+
await (0, _fileUtils.removeFile)(filePath);
|
|
220
|
+
}
|
|
221
|
+
await this.nodePages.save();
|
|
222
|
+
await this.writeQueue.finalize();
|
|
223
|
+
await this._createSlpk(tilesetPath);
|
|
224
|
+
}
|
|
225
|
+
_formLayers0(tilesetName, boundingVolumeRegion) {
|
|
226
|
+
var _this$sourceTileset, _this$sourceTileset2, _this$sourceTileset2$;
|
|
227
|
+
const fullExtent = (0, _coordinateConverter.convertBoundingVolumeToI3SFullExtent)(((_this$sourceTileset = this.sourceTileset) === null || _this$sourceTileset === void 0 ? void 0 : _this$sourceTileset.boundingVolume) || ((_this$sourceTileset2 = this.sourceTileset) === null || _this$sourceTileset2 === void 0 ? void 0 : (_this$sourceTileset2$ = _this$sourceTileset2.root) === null || _this$sourceTileset2$ === void 0 ? void 0 : _this$sourceTileset2$.boundingVolume));
|
|
228
|
+
if (boundingVolumeRegion) {
|
|
229
|
+
fullExtent.zmin = boundingVolumeRegion[4];
|
|
230
|
+
fullExtent.zmax = boundingVolumeRegion[5];
|
|
231
|
+
}
|
|
232
|
+
const extent = [fullExtent.xmin, fullExtent.ymin, fullExtent.xmax, fullExtent.ymax];
|
|
233
|
+
const layers0data = {
|
|
234
|
+
version: "{".concat((0, _uuid.v4)().toUpperCase(), "}"),
|
|
235
|
+
id: 0,
|
|
236
|
+
name: tilesetName,
|
|
237
|
+
href: './layers/0',
|
|
238
|
+
store: {
|
|
239
|
+
id: "{".concat((0, _uuid.v4)().toUpperCase(), "}"),
|
|
240
|
+
extent
|
|
241
|
+
},
|
|
242
|
+
nodePages: {
|
|
243
|
+
nodesPerPage: HARDCODED_NODES_PER_PAGE
|
|
244
|
+
},
|
|
245
|
+
compressGeometry: this.options.draco,
|
|
246
|
+
fullExtent
|
|
247
|
+
};
|
|
248
|
+
this.layers0 = (0, _jsonMapTransform.default)(layers0data, (0, _layers.LAYERS)());
|
|
249
|
+
}
|
|
250
|
+
async _convertNodesTree(rootNode, sourceRootTile) {
|
|
251
|
+
await this.sourceTileset._loadTile(sourceRootTile);
|
|
252
|
+
if (this.isContentSupported(sourceRootTile)) {
|
|
253
|
+
const childNodes = await this._createNode(rootNode, sourceRootTile, 0);
|
|
254
|
+
for (const childNode of childNodes) {
|
|
255
|
+
await childNode.save();
|
|
655
256
|
}
|
|
656
|
-
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
this.boundingVolumeWarnings = (0, _nodeDebug.validateNodeBoundingVolumes)(nodeData);
|
|
739
|
-
if (this.boundingVolumeWarnings && this.boundingVolumeWarnings.length) {
|
|
740
|
-
(_console = console).warn.apply(_console, ['Bounding Volume Warnings: '].concat((0, _toConsumableArray2.default)(this.boundingVolumeWarnings)));
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
nodeIds.push(nodeInPage.index);
|
|
744
|
-
nodesInPage.push(nodeInPage);
|
|
745
|
-
case 40:
|
|
746
|
-
_context10.next = 18;
|
|
747
|
-
break;
|
|
748
|
-
case 42:
|
|
749
|
-
_context10.next = 47;
|
|
750
|
-
break;
|
|
751
|
-
case 44:
|
|
752
|
-
_context10.prev = 44;
|
|
753
|
-
_context10.t0 = _context10["catch"](16);
|
|
754
|
-
_iterator4.e(_context10.t0);
|
|
755
|
-
case 47:
|
|
756
|
-
_context10.prev = 47;
|
|
757
|
-
_iterator4.f();
|
|
758
|
-
return _context10.finish(47);
|
|
759
|
-
case 50:
|
|
760
|
-
sourceTile.unloadContent();
|
|
761
|
-
_context10.next = 53;
|
|
762
|
-
return this._addChildrenWithNeighborsAndWriteFile({
|
|
763
|
-
parentNode: nodes[0],
|
|
764
|
-
sourceTiles: sourceTile.children,
|
|
765
|
-
level: level + 1
|
|
766
|
-
});
|
|
767
|
-
case 53:
|
|
768
|
-
return _context10.abrupt("return", nodes);
|
|
769
|
-
case 54:
|
|
770
|
-
case "end":
|
|
771
|
-
return _context10.stop();
|
|
772
|
-
}
|
|
773
|
-
}, _callee10, this, [[16, 44, 47, 50]]);
|
|
774
|
-
}));
|
|
775
|
-
function _createNode(_x12, _x13, _x14) {
|
|
776
|
-
return _createNode2.apply(this, arguments);
|
|
257
|
+
await rootNode.addChildren(childNodes);
|
|
258
|
+
} else {
|
|
259
|
+
await this._addChildrenWithNeighborsAndWriteFile({
|
|
260
|
+
parentNode: rootNode,
|
|
261
|
+
sourceTiles: sourceRootTile.children,
|
|
262
|
+
level: 1
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
await sourceRootTile.unloadContent();
|
|
266
|
+
await rootNode.save();
|
|
267
|
+
}
|
|
268
|
+
async _writeLayers0() {
|
|
269
|
+
if (this.options.slpk) {
|
|
270
|
+
await this.writeQueue.enqueue({
|
|
271
|
+
archiveKey: '3dSceneLayer.json.gz',
|
|
272
|
+
writePromise: () => (0, _fileUtils.writeFileForSlpk)(this.layers0Path, JSON.stringify(this.layers0), '3dSceneLayer.json')
|
|
273
|
+
});
|
|
274
|
+
} else {
|
|
275
|
+
await this.writeQueue.enqueue({
|
|
276
|
+
writePromise: () => (0, _fileUtils.writeFile)(this.layers0Path, JSON.stringify(this.layers0))
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
async _createSlpk(tilesetPath) {
|
|
281
|
+
if (this.options.slpk) {
|
|
282
|
+
const slpkTilesetPath = (0, _path.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
283
|
+
const slpkFileName = "".concat(tilesetPath, ".slpk");
|
|
284
|
+
await (0, _compressUtil.compressWithChildProcess)(slpkTilesetPath, slpkFileName, 0, '.', this.options.sevenZipExe);
|
|
285
|
+
try {
|
|
286
|
+
await (0, _fileUtils.removeDir)(tilesetPath);
|
|
287
|
+
} catch (e) {}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
async _addChildrenWithNeighborsAndWriteFile(data) {
|
|
291
|
+
await this._addChildren(data);
|
|
292
|
+
await data.parentNode.addNeighbors();
|
|
293
|
+
}
|
|
294
|
+
async convertNestedTileset(_ref) {
|
|
295
|
+
let {
|
|
296
|
+
parentNode,
|
|
297
|
+
sourceTile,
|
|
298
|
+
level
|
|
299
|
+
} = _ref;
|
|
300
|
+
await this.sourceTileset._loadTile(sourceTile);
|
|
301
|
+
await this._addChildren({
|
|
302
|
+
parentNode,
|
|
303
|
+
sourceTiles: sourceTile.children,
|
|
304
|
+
level: level + 1
|
|
305
|
+
});
|
|
306
|
+
await sourceTile.unloadContent();
|
|
307
|
+
}
|
|
308
|
+
async convertNode(_ref2) {
|
|
309
|
+
let {
|
|
310
|
+
parentNode,
|
|
311
|
+
sourceTile,
|
|
312
|
+
level
|
|
313
|
+
} = _ref2;
|
|
314
|
+
const childNodes = await this._createNode(parentNode, sourceTile, level);
|
|
315
|
+
await parentNode.addChildren(childNodes);
|
|
316
|
+
}
|
|
317
|
+
async _addChildren(data) {
|
|
318
|
+
const {
|
|
319
|
+
sourceTiles,
|
|
320
|
+
parentNode,
|
|
321
|
+
level
|
|
322
|
+
} = data;
|
|
323
|
+
if (this.options.maxDepth && level > this.options.maxDepth) {
|
|
324
|
+
return;
|
|
325
|
+
}
|
|
326
|
+
for (const sourceTile of sourceTiles) {
|
|
327
|
+
if (sourceTile.type === 'json') {
|
|
328
|
+
await this.convertNestedTileset({
|
|
329
|
+
parentNode,
|
|
330
|
+
sourceTile,
|
|
331
|
+
level
|
|
332
|
+
});
|
|
333
|
+
} else {
|
|
334
|
+
await this.convertNode({
|
|
335
|
+
parentNode,
|
|
336
|
+
sourceTile,
|
|
337
|
+
level
|
|
338
|
+
});
|
|
777
339
|
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
}, {
|
|
781
|
-
key: "_convertResources",
|
|
782
|
-
value: function () {
|
|
783
|
-
var _convertResources2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee12(sourceTile, parentId, propertyTable) {
|
|
784
|
-
var _this3 = this,
|
|
785
|
-
_this$layers2;
|
|
786
|
-
var draftObb, resourcesData;
|
|
787
|
-
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
788
|
-
while (1) switch (_context12.prev = _context12.next) {
|
|
789
|
-
case 0:
|
|
790
|
-
if (this.isContentSupported(sourceTile)) {
|
|
791
|
-
_context12.next = 2;
|
|
792
|
-
break;
|
|
793
|
-
}
|
|
794
|
-
return _context12.abrupt("return", null);
|
|
795
|
-
case 2:
|
|
796
|
-
draftObb = {
|
|
797
|
-
center: [],
|
|
798
|
-
halfSize: [],
|
|
799
|
-
quaternion: []
|
|
800
|
-
};
|
|
801
|
-
_context12.next = 5;
|
|
802
|
-
return (0, _geometryConverter.default)(sourceTile.content, (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee11() {
|
|
803
|
-
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
804
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
805
|
-
case 0:
|
|
806
|
-
_context11.next = 2;
|
|
807
|
-
return _this3.nodePages.push({
|
|
808
|
-
index: 0,
|
|
809
|
-
obb: draftObb
|
|
810
|
-
}, parentId);
|
|
811
|
-
case 2:
|
|
812
|
-
return _context11.abrupt("return", _context11.sent.index);
|
|
813
|
-
case 3:
|
|
814
|
-
case "end":
|
|
815
|
-
return _context11.stop();
|
|
816
|
-
}
|
|
817
|
-
}, _callee11);
|
|
818
|
-
})), propertyTable, this.featuresHashArray, (_this$layers2 = this.layers0) === null || _this$layers2 === void 0 ? void 0 : _this$layers2.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.options.mergeMaterials, this.geoidHeightModel, this.workerSource);
|
|
819
|
-
case 5:
|
|
820
|
-
resourcesData = _context12.sent;
|
|
821
|
-
return _context12.abrupt("return", resourcesData);
|
|
822
|
-
case 7:
|
|
823
|
-
case "end":
|
|
824
|
-
return _context12.stop();
|
|
825
|
-
}
|
|
826
|
-
}, _callee12, this);
|
|
827
|
-
}));
|
|
828
|
-
function _convertResources(_x15, _x16, _x17) {
|
|
829
|
-
return _convertResources2.apply(this, arguments);
|
|
340
|
+
if (sourceTile.id) {
|
|
341
|
+
console.log(sourceTile.id);
|
|
830
342
|
}
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
if (nodeId) {
|
|
864
|
-
_context13.next = 10;
|
|
865
|
-
break;
|
|
866
|
-
}
|
|
867
|
-
_context13.next = 7;
|
|
868
|
-
return this.nodePages.push(nodeInPage, parentId);
|
|
869
|
-
case 7:
|
|
870
|
-
node = _context13.sent;
|
|
871
|
-
_context13.next = 13;
|
|
872
|
-
break;
|
|
873
|
-
case 10:
|
|
874
|
-
_context13.next = 12;
|
|
875
|
-
return this.nodePages.getNodeById(nodeId);
|
|
876
|
-
case 12:
|
|
877
|
-
node = _context13.sent;
|
|
878
|
-
case 13:
|
|
879
|
-
_nodePages.default.updateAll(node, nodeInPage);
|
|
880
|
-
if (meshMaterial) {
|
|
881
|
-
_nodePages.default.updateMaterialByNodeId(node, this._findOrCreateMaterial(meshMaterial));
|
|
882
|
-
}
|
|
883
|
-
if (texture) {
|
|
884
|
-
texelCountHint = texture.image.height * texture.image.width;
|
|
885
|
-
_nodePages.default.updateTexelCountHintByNodeId(node, texelCountHint);
|
|
886
|
-
}
|
|
887
|
-
if (vertexCount) {
|
|
888
|
-
this.vertexCounter += vertexCount;
|
|
889
|
-
_nodePages.default.updateVertexCountByNodeId(node, vertexCount);
|
|
890
|
-
}
|
|
891
|
-
_nodePages.default.updateNodeAttributeByNodeId(node);
|
|
892
|
-
if (featureCount) {
|
|
893
|
-
_nodePages.default.updateFeatureCountByNodeId(node, featureCount);
|
|
894
|
-
}
|
|
895
|
-
this.nodePages.saveNode(node);
|
|
896
|
-
return _context13.abrupt("return", node);
|
|
897
|
-
case 21:
|
|
898
|
-
case "end":
|
|
899
|
-
return _context13.stop();
|
|
900
|
-
}
|
|
901
|
-
}, _callee13, this);
|
|
902
|
-
}));
|
|
903
|
-
function _updateNodeInNodePages(_x18, _x19, _x20, _x21, _x22) {
|
|
904
|
-
return _updateNodeInNodePages2.apply(this, arguments);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
async _createNode(parentNode, sourceTile, level) {
|
|
346
|
+
var _this$layers, _this$layers$attribut;
|
|
347
|
+
this._checkAddRefinementTypeForTile(sourceTile);
|
|
348
|
+
await this._updateTilesetOptions();
|
|
349
|
+
await this.sourceTileset._loadTile(sourceTile);
|
|
350
|
+
let boundingVolumes = (0, _coordinateConverter.createBoundingVolumes)(sourceTile, this.geoidHeightModel);
|
|
351
|
+
const propertyTable = (0, _geometryConverter.getPropertyTable)(sourceTile.content);
|
|
352
|
+
if (propertyTable && !((_this$layers = this.layers0) !== null && _this$layers !== void 0 && (_this$layers$attribut = _this$layers.attributeStorageInfo) !== null && _this$layers$attribut !== void 0 && _this$layers$attribut.length)) {
|
|
353
|
+
this._convertPropertyTableToNodeAttributes(propertyTable);
|
|
354
|
+
}
|
|
355
|
+
const resourcesData = await this._convertResources(sourceTile, parentNode.inPageId, propertyTable);
|
|
356
|
+
const nodes = [];
|
|
357
|
+
const nodeIds = [];
|
|
358
|
+
const nodesInPage = [];
|
|
359
|
+
const emptyResources = {
|
|
360
|
+
geometry: null,
|
|
361
|
+
compressedGeometry: null,
|
|
362
|
+
texture: null,
|
|
363
|
+
hasUvRegions: false,
|
|
364
|
+
sharedResources: null,
|
|
365
|
+
meshMaterial: null,
|
|
366
|
+
vertexCount: null,
|
|
367
|
+
attributes: null,
|
|
368
|
+
featureCount: null,
|
|
369
|
+
boundingVolumes: null
|
|
370
|
+
};
|
|
371
|
+
for (const resources of resourcesData || [emptyResources]) {
|
|
372
|
+
this.layersHasTexture = this.layersHasTexture || Boolean(resources.texture);
|
|
373
|
+
if (this.generateBoundingVolumes && resources.boundingVolumes) {
|
|
374
|
+
boundingVolumes = resources.boundingVolumes;
|
|
905
375
|
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
geometryBuffer = resources.geometry, compressedGeometry = resources.compressedGeometry, texture = resources.texture, sharedResources = resources.sharedResources, attributes = resources.attributes;
|
|
917
|
-
childPath = (0, _path.join)(this.layers0Path, 'nodes', nodePath);
|
|
918
|
-
slpkChildPath = (0, _path.join)('nodes', nodePath);
|
|
919
|
-
_context14.next = 5;
|
|
920
|
-
return this._writeGeometries(geometryBuffer, compressedGeometry, childPath, slpkChildPath);
|
|
921
|
-
case 5:
|
|
922
|
-
_context14.next = 7;
|
|
923
|
-
return this._writeShared(sharedResources, childPath, slpkChildPath, nodePath);
|
|
924
|
-
case 7:
|
|
925
|
-
_context14.next = 9;
|
|
926
|
-
return this._writeTexture(texture, childPath, slpkChildPath);
|
|
927
|
-
case 9:
|
|
928
|
-
_context14.next = 11;
|
|
929
|
-
return this._writeAttributes(attributes, childPath, slpkChildPath);
|
|
930
|
-
case 11:
|
|
931
|
-
case "end":
|
|
932
|
-
return _context14.stop();
|
|
933
|
-
}
|
|
934
|
-
}, _callee14, this);
|
|
935
|
-
}));
|
|
936
|
-
function _writeResources(_x23, _x24) {
|
|
937
|
-
return _writeResources2.apply(this, arguments);
|
|
376
|
+
const lodSelection = (0, _lodConversionUtils.convertGeometricErrorToScreenThreshold)(sourceTile, boundingVolumes);
|
|
377
|
+
const maxScreenThresholdSQ = lodSelection.find(val => val.metricType === 'maxScreenThresholdSQ') || {
|
|
378
|
+
maxError: 0
|
|
379
|
+
};
|
|
380
|
+
const nodeInPage = await this._updateNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentNode.inPageId, resources);
|
|
381
|
+
const nodeData = await _nodeIndexDocument.NodeIndexDocument.createNodeIndexDocument(parentNode, boundingVolumes, lodSelection, nodeInPage, resources);
|
|
382
|
+
const node = await new _nodeIndexDocument.NodeIndexDocument(nodeInPage.index, this).addData(nodeData);
|
|
383
|
+
nodes.push(node);
|
|
384
|
+
if (nodeInPage.mesh) {
|
|
385
|
+
await this._writeResources(resources, node.id);
|
|
938
386
|
}
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
var _writeGeometries2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee15(geometryBuffer, compressedGeometry, childPath, slpkChildPath) {
|
|
945
|
-
var slpkGeometryPath, geometryPath, slpkCompressedGeometryPath, compressedGeometryPath;
|
|
946
|
-
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
947
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
948
|
-
case 0:
|
|
949
|
-
if (!this.options.slpk) {
|
|
950
|
-
_context15.next = 6;
|
|
951
|
-
break;
|
|
952
|
-
}
|
|
953
|
-
slpkGeometryPath = (0, _path.join)(childPath, 'geometries');
|
|
954
|
-
_context15.next = 4;
|
|
955
|
-
return this.writeQueue.enqueue({
|
|
956
|
-
archiveKey: "".concat(slpkChildPath, "/geometries/0.bin.gz"),
|
|
957
|
-
writePromise: function writePromise() {
|
|
958
|
-
return (0, _fileUtils.writeFileForSlpk)(slpkGeometryPath, geometryBuffer, '0.bin');
|
|
959
|
-
}
|
|
960
|
-
});
|
|
961
|
-
case 4:
|
|
962
|
-
_context15.next = 9;
|
|
963
|
-
break;
|
|
964
|
-
case 6:
|
|
965
|
-
geometryPath = (0, _path.join)(childPath, 'geometries/0/');
|
|
966
|
-
_context15.next = 9;
|
|
967
|
-
return this.writeQueue.enqueue({
|
|
968
|
-
writePromise: function writePromise() {
|
|
969
|
-
return (0, _fileUtils.writeFile)(geometryPath, geometryBuffer, 'index.bin');
|
|
970
|
-
}
|
|
971
|
-
});
|
|
972
|
-
case 9:
|
|
973
|
-
if (!this.options.draco) {
|
|
974
|
-
_context15.next = 19;
|
|
975
|
-
break;
|
|
976
|
-
}
|
|
977
|
-
if (!this.options.slpk) {
|
|
978
|
-
_context15.next = 16;
|
|
979
|
-
break;
|
|
980
|
-
}
|
|
981
|
-
slpkCompressedGeometryPath = (0, _path.join)(childPath, 'geometries');
|
|
982
|
-
_context15.next = 14;
|
|
983
|
-
return this.writeQueue.enqueue({
|
|
984
|
-
archiveKey: "".concat(slpkChildPath, "/geometries/1.bin.gz"),
|
|
985
|
-
writePromise: function writePromise() {
|
|
986
|
-
return (0, _fileUtils.writeFileForSlpk)(slpkCompressedGeometryPath, compressedGeometry, '1.bin');
|
|
987
|
-
}
|
|
988
|
-
});
|
|
989
|
-
case 14:
|
|
990
|
-
_context15.next = 19;
|
|
991
|
-
break;
|
|
992
|
-
case 16:
|
|
993
|
-
compressedGeometryPath = (0, _path.join)(childPath, 'geometries/1/');
|
|
994
|
-
_context15.next = 19;
|
|
995
|
-
return this.writeQueue.enqueue({
|
|
996
|
-
writePromise: function writePromise() {
|
|
997
|
-
return (0, _fileUtils.writeFile)(compressedGeometryPath, compressedGeometry, 'index.bin');
|
|
998
|
-
}
|
|
999
|
-
});
|
|
1000
|
-
case 19:
|
|
1001
|
-
case "end":
|
|
1002
|
-
return _context15.stop();
|
|
1003
|
-
}
|
|
1004
|
-
}, _callee15, this);
|
|
1005
|
-
}));
|
|
1006
|
-
function _writeGeometries(_x25, _x26, _x27, _x28) {
|
|
1007
|
-
return _writeGeometries2.apply(this, arguments);
|
|
387
|
+
if (this.validate) {
|
|
388
|
+
this.boundingVolumeWarnings = (0, _nodeDebug.validateNodeBoundingVolumes)(nodeData);
|
|
389
|
+
if (this.boundingVolumeWarnings && this.boundingVolumeWarnings.length) {
|
|
390
|
+
console.warn('Bounding Volume Warnings: ', ...this.boundingVolumeWarnings);
|
|
391
|
+
}
|
|
1008
392
|
}
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
393
|
+
nodeIds.push(nodeInPage.index);
|
|
394
|
+
nodesInPage.push(nodeInPage);
|
|
395
|
+
}
|
|
396
|
+
sourceTile.unloadContent();
|
|
397
|
+
await this._addChildrenWithNeighborsAndWriteFile({
|
|
398
|
+
parentNode: nodes[0],
|
|
399
|
+
sourceTiles: sourceTile.children,
|
|
400
|
+
level: level + 1
|
|
401
|
+
});
|
|
402
|
+
return nodes;
|
|
403
|
+
}
|
|
404
|
+
async _convertResources(sourceTile, parentId, propertyTable) {
|
|
405
|
+
var _this$layers2;
|
|
406
|
+
if (!this.isContentSupported(sourceTile)) {
|
|
407
|
+
return null;
|
|
408
|
+
}
|
|
409
|
+
const draftObb = {
|
|
410
|
+
center: [],
|
|
411
|
+
halfSize: [],
|
|
412
|
+
quaternion: []
|
|
413
|
+
};
|
|
414
|
+
const resourcesData = await (0, _geometryConverter.default)(sourceTile.content, async () => (await this.nodePages.push({
|
|
415
|
+
index: 0,
|
|
416
|
+
obb: draftObb
|
|
417
|
+
}, parentId)).index, propertyTable, this.featuresHashArray, (_this$layers2 = this.layers0) === null || _this$layers2 === void 0 ? void 0 : _this$layers2.attributeStorageInfo, this.options.draco, this.generateBoundingVolumes, this.options.mergeMaterials, this.geoidHeightModel, this.workerSource);
|
|
418
|
+
return resourcesData;
|
|
419
|
+
}
|
|
420
|
+
async _updateNodeInNodePages(maxScreenThresholdSQ, boundingVolumes, sourceTile, parentId, resources) {
|
|
421
|
+
const {
|
|
422
|
+
meshMaterial,
|
|
423
|
+
texture,
|
|
424
|
+
vertexCount,
|
|
425
|
+
featureCount,
|
|
426
|
+
geometry,
|
|
427
|
+
hasUvRegions
|
|
428
|
+
} = resources;
|
|
429
|
+
const nodeInPage = {
|
|
430
|
+
index: 0,
|
|
431
|
+
lodThreshold: maxScreenThresholdSQ.maxError,
|
|
432
|
+
obb: boundingVolumes.obb,
|
|
433
|
+
children: []
|
|
434
|
+
};
|
|
435
|
+
if (geometry && this.isContentSupported(sourceTile)) {
|
|
436
|
+
nodeInPage.mesh = {
|
|
437
|
+
geometry: {
|
|
438
|
+
definition: this.findOrCreateGeometryDefinition(Boolean(texture), hasUvRegions),
|
|
439
|
+
resource: 0
|
|
440
|
+
},
|
|
441
|
+
attribute: {
|
|
442
|
+
resource: 0
|
|
443
|
+
},
|
|
444
|
+
material: {
|
|
445
|
+
definition: 0
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
let nodeId = resources.nodeId;
|
|
450
|
+
let node;
|
|
451
|
+
if (!nodeId) {
|
|
452
|
+
node = await this.nodePages.push(nodeInPage, parentId);
|
|
453
|
+
} else {
|
|
454
|
+
node = await this.nodePages.getNodeById(nodeId);
|
|
455
|
+
}
|
|
456
|
+
_nodePages.default.updateAll(node, nodeInPage);
|
|
457
|
+
if (meshMaterial) {
|
|
458
|
+
_nodePages.default.updateMaterialByNodeId(node, this._findOrCreateMaterial(meshMaterial));
|
|
459
|
+
}
|
|
460
|
+
if (texture) {
|
|
461
|
+
const texelCountHint = texture.image.height * texture.image.width;
|
|
462
|
+
_nodePages.default.updateTexelCountHintByNodeId(node, texelCountHint);
|
|
463
|
+
}
|
|
464
|
+
if (vertexCount) {
|
|
465
|
+
this.vertexCounter += vertexCount;
|
|
466
|
+
_nodePages.default.updateVertexCountByNodeId(node, vertexCount);
|
|
467
|
+
}
|
|
468
|
+
_nodePages.default.updateNodeAttributeByNodeId(node);
|
|
469
|
+
if (featureCount) {
|
|
470
|
+
_nodePages.default.updateFeatureCountByNodeId(node, featureCount);
|
|
471
|
+
}
|
|
472
|
+
this.nodePages.saveNode(node);
|
|
473
|
+
return node;
|
|
474
|
+
}
|
|
475
|
+
async _writeResources(resources, nodePath) {
|
|
476
|
+
const {
|
|
477
|
+
geometry: geometryBuffer,
|
|
478
|
+
compressedGeometry,
|
|
479
|
+
texture,
|
|
480
|
+
sharedResources,
|
|
481
|
+
attributes
|
|
482
|
+
} = resources;
|
|
483
|
+
const childPath = (0, _path.join)(this.layers0Path, 'nodes', nodePath);
|
|
484
|
+
const slpkChildPath = (0, _path.join)('nodes', nodePath);
|
|
485
|
+
await this._writeGeometries(geometryBuffer, compressedGeometry, childPath, slpkChildPath);
|
|
486
|
+
await this._writeShared(sharedResources, childPath, slpkChildPath, nodePath);
|
|
487
|
+
await this._writeTexture(texture, childPath, slpkChildPath);
|
|
488
|
+
await this._writeAttributes(attributes, childPath, slpkChildPath);
|
|
489
|
+
}
|
|
490
|
+
async _writeGeometries(geometryBuffer, compressedGeometry, childPath, slpkChildPath) {
|
|
491
|
+
if (this.options.slpk) {
|
|
492
|
+
const slpkGeometryPath = (0, _path.join)(childPath, 'geometries');
|
|
493
|
+
await this.writeQueue.enqueue({
|
|
494
|
+
archiveKey: "".concat(slpkChildPath, "/geometries/0.bin.gz"),
|
|
495
|
+
writePromise: () => (0, _fileUtils.writeFileForSlpk)(slpkGeometryPath, geometryBuffer, '0.bin')
|
|
496
|
+
});
|
|
497
|
+
} else {
|
|
498
|
+
const geometryPath = (0, _path.join)(childPath, 'geometries/0/');
|
|
499
|
+
await this.writeQueue.enqueue({
|
|
500
|
+
writePromise: () => (0, _fileUtils.writeFile)(geometryPath, geometryBuffer, 'index.bin')
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
if (this.options.draco) {
|
|
504
|
+
if (this.options.slpk) {
|
|
505
|
+
const slpkCompressedGeometryPath = (0, _path.join)(childPath, 'geometries');
|
|
506
|
+
await this.writeQueue.enqueue({
|
|
507
|
+
archiveKey: "".concat(slpkChildPath, "/geometries/1.bin.gz"),
|
|
508
|
+
writePromise: () => (0, _fileUtils.writeFileForSlpk)(slpkCompressedGeometryPath, compressedGeometry, '1.bin')
|
|
509
|
+
});
|
|
510
|
+
} else {
|
|
511
|
+
const compressedGeometryPath = (0, _path.join)(childPath, 'geometries/1/');
|
|
512
|
+
await this.writeQueue.enqueue({
|
|
513
|
+
writePromise: () => (0, _fileUtils.writeFile)(compressedGeometryPath, compressedGeometry, 'index.bin')
|
|
514
|
+
});
|
|
1059
515
|
}
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
async _writeShared(sharedResources, childPath, slpkChildPath, nodePath) {
|
|
519
|
+
if (!sharedResources) {
|
|
520
|
+
return;
|
|
521
|
+
}
|
|
522
|
+
sharedResources.nodePath = nodePath;
|
|
523
|
+
const sharedData = (0, _jsonMapTransform.default)(sharedResources, (0, _sharedResources.SHARED_RESOURCES)());
|
|
524
|
+
const sharedDataStr = JSON.stringify(sharedData);
|
|
525
|
+
if (this.options.slpk) {
|
|
526
|
+
const slpkSharedPath = (0, _path.join)(childPath, 'shared');
|
|
527
|
+
await this.writeQueue.enqueue({
|
|
528
|
+
archiveKey: "".concat(slpkChildPath, "/shared/sharedResource.json.gz"),
|
|
529
|
+
writePromise: () => (0, _fileUtils.writeFileForSlpk)(slpkSharedPath, sharedDataStr, 'sharedResource.json')
|
|
530
|
+
});
|
|
531
|
+
} else {
|
|
532
|
+
const sharedPath = (0, _path.join)(childPath, 'shared/');
|
|
533
|
+
await this.writeQueue.enqueue({
|
|
534
|
+
writePromise: () => (0, _fileUtils.writeFile)(sharedPath, sharedDataStr)
|
|
535
|
+
});
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
async _writeTexture(texture, childPath, slpkChildPath) {
|
|
539
|
+
if (texture) {
|
|
540
|
+
const format = this._getFormatByMimeType(texture === null || texture === void 0 ? void 0 : texture.mimeType);
|
|
541
|
+
const formats = [];
|
|
542
|
+
const textureData = texture.bufferView.data;
|
|
543
|
+
switch (format) {
|
|
544
|
+
case 'jpg':
|
|
545
|
+
case 'png':
|
|
546
|
+
{
|
|
547
|
+
formats.push({
|
|
548
|
+
name: '0',
|
|
549
|
+
format
|
|
550
|
+
});
|
|
551
|
+
await this.writeTextureFile(textureData, '0', format, childPath, slpkChildPath);
|
|
552
|
+
if (this.generateTextures) {
|
|
1092
553
|
formats.push({
|
|
1093
554
|
name: '1',
|
|
1094
555
|
format: 'ktx2'
|
|
1095
556
|
});
|
|
1096
|
-
copyArrayBuffer = texture.image.data.subarray();
|
|
1097
|
-
arrayToEncode = new Uint8Array(copyArrayBuffer);
|
|
1098
|
-
ktx2TextureData = (0, _core.encode)(
|
|
557
|
+
const copyArrayBuffer = texture.image.data.subarray();
|
|
558
|
+
const arrayToEncode = new Uint8Array(copyArrayBuffer);
|
|
559
|
+
const ktx2TextureData = (0, _core.encode)({
|
|
560
|
+
...texture.image,
|
|
1099
561
|
data: arrayToEncode
|
|
1100
|
-
}
|
|
562
|
+
}, _textures.KTX2BasisWriterWorker, {
|
|
563
|
+
..._textures.KTX2BasisWriterWorker.options,
|
|
1101
564
|
source: this.workerSource.ktx2,
|
|
1102
565
|
reuseWorkers: true,
|
|
1103
566
|
_nodeWorkers: true
|
|
1104
|
-
}));
|
|
1105
|
-
_context17.next = 17;
|
|
1106
|
-
return this.writeTextureFile(ktx2TextureData, '1', 'ktx2', childPath, slpkChildPath);
|
|
1107
|
-
case 17:
|
|
1108
|
-
return _context17.abrupt("break", 26);
|
|
1109
|
-
case 18:
|
|
1110
|
-
formats.push({
|
|
1111
|
-
name: '1',
|
|
1112
|
-
format: format
|
|
1113
567
|
});
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
568
|
+
await this.writeTextureFile(ktx2TextureData, '1', 'ktx2', childPath, slpkChildPath);
|
|
569
|
+
}
|
|
570
|
+
break;
|
|
571
|
+
}
|
|
572
|
+
case 'ktx2':
|
|
573
|
+
{
|
|
574
|
+
formats.push({
|
|
575
|
+
name: '1',
|
|
576
|
+
format
|
|
577
|
+
});
|
|
578
|
+
await this.writeTextureFile(textureData, '1', format, childPath, slpkChildPath);
|
|
579
|
+
if (this.generateTextures) {
|
|
1121
580
|
formats.push({
|
|
1122
581
|
name: '0',
|
|
1123
582
|
format: 'jpg'
|
|
1124
583
|
});
|
|
1125
|
-
decodedFromKTX2TextureData = (0, _core.encode)(texture.image.data[0], _images.ImageWriter);
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
case 26:
|
|
1129
|
-
if (!this.layers0.textureSetDefinitions.length) {
|
|
1130
|
-
this.layers0.textureSetDefinitions.push({
|
|
1131
|
-
formats: formats
|
|
1132
|
-
});
|
|
1133
|
-
this.layers0.textureSetDefinitions.push({
|
|
1134
|
-
formats: formats,
|
|
1135
|
-
atlas: true
|
|
1136
|
-
});
|
|
1137
|
-
}
|
|
1138
|
-
case 27:
|
|
1139
|
-
case "end":
|
|
1140
|
-
return _context17.stop();
|
|
584
|
+
const decodedFromKTX2TextureData = (0, _core.encode)(texture.image.data[0], _images.ImageWriter);
|
|
585
|
+
await this.writeTextureFile(decodedFromKTX2TextureData, '0', 'jpg', childPath, slpkChildPath);
|
|
586
|
+
}
|
|
1141
587
|
}
|
|
1142
|
-
}, _callee17, this);
|
|
1143
|
-
}));
|
|
1144
|
-
function _writeTexture(_x33, _x34, _x35) {
|
|
1145
|
-
return _writeTexture2.apply(this, arguments);
|
|
1146
588
|
}
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
while (1) switch (_context18.prev = _context18.next) {
|
|
1156
|
-
case 0:
|
|
1157
|
-
if (!this.options.slpk) {
|
|
1158
|
-
_context18.next = 7;
|
|
1159
|
-
break;
|
|
1160
|
-
}
|
|
1161
|
-
slpkTexturePath = (0, _path.join)(childPath, 'textures');
|
|
1162
|
-
compress = false;
|
|
1163
|
-
_context18.next = 5;
|
|
1164
|
-
return this.writeQueue.enqueue({
|
|
1165
|
-
archiveKey: "".concat(slpkChildPath, "/textures/").concat(name, ".").concat(format),
|
|
1166
|
-
writePromise: function writePromise() {
|
|
1167
|
-
return (0, _fileUtils.writeFileForSlpk)(slpkTexturePath, textureData, "".concat(name, ".").concat(format), compress);
|
|
1168
|
-
}
|
|
1169
|
-
});
|
|
1170
|
-
case 5:
|
|
1171
|
-
_context18.next = 10;
|
|
1172
|
-
break;
|
|
1173
|
-
case 7:
|
|
1174
|
-
texturePath = (0, _path.join)(childPath, "textures/".concat(name, "/"));
|
|
1175
|
-
_context18.next = 10;
|
|
1176
|
-
return this.writeQueue.enqueue({
|
|
1177
|
-
writePromise: function writePromise() {
|
|
1178
|
-
return (0, _fileUtils.writeFile)(texturePath, textureData, "index.".concat(format));
|
|
1179
|
-
}
|
|
1180
|
-
});
|
|
1181
|
-
case 10:
|
|
1182
|
-
case "end":
|
|
1183
|
-
return _context18.stop();
|
|
1184
|
-
}
|
|
1185
|
-
}, _callee18, this);
|
|
1186
|
-
}));
|
|
1187
|
-
function writeTextureFile(_x36, _x37, _x38, _x39, _x40) {
|
|
1188
|
-
return _writeTextureFile.apply(this, arguments);
|
|
1189
|
-
}
|
|
1190
|
-
return writeTextureFile;
|
|
1191
|
-
}()
|
|
1192
|
-
}, {
|
|
1193
|
-
key: "_writeAttributes",
|
|
1194
|
-
value: function () {
|
|
1195
|
-
var _writeAttributes2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee19() {
|
|
1196
|
-
var _this$layers3,
|
|
1197
|
-
_this$layers3$attribu,
|
|
1198
|
-
_this4 = this;
|
|
1199
|
-
var attributes,
|
|
1200
|
-
childPath,
|
|
1201
|
-
slpkChildPath,
|
|
1202
|
-
_loop,
|
|
1203
|
-
index,
|
|
1204
|
-
_args20 = arguments;
|
|
1205
|
-
return _regenerator.default.wrap(function _callee19$(_context20) {
|
|
1206
|
-
while (1) switch (_context20.prev = _context20.next) {
|
|
1207
|
-
case 0:
|
|
1208
|
-
attributes = _args20.length > 0 && _args20[0] !== undefined ? _args20[0] : [];
|
|
1209
|
-
childPath = _args20.length > 1 ? _args20[1] : undefined;
|
|
1210
|
-
slpkChildPath = _args20.length > 2 ? _args20[2] : undefined;
|
|
1211
|
-
if (!(attributes !== null && attributes !== void 0 && attributes.length && (_this$layers3 = this.layers0) !== null && _this$layers3 !== void 0 && (_this$layers3$attribu = _this$layers3.attributeStorageInfo) !== null && _this$layers3$attribu !== void 0 && _this$layers3$attribu.length)) {
|
|
1212
|
-
_context20.next = 11;
|
|
1213
|
-
break;
|
|
1214
|
-
}
|
|
1215
|
-
_loop = _regenerator.default.mark(function _loop() {
|
|
1216
|
-
var folderName, fileBuffer, slpkAttributesPath, attributesPath;
|
|
1217
|
-
return _regenerator.default.wrap(function _loop$(_context19) {
|
|
1218
|
-
while (1) switch (_context19.prev = _context19.next) {
|
|
1219
|
-
case 0:
|
|
1220
|
-
folderName = _this4.layers0.attributeStorageInfo[index].key;
|
|
1221
|
-
fileBuffer = new Uint8Array(attributes[index]);
|
|
1222
|
-
if (!_this4.options.slpk) {
|
|
1223
|
-
_context19.next = 8;
|
|
1224
|
-
break;
|
|
1225
|
-
}
|
|
1226
|
-
slpkAttributesPath = (0, _path.join)(childPath, 'attributes', folderName);
|
|
1227
|
-
_context19.next = 6;
|
|
1228
|
-
return _this4.writeQueue.enqueue({
|
|
1229
|
-
archiveKey: "".concat(slpkChildPath, "/attributes/").concat(folderName, ".bin.gz"),
|
|
1230
|
-
writePromise: function writePromise() {
|
|
1231
|
-
return (0, _fileUtils.writeFileForSlpk)(slpkAttributesPath, fileBuffer, '0.bin');
|
|
1232
|
-
}
|
|
1233
|
-
});
|
|
1234
|
-
case 6:
|
|
1235
|
-
_context19.next = 11;
|
|
1236
|
-
break;
|
|
1237
|
-
case 8:
|
|
1238
|
-
attributesPath = (0, _path.join)(childPath, "attributes/".concat(folderName, "/0"));
|
|
1239
|
-
_context19.next = 11;
|
|
1240
|
-
return _this4.writeQueue.enqueue({
|
|
1241
|
-
writePromise: function writePromise() {
|
|
1242
|
-
return (0, _fileUtils.writeFile)(attributesPath, fileBuffer, 'index.bin');
|
|
1243
|
-
}
|
|
1244
|
-
});
|
|
1245
|
-
case 11:
|
|
1246
|
-
case "end":
|
|
1247
|
-
return _context19.stop();
|
|
1248
|
-
}
|
|
1249
|
-
}, _loop);
|
|
1250
|
-
});
|
|
1251
|
-
index = 0;
|
|
1252
|
-
case 6:
|
|
1253
|
-
if (!(index < attributes.length)) {
|
|
1254
|
-
_context20.next = 11;
|
|
1255
|
-
break;
|
|
1256
|
-
}
|
|
1257
|
-
return _context20.delegateYield(_loop(), "t0", 8);
|
|
1258
|
-
case 8:
|
|
1259
|
-
index++;
|
|
1260
|
-
_context20.next = 6;
|
|
1261
|
-
break;
|
|
1262
|
-
case 11:
|
|
1263
|
-
case "end":
|
|
1264
|
-
return _context20.stop();
|
|
1265
|
-
}
|
|
1266
|
-
}, _callee19, this);
|
|
1267
|
-
}));
|
|
1268
|
-
function _writeAttributes() {
|
|
1269
|
-
return _writeAttributes2.apply(this, arguments);
|
|
589
|
+
if (!this.layers0.textureSetDefinitions.length) {
|
|
590
|
+
this.layers0.textureSetDefinitions.push({
|
|
591
|
+
formats
|
|
592
|
+
});
|
|
593
|
+
this.layers0.textureSetDefinitions.push({
|
|
594
|
+
formats,
|
|
595
|
+
atlas: true
|
|
596
|
+
});
|
|
1270
597
|
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
async writeTextureFile(textureData, name, format, childPath, slpkChildPath) {
|
|
601
|
+
if (this.options.slpk) {
|
|
602
|
+
const slpkTexturePath = (0, _path.join)(childPath, 'textures');
|
|
603
|
+
const compress = false;
|
|
604
|
+
await this.writeQueue.enqueue({
|
|
605
|
+
archiveKey: "".concat(slpkChildPath, "/textures/").concat(name, ".").concat(format),
|
|
606
|
+
writePromise: () => (0, _fileUtils.writeFileForSlpk)(slpkTexturePath, textureData, "".concat(name, ".").concat(format), compress)
|
|
607
|
+
});
|
|
608
|
+
} else {
|
|
609
|
+
const texturePath = (0, _path.join)(childPath, "textures/".concat(name, "/"));
|
|
610
|
+
await this.writeQueue.enqueue({
|
|
611
|
+
writePromise: () => (0, _fileUtils.writeFile)(texturePath, textureData, "index.".concat(format))
|
|
612
|
+
});
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
async _writeAttributes() {
|
|
616
|
+
var _this$layers3, _this$layers3$attribu;
|
|
617
|
+
let attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
618
|
+
let childPath = arguments.length > 1 ? arguments[1] : undefined;
|
|
619
|
+
let slpkChildPath = arguments.length > 2 ? arguments[2] : undefined;
|
|
620
|
+
if (attributes !== null && attributes !== void 0 && attributes.length && (_this$layers3 = this.layers0) !== null && _this$layers3 !== void 0 && (_this$layers3$attribu = _this$layers3.attributeStorageInfo) !== null && _this$layers3$attribu !== void 0 && _this$layers3$attribu.length) {
|
|
621
|
+
for (let index = 0; index < attributes.length; index++) {
|
|
622
|
+
const folderName = this.layers0.attributeStorageInfo[index].key;
|
|
623
|
+
const fileBuffer = new Uint8Array(attributes[index]);
|
|
624
|
+
if (this.options.slpk) {
|
|
625
|
+
const slpkAttributesPath = (0, _path.join)(childPath, 'attributes', folderName);
|
|
626
|
+
await this.writeQueue.enqueue({
|
|
627
|
+
archiveKey: "".concat(slpkChildPath, "/attributes/").concat(folderName, ".bin.gz"),
|
|
628
|
+
writePromise: () => (0, _fileUtils.writeFileForSlpk)(slpkAttributesPath, fileBuffer, '0.bin')
|
|
629
|
+
});
|
|
630
|
+
} else {
|
|
631
|
+
const attributesPath = (0, _path.join)(childPath, "attributes/".concat(folderName, "/0"));
|
|
632
|
+
await this.writeQueue.enqueue({
|
|
633
|
+
writePromise: () => (0, _fileUtils.writeFile)(attributesPath, fileBuffer, 'index.bin')
|
|
634
|
+
});
|
|
635
|
+
}
|
|
1285
636
|
}
|
|
1286
637
|
}
|
|
1287
|
-
}
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
638
|
+
}
|
|
639
|
+
_getFormatByMimeType(mimeType) {
|
|
640
|
+
switch (mimeType) {
|
|
641
|
+
case 'image/jpeg':
|
|
642
|
+
return 'jpg';
|
|
643
|
+
case 'image/png':
|
|
644
|
+
return 'png';
|
|
645
|
+
case 'image/ktx2':
|
|
646
|
+
return 'ktx2';
|
|
647
|
+
default:
|
|
648
|
+
return 'jpg';
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
_findOrCreateMaterial(material) {
|
|
652
|
+
const hash = (0, _md.default)(JSON.stringify(material));
|
|
653
|
+
if (this.materialMap.has(hash)) {
|
|
654
|
+
return this.materialMap.get(hash) || 0;
|
|
655
|
+
}
|
|
656
|
+
const newMaterialId = this.materialDefinitions.push(material) - 1;
|
|
657
|
+
this.materialMap.set(hash, newMaterialId);
|
|
658
|
+
return newMaterialId;
|
|
659
|
+
}
|
|
660
|
+
findOrCreateGeometryDefinition(hasTexture, hasUvRegions) {
|
|
661
|
+
const geometryConfig = {
|
|
662
|
+
hasTexture,
|
|
663
|
+
hasUvRegions
|
|
664
|
+
};
|
|
665
|
+
const hash = (0, _md.default)(JSON.stringify(geometryConfig));
|
|
666
|
+
if (this.geometryMap.has(hash)) {
|
|
667
|
+
return this.geometryMap.get(hash) || 0;
|
|
668
|
+
}
|
|
669
|
+
const newGeometryId = this.geometryConfigs.push(geometryConfig) - 1;
|
|
670
|
+
this.geometryMap.set(hash, newGeometryId);
|
|
671
|
+
return newGeometryId;
|
|
672
|
+
}
|
|
673
|
+
_convertPropertyTableToNodeAttributes(propertyTable) {
|
|
674
|
+
let attributeIndex = 0;
|
|
675
|
+
const propertyTableWithObjectId = {
|
|
676
|
+
OBJECTID: [0],
|
|
677
|
+
...propertyTable
|
|
678
|
+
};
|
|
679
|
+
for (const key in propertyTableWithObjectId) {
|
|
680
|
+
const firstAttribute = propertyTableWithObjectId[key][0];
|
|
681
|
+
const attributeType = (0, _featureAttributes.getAttributeType)(key, firstAttribute);
|
|
682
|
+
const storageAttribute = (0, _featureAttributes.createdStorageAttribute)(attributeIndex, key, attributeType);
|
|
683
|
+
const fieldAttributeType = (0, _featureAttributes.getFieldAttributeType)(attributeType);
|
|
684
|
+
const fieldAttribute = (0, _featureAttributes.createFieldAttribute)(key, fieldAttributeType);
|
|
685
|
+
const popupInfo = (0, _featureAttributes.createPopupInfo)(propertyTableWithObjectId);
|
|
686
|
+
this.layers0.attributeStorageInfo.push(storageAttribute);
|
|
687
|
+
this.layers0.fields.push(fieldAttribute);
|
|
688
|
+
this.layers0.popupInfo = popupInfo;
|
|
689
|
+
this.layers0.layerType = _3D_OBJECT_LAYER_TYPE;
|
|
690
|
+
attributeIndex += 1;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
async _finishConversion(params) {
|
|
694
|
+
const {
|
|
695
|
+
tilesCount,
|
|
696
|
+
tilesWithAddRefineCount
|
|
697
|
+
} = this.refinementCounter;
|
|
698
|
+
const addRefinementPercentage = tilesWithAddRefineCount ? tilesWithAddRefineCount / tilesCount * 100 : 0;
|
|
699
|
+
const filesSize = await (0, _statisticUtills.calculateFilesSize)(params);
|
|
700
|
+
const diff = _process.default.hrtime(this.conversionStartTime);
|
|
701
|
+
const conversionTime = (0, _statisticUtills.timeConverter)(diff);
|
|
702
|
+
console.log("------------------------------------------------");
|
|
703
|
+
console.log("Finishing conversion of ".concat(_3D_TILES));
|
|
704
|
+
console.log("Total conversion time: ".concat(conversionTime));
|
|
705
|
+
console.log("Vertex count: ", this.vertexCounter);
|
|
706
|
+
console.log("File(s) size: ", filesSize, ' bytes');
|
|
707
|
+
console.log("Percentage of tiles with \"ADD\" refinement type:", addRefinementPercentage, '%');
|
|
708
|
+
console.log("------------------------------------------------");
|
|
709
|
+
}
|
|
710
|
+
async _fetchPreloadOptions() {
|
|
711
|
+
if (!this.Loader.preload) {
|
|
712
|
+
return {};
|
|
713
|
+
}
|
|
714
|
+
const options = {
|
|
715
|
+
'cesium-ion': {
|
|
716
|
+
accessToken: this.options.token || ION_DEFAULT_TOKEN
|
|
1293
717
|
}
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
718
|
+
};
|
|
719
|
+
const preloadOptions = await this.Loader.preload(this.options.inputUrl, options);
|
|
720
|
+
this.refreshTokenTime = _process.default.hrtime();
|
|
721
|
+
return {
|
|
722
|
+
...options,
|
|
723
|
+
...preloadOptions
|
|
724
|
+
};
|
|
725
|
+
}
|
|
726
|
+
async _updateTilesetOptions() {
|
|
727
|
+
const diff = _process.default.hrtime(this.refreshTokenTime);
|
|
728
|
+
if (diff[0] < REFRESH_TOKEN_TIMEOUT) {
|
|
729
|
+
return;
|
|
1297
730
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
731
|
+
this.refreshTokenTime = _process.default.hrtime();
|
|
732
|
+
const preloadOptions = await this._fetchPreloadOptions();
|
|
733
|
+
this.sourceTileset.options = {
|
|
734
|
+
...this.sourceTileset.options,
|
|
735
|
+
...preloadOptions
|
|
736
|
+
};
|
|
737
|
+
if (preloadOptions.headers) {
|
|
738
|
+
this.sourceTileset.loadOptions.fetch = {
|
|
739
|
+
...this.sourceTileset.loadOptions.fetch,
|
|
740
|
+
headers: preloadOptions.headers
|
|
1304
741
|
};
|
|
1305
|
-
|
|
1306
|
-
if (this.geometryMap.has(hash)) {
|
|
1307
|
-
return this.geometryMap.get(hash) || 0;
|
|
1308
|
-
}
|
|
1309
|
-
var newGeometryId = this.geometryConfigs.push(geometryConfig) - 1;
|
|
1310
|
-
this.geometryMap.set(hash, newGeometryId);
|
|
1311
|
-
return newGeometryId;
|
|
742
|
+
console.log('Authorization Bearer token has been updated');
|
|
1312
743
|
}
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
}, propertyTable);
|
|
1320
|
-
for (var _key in propertyTableWithObjectId) {
|
|
1321
|
-
var firstAttribute = propertyTableWithObjectId[_key][0];
|
|
1322
|
-
var attributeType = (0, _featureAttributes.getAttributeType)(_key, firstAttribute);
|
|
1323
|
-
var storageAttribute = (0, _featureAttributes.createdStorageAttribute)(attributeIndex, _key, attributeType);
|
|
1324
|
-
var fieldAttributeType = (0, _featureAttributes.getFieldAttributeType)(attributeType);
|
|
1325
|
-
var fieldAttribute = (0, _featureAttributes.createFieldAttribute)(_key, fieldAttributeType);
|
|
1326
|
-
var popupInfo = (0, _featureAttributes.createPopupInfo)(propertyTableWithObjectId);
|
|
1327
|
-
this.layers0.attributeStorageInfo.push(storageAttribute);
|
|
1328
|
-
this.layers0.fields.push(fieldAttribute);
|
|
1329
|
-
this.layers0.popupInfo = popupInfo;
|
|
1330
|
-
this.layers0.layerType = _3D_OBJECT_LAYER_TYPE;
|
|
1331
|
-
attributeIndex += 1;
|
|
1332
|
-
}
|
|
744
|
+
}
|
|
745
|
+
_checkAddRefinementTypeForTile(tile) {
|
|
746
|
+
const ADD_TILE_REFINEMENT = 1;
|
|
747
|
+
if (tile.refine === ADD_TILE_REFINEMENT) {
|
|
748
|
+
this.refinementCounter.tilesWithAddRefineCount += 1;
|
|
749
|
+
console.warn('This tile uses "ADD" type of refinement');
|
|
1333
750
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
conversionTime = (0, _statisticUtills.timeConverter)(diff);
|
|
1350
|
-
console.log("------------------------------------------------");
|
|
1351
|
-
console.log("Finishing conversion of ".concat(_3D_TILES));
|
|
1352
|
-
console.log("Total conversion time: ".concat(conversionTime));
|
|
1353
|
-
console.log("Vertex count: ", this.vertexCounter);
|
|
1354
|
-
console.log("File(s) size: ", filesSize, ' bytes');
|
|
1355
|
-
console.log("Percentage of tiles with \"ADD\" refinement type:", addRefinementPercentage, '%');
|
|
1356
|
-
console.log("------------------------------------------------");
|
|
1357
|
-
case 14:
|
|
1358
|
-
case "end":
|
|
1359
|
-
return _context21.stop();
|
|
1360
|
-
}
|
|
1361
|
-
}, _callee20, this);
|
|
1362
|
-
}));
|
|
1363
|
-
function _finishConversion(_x41) {
|
|
1364
|
-
return _finishConversion2.apply(this, arguments);
|
|
1365
|
-
}
|
|
1366
|
-
return _finishConversion;
|
|
1367
|
-
}()
|
|
1368
|
-
}, {
|
|
1369
|
-
key: "_fetchPreloadOptions",
|
|
1370
|
-
value: function () {
|
|
1371
|
-
var _fetchPreloadOptions2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee21() {
|
|
1372
|
-
var options, preloadOptions;
|
|
1373
|
-
return _regenerator.default.wrap(function _callee21$(_context22) {
|
|
1374
|
-
while (1) switch (_context22.prev = _context22.next) {
|
|
1375
|
-
case 0:
|
|
1376
|
-
if (this.Loader.preload) {
|
|
1377
|
-
_context22.next = 2;
|
|
1378
|
-
break;
|
|
1379
|
-
}
|
|
1380
|
-
return _context22.abrupt("return", {});
|
|
1381
|
-
case 2:
|
|
1382
|
-
options = {
|
|
1383
|
-
'cesium-ion': {
|
|
1384
|
-
accessToken: this.options.token || ION_DEFAULT_TOKEN
|
|
1385
|
-
}
|
|
1386
|
-
};
|
|
1387
|
-
_context22.next = 5;
|
|
1388
|
-
return this.Loader.preload(this.options.inputUrl, options);
|
|
1389
|
-
case 5:
|
|
1390
|
-
preloadOptions = _context22.sent;
|
|
1391
|
-
this.refreshTokenTime = _process.default.hrtime();
|
|
1392
|
-
return _context22.abrupt("return", _objectSpread(_objectSpread({}, options), preloadOptions));
|
|
1393
|
-
case 8:
|
|
1394
|
-
case "end":
|
|
1395
|
-
return _context22.stop();
|
|
1396
|
-
}
|
|
1397
|
-
}, _callee21, this);
|
|
1398
|
-
}));
|
|
1399
|
-
function _fetchPreloadOptions() {
|
|
1400
|
-
return _fetchPreloadOptions2.apply(this, arguments);
|
|
1401
|
-
}
|
|
1402
|
-
return _fetchPreloadOptions;
|
|
1403
|
-
}()
|
|
1404
|
-
}, {
|
|
1405
|
-
key: "_updateTilesetOptions",
|
|
1406
|
-
value: function () {
|
|
1407
|
-
var _updateTilesetOptions2 = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee22() {
|
|
1408
|
-
var diff, preloadOptions;
|
|
1409
|
-
return _regenerator.default.wrap(function _callee22$(_context23) {
|
|
1410
|
-
while (1) switch (_context23.prev = _context23.next) {
|
|
1411
|
-
case 0:
|
|
1412
|
-
diff = _process.default.hrtime(this.refreshTokenTime);
|
|
1413
|
-
if (!(diff[0] < REFRESH_TOKEN_TIMEOUT)) {
|
|
1414
|
-
_context23.next = 3;
|
|
1415
|
-
break;
|
|
1416
|
-
}
|
|
1417
|
-
return _context23.abrupt("return");
|
|
1418
|
-
case 3:
|
|
1419
|
-
this.refreshTokenTime = _process.default.hrtime();
|
|
1420
|
-
_context23.next = 6;
|
|
1421
|
-
return this._fetchPreloadOptions();
|
|
1422
|
-
case 6:
|
|
1423
|
-
preloadOptions = _context23.sent;
|
|
1424
|
-
this.sourceTileset.options = _objectSpread(_objectSpread({}, this.sourceTileset.options), preloadOptions);
|
|
1425
|
-
if (preloadOptions.headers) {
|
|
1426
|
-
this.sourceTileset.loadOptions.fetch = _objectSpread(_objectSpread({}, this.sourceTileset.loadOptions.fetch), {}, {
|
|
1427
|
-
headers: preloadOptions.headers
|
|
1428
|
-
});
|
|
1429
|
-
console.log('Authorization Bearer token has been updated');
|
|
1430
|
-
}
|
|
1431
|
-
case 9:
|
|
1432
|
-
case "end":
|
|
1433
|
-
return _context23.stop();
|
|
1434
|
-
}
|
|
1435
|
-
}, _callee22, this);
|
|
1436
|
-
}));
|
|
1437
|
-
function _updateTilesetOptions() {
|
|
1438
|
-
return _updateTilesetOptions2.apply(this, arguments);
|
|
1439
|
-
}
|
|
1440
|
-
return _updateTilesetOptions;
|
|
1441
|
-
}()
|
|
1442
|
-
}, {
|
|
1443
|
-
key: "_checkAddRefinementTypeForTile",
|
|
1444
|
-
value: function _checkAddRefinementTypeForTile(tile) {
|
|
1445
|
-
var ADD_TILE_REFINEMENT = 1;
|
|
1446
|
-
if (tile.refine === ADD_TILE_REFINEMENT) {
|
|
1447
|
-
this.refinementCounter.tilesWithAddRefineCount += 1;
|
|
1448
|
-
console.warn('This tile uses "ADD" type of refinement');
|
|
1449
|
-
}
|
|
1450
|
-
this.refinementCounter.tilesCount += 1;
|
|
751
|
+
this.refinementCounter.tilesCount += 1;
|
|
752
|
+
}
|
|
753
|
+
isContentSupported(sourceRootTile) {
|
|
754
|
+
var _sourceRootTile$conte;
|
|
755
|
+
return ['b3dm', 'glTF'].includes(sourceRootTile === null || sourceRootTile === void 0 ? void 0 : (_sourceRootTile$conte = sourceRootTile.content) === null || _sourceRootTile$conte === void 0 ? void 0 : _sourceRootTile$conte.type);
|
|
756
|
+
}
|
|
757
|
+
async loadWorkers() {
|
|
758
|
+
console.log("Loading workers source...");
|
|
759
|
+
if (this.options.draco) {
|
|
760
|
+
const url = (0, _workerUtils.getWorkerURL)(_draco.DracoWriterWorker, {
|
|
761
|
+
...(0, _core.getLoaderOptions)()
|
|
762
|
+
});
|
|
763
|
+
const sourceResponse = await (0, _core.fetchFile)(url);
|
|
764
|
+
const source = await sourceResponse.text();
|
|
765
|
+
this.workerSource.draco = source;
|
|
1451
766
|
}
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
767
|
+
if (this.generateTextures) {
|
|
768
|
+
const url = (0, _workerUtils.getWorkerURL)(_textures.KTX2BasisWriterWorker, {
|
|
769
|
+
...(0, _core.getLoaderOptions)()
|
|
770
|
+
});
|
|
771
|
+
const sourceResponse = await (0, _core.fetchFile)(url);
|
|
772
|
+
const source = await sourceResponse.text();
|
|
773
|
+
this.workerSource.ktx2 = source;
|
|
1457
774
|
}
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
if (!this.options.draco) {
|
|
1468
|
-
_context24.next = 10;
|
|
1469
|
-
break;
|
|
1470
|
-
}
|
|
1471
|
-
url = (0, _workerUtils.getWorkerURL)(_draco.DracoWriterWorker, _objectSpread({}, (0, _core.getLoaderOptions)()));
|
|
1472
|
-
_context24.next = 5;
|
|
1473
|
-
return (0, _core.fetchFile)(url);
|
|
1474
|
-
case 5:
|
|
1475
|
-
_sourceResponse = _context24.sent;
|
|
1476
|
-
_context24.next = 8;
|
|
1477
|
-
return _sourceResponse.text();
|
|
1478
|
-
case 8:
|
|
1479
|
-
_source = _context24.sent;
|
|
1480
|
-
this.workerSource.draco = _source;
|
|
1481
|
-
case 10:
|
|
1482
|
-
if (!this.generateTextures) {
|
|
1483
|
-
_context24.next = 19;
|
|
1484
|
-
break;
|
|
1485
|
-
}
|
|
1486
|
-
_url = (0, _workerUtils.getWorkerURL)(_textures.KTX2BasisWriterWorker, _objectSpread({}, (0, _core.getLoaderOptions)()));
|
|
1487
|
-
_context24.next = 14;
|
|
1488
|
-
return (0, _core.fetchFile)(_url);
|
|
1489
|
-
case 14:
|
|
1490
|
-
_sourceResponse2 = _context24.sent;
|
|
1491
|
-
_context24.next = 17;
|
|
1492
|
-
return _sourceResponse2.text();
|
|
1493
|
-
case 17:
|
|
1494
|
-
_source2 = _context24.sent;
|
|
1495
|
-
this.workerSource.ktx2 = _source2;
|
|
1496
|
-
case 19:
|
|
1497
|
-
i3sAttributesWorkerUrl = (0, _workerUtils.getWorkerURL)(_i3sAttributesWorker.I3SAttributesWorker, _objectSpread({}, (0, _core.getLoaderOptions)()));
|
|
1498
|
-
_context24.next = 22;
|
|
1499
|
-
return (0, _core.fetchFile)(i3sAttributesWorkerUrl);
|
|
1500
|
-
case 22:
|
|
1501
|
-
sourceResponse = _context24.sent;
|
|
1502
|
-
_context24.next = 25;
|
|
1503
|
-
return sourceResponse.text();
|
|
1504
|
-
case 25:
|
|
1505
|
-
source = _context24.sent;
|
|
1506
|
-
this.workerSource.I3SAttributes = source;
|
|
1507
|
-
console.log("Loading workers source completed!");
|
|
1508
|
-
case 28:
|
|
1509
|
-
case "end":
|
|
1510
|
-
return _context24.stop();
|
|
1511
|
-
}
|
|
1512
|
-
}, _callee23, this);
|
|
1513
|
-
}));
|
|
1514
|
-
function loadWorkers() {
|
|
1515
|
-
return _loadWorkers.apply(this, arguments);
|
|
1516
|
-
}
|
|
1517
|
-
return loadWorkers;
|
|
1518
|
-
}()
|
|
1519
|
-
}]);
|
|
1520
|
-
return I3SConverter;
|
|
1521
|
-
}();
|
|
775
|
+
const i3sAttributesWorkerUrl = (0, _workerUtils.getWorkerURL)(_i3sAttributesWorker.I3SAttributesWorker, {
|
|
776
|
+
...(0, _core.getLoaderOptions)()
|
|
777
|
+
});
|
|
778
|
+
const sourceResponse = await (0, _core.fetchFile)(i3sAttributesWorkerUrl);
|
|
779
|
+
const source = await sourceResponse.text();
|
|
780
|
+
this.workerSource.I3SAttributes = source;
|
|
781
|
+
console.log("Loading workers source completed!");
|
|
782
|
+
}
|
|
783
|
+
}
|
|
1522
784
|
exports.default = I3SConverter;
|
|
1523
785
|
//# sourceMappingURL=i3s-converter.js.map
|