@loaders.gl/tile-converter 3.3.0-alpha.6 → 3.3.0-alpha.8
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.d.ts +2 -2
- package/dist/3d-tiles-attributes-worker.d.ts.map +1 -1
- package/dist/3d-tiles-attributes-worker.js +2 -2
- package/dist/3d-tiles-attributes-worker.js.map +2 -2
- package/dist/converter-cli.js +15 -2
- package/dist/converter.min.js +20 -20
- package/dist/dist.min.js +263 -415
- package/dist/es5/3d-tiles-attributes-worker.js +1 -1
- package/dist/es5/converter-cli.js +9 -3
- package/dist/es5/converter-cli.js.map +1 -1
- package/dist/es5/deps-installer/deps-installer.js +1 -1
- package/dist/es5/i3s-attributes-worker.js +1 -1
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js +7 -6
- package/dist/es5/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/es5/i3s-converter/i3s-converter.js +27 -25
- package/dist/es5/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/es5/pgm-loader.js +1 -1
- package/dist/esm/3d-tiles-attributes-worker.js +1 -1
- package/dist/esm/converter-cli.js +9 -3
- package/dist/esm/converter-cli.js.map +1 -1
- package/dist/esm/deps-installer/deps-installer.js +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js +7 -6
- package/dist/esm/i3s-converter/helpers/coordinate-converter.js.map +1 -1
- package/dist/esm/i3s-converter/i3s-converter.js +10 -7
- package/dist/esm/i3s-converter/i3s-converter.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/i3s-attributes-worker.d.ts +2 -2
- package/dist/i3s-attributes-worker.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/coordinate-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/coordinate-converter.js +8 -6
- package/dist/i3s-converter/i3s-converter.d.ts.map +1 -1
- package/dist/i3s-converter/i3s-converter.js +9 -7
- package/dist/i3s-converter/types.d.ts +6 -6
- package/dist/i3s-converter/types.d.ts.map +1 -1
- package/dist/lib/utils/write-queue.d.ts +1 -1
- package/dist/lib/utils/write-queue.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/converter-cli.ts +16 -2
- package/src/i3s-converter/helpers/coordinate-converter.ts +8 -6
- package/src/i3s-converter/i3s-converter.ts +17 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i3s-converter.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/i3s-converter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EACV,YAAY,EAOb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAC,KAAK,EAAC,MAAM,gBAAgB,CAAC;AAOrC,OAAO,SAAS,MAAM,sBAAsB,CAAC;AAuB7C,OAAO,EAAC,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,qBAAqB,EAA8B,MAAM,2BAA2B,CAAC;AAM7F,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAqBlD;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,SAAS,EAAE,SAAS,CAAC;IACrB,OAAO,EAAE,GAAG,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,mBAAmB,EAAE,qBAAqB,EAAE,CAAC;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,YAAY,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,iBAAiB,EAAE;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,uBAAuB,EAAE,MAAM,CAAC;KACjC,CAAC;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B;;;;;;OAMG;YACW,YAAY;IAwB1B;;;;;OAKG;YACW,aAAa;IA8D3B;;;;;;;OAOG;YACW,gBAAgB;IAuB9B;;;;;OAKG;YACW,gBAAgB;IA0B9B;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IAa5B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAU7B;;;OAGG;IACH,OAAO,CAAC,qCAAqC;IAyB7C;;;OAGG;YACW,iBAAiB;IAqB/B;;OAEG;YACW,oBAAoB;IAYlC;;OAEG;YACW,qBAAqB;IAkBnC;;OAEG;IACH,OAAO,CAAC,8BAA8B;IAUtC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;YAIZ,WAAW;CAsB1B"}
|
|
@@ -149,7 +149,7 @@ class I3SConverter {
|
|
|
149
149
|
const sourceTilesetJson = await (0, core_1.load)(inputUrl, this.Loader, tilesetOptions.loadOptions);
|
|
150
150
|
// console.log(tilesetJson); // eslint-disable-line
|
|
151
151
|
this.sourceTileset = new tiles_1.Tileset3D(sourceTilesetJson, tilesetOptions);
|
|
152
|
-
await this._createAndSaveTileset(outputPath, tilesetName);
|
|
152
|
+
await this._createAndSaveTileset(outputPath, tilesetName, sourceTilesetJson?.root?.boundingVolume?.region);
|
|
153
153
|
await this._finishConversion({ slpk: Boolean(slpk), outputPath, tilesetName });
|
|
154
154
|
return sourceTilesetJson;
|
|
155
155
|
}
|
|
@@ -167,7 +167,7 @@ class I3SConverter {
|
|
|
167
167
|
* @param outputPath - path to save output data
|
|
168
168
|
* @param tilesetName - new tileset path
|
|
169
169
|
*/
|
|
170
|
-
async _createAndSaveTileset(outputPath, tilesetName) {
|
|
170
|
+
async _createAndSaveTileset(outputPath, tilesetName, boundingVolumeRegion) {
|
|
171
171
|
const tilesetPath = (0, path_1.join)(`${outputPath}`, `${tilesetName}`);
|
|
172
172
|
// Removing the tilesetPath needed to exclude erroneous files after conversion
|
|
173
173
|
try {
|
|
@@ -177,7 +177,7 @@ class I3SConverter {
|
|
|
177
177
|
// do nothing
|
|
178
178
|
}
|
|
179
179
|
this.layers0Path = (0, path_1.join)(tilesetPath, 'SceneServer', 'layers', '0');
|
|
180
|
-
this._formLayers0(tilesetName);
|
|
180
|
+
this._formLayers0(tilesetName, boundingVolumeRegion);
|
|
181
181
|
this.materialDefinitions = [];
|
|
182
182
|
this.materialMap = new Map();
|
|
183
183
|
const sourceRootTile = this.sourceTileset.root;
|
|
@@ -207,8 +207,12 @@ class I3SConverter {
|
|
|
207
207
|
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
208
208
|
* @param tilesetName - Name of layer
|
|
209
209
|
*/
|
|
210
|
-
_formLayers0(tilesetName) {
|
|
210
|
+
_formLayers0(tilesetName, boundingVolumeRegion) {
|
|
211
211
|
const fullExtent = (0, coordinate_converter_1.convertBoundingVolumeToI3SFullExtent)(this.sourceTileset?.boundingVolume || this.sourceTileset?.root?.boundingVolume);
|
|
212
|
+
if (boundingVolumeRegion) {
|
|
213
|
+
fullExtent.zmin = boundingVolumeRegion[4];
|
|
214
|
+
fullExtent.zmax = boundingVolumeRegion[5];
|
|
215
|
+
}
|
|
212
216
|
const extent = [fullExtent.xmin, fullExtent.ymin, fullExtent.xmax, fullExtent.ymax];
|
|
213
217
|
const layers0data = {
|
|
214
218
|
version: `{${(0, uuid_1.v4)().toUpperCase()}}`,
|
|
@@ -477,9 +481,7 @@ class I3SConverter {
|
|
|
477
481
|
* @param level - level of node (distanse to root node in the tree)
|
|
478
482
|
*/
|
|
479
483
|
async _createNode(parentTile, sourceTile, parentId, level) {
|
|
480
|
-
|
|
481
|
-
this._checkAddRefinementTypeForTile(sourceTile);
|
|
482
|
-
}
|
|
484
|
+
this._checkAddRefinementTypeForTile(sourceTile);
|
|
483
485
|
await this._updateTilesetOptions();
|
|
484
486
|
await this.sourceTileset._loadTile(sourceTile);
|
|
485
487
|
let boundingVolumes = (0, coordinate_converter_1.createBoundingVolumes)(sourceTile, this.geoidHeightModel);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoundingVolumes, I3SMaterialDefinition, MaterialDefinitionInfo, TextureDefinitionInfo } from '@loaders.gl/i3s';
|
|
2
2
|
import { ImageDataType } from '@loaders.gl/images';
|
|
3
3
|
/** Converted resources for specific node */
|
|
4
|
-
export
|
|
4
|
+
export type I3SConvertedResources = {
|
|
5
5
|
/**
|
|
6
6
|
* Node id
|
|
7
7
|
*/
|
|
@@ -47,7 +47,7 @@ export declare type I3SConvertedResources = {
|
|
|
47
47
|
/**
|
|
48
48
|
* Geometry and feature attributes converted from GLTF primitives
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type ConvertedAttributes = {
|
|
51
51
|
/** POSITION attribute value */
|
|
52
52
|
positions: Float32Array;
|
|
53
53
|
/** NORMAL attribute value */
|
|
@@ -70,7 +70,7 @@ export declare type ConvertedAttributes = {
|
|
|
70
70
|
/** Postprocessed geometry and feature attributes
|
|
71
71
|
* https://github.com/Esri/i3s-spec/blob/master/docs/1.8/defaultGeometrySchema.cmn.md
|
|
72
72
|
*/
|
|
73
|
-
export
|
|
73
|
+
export type GeometryAttributes = {
|
|
74
74
|
/** POSITION attribute value */
|
|
75
75
|
positions: Float32Array;
|
|
76
76
|
/** NORMAL attribute value */
|
|
@@ -87,7 +87,7 @@ export declare type GeometryAttributes = {
|
|
|
87
87
|
featureCount: number;
|
|
88
88
|
};
|
|
89
89
|
/** Geometry attributes specific for the particular feature */
|
|
90
|
-
export
|
|
90
|
+
export type GroupedByFeatureIdAttributes = {
|
|
91
91
|
/** Feature Id */
|
|
92
92
|
featureId: number;
|
|
93
93
|
/** POSITION attribute value */
|
|
@@ -100,7 +100,7 @@ export declare type GroupedByFeatureIdAttributes = {
|
|
|
100
100
|
texCoords: Float32Array;
|
|
101
101
|
};
|
|
102
102
|
/** Shared resources made from GLTF material */
|
|
103
|
-
export
|
|
103
|
+
export type SharedResourcesArrays = {
|
|
104
104
|
/** material definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitionInfo.cmn.md */
|
|
105
105
|
materialDefinitionInfos?: MaterialDefinitionInfo[];
|
|
106
106
|
/** texture definitions list https://github.com/Esri/i3s-spec/blob/master/docs/1.8/textureDefinitionInfo.cmn.md*/
|
|
@@ -109,7 +109,7 @@ export declare type SharedResourcesArrays = {
|
|
|
109
109
|
nodePath?: string;
|
|
110
110
|
};
|
|
111
111
|
/** I3S material definition and texture content taken from GLTF material */
|
|
112
|
-
export
|
|
112
|
+
export type I3SMaterialWithTexture = {
|
|
113
113
|
/** Material definition https://github.com/Esri/i3s-spec/blob/master/docs/1.8/materialDefinitions.cmn.md */
|
|
114
114
|
material: I3SMaterialDefinition;
|
|
115
115
|
/** Texture content (image) */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD,4CAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/i3s-converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,sBAAsB,EACtB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEjD,4CAA4C;AAC5C,MAAM,MAAM,qBAAqB,GAAG;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,QAAQ,EAAE,WAAW,GAAG,IAAI,CAAC;IAC7B;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC;IACjD;;OAEG;IACH,OAAO,EA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;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,+BAA+B;IAC/B,SAAS,EAAE,YAAY,CAAC;IACxB,6BAA6B;IAC7B,OAAO,EAAE,YAAY,CAAC;IACtB,8BAA8B;IAC9B,MAAM,EAAE,UAAU,CAAC;IACnB,iCAAiC;IACjC,SAAS,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,+CAA+C;AAC/C,MAAM,MAAM,qBAAqB,GAAG;IAClC,oHAAoH;IACpH,uBAAuB,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACnD,kHAAkH;IAClH,sBAAsB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IACjD,gDAAgD;IAChD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,sBAAsB,GAAG;IACnC,2GAA2G;IAC3G,QAAQ,EAAE,qBAAqB,CAAC;IAChC,8BAA8B;IAC9B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-queue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/write-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAM9B,
|
|
1
|
+
{"version":3,"file":"write-queue.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/write-queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAM9B,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,UAAU,CAAC,CAAC,SAAS,cAAc,CAAE,SAAQ,KAAK,CAAC,CAAC,CAAC;IACxE,OAAO,CAAC,UAAU,CAAC,CAAiB;IAC7B,YAAY,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAQ;IAC1C,OAAO,EAAE;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAC,CAAM;IACtC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;gBAEpB,iBAAiB,GAAE,MAAa,EAAE,gBAAgB,GAAE,MAAY;IAMtE,OAAO,CAAC,GAAG,EAAE,CAAC;IAQpB,cAAc;IAId,aAAa;IAMP,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAW3B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YAKjB,OAAO;IAmBrB,OAAO,CAAC,aAAa;CAWtB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tile-converter",
|
|
3
|
-
"version": "3.3.0-alpha.
|
|
3
|
+
"version": "3.3.0-alpha.8",
|
|
4
4
|
"description": "Converter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -43,19 +43,19 @@
|
|
|
43
43
|
"build-3d-tiles-attributes-worker": "esbuild src/workers/3d-tiles-attributes-worker.ts --outfile=dist/3d-tiles-attributes-worker.js --platform=node --target=esnext,node12 --minify --bundle --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@loaders.gl/3d-tiles": "3.3.0-alpha.
|
|
47
|
-
"@loaders.gl/crypto": "3.3.0-alpha.
|
|
48
|
-
"@loaders.gl/draco": "3.3.0-alpha.
|
|
49
|
-
"@loaders.gl/gltf": "3.3.0-alpha.
|
|
50
|
-
"@loaders.gl/i3s": "3.3.0-alpha.
|
|
51
|
-
"@loaders.gl/images": "3.3.0-alpha.
|
|
52
|
-
"@loaders.gl/loader-utils": "3.3.0-alpha.
|
|
53
|
-
"@loaders.gl/polyfills": "3.3.0-alpha.
|
|
54
|
-
"@loaders.gl/schema": "3.3.0-alpha.
|
|
55
|
-
"@loaders.gl/textures": "3.3.0-alpha.
|
|
56
|
-
"@loaders.gl/tiles": "3.3.0-alpha.
|
|
57
|
-
"@loaders.gl/worker-utils": "3.3.0-alpha.
|
|
58
|
-
"@loaders.gl/zip": "3.3.0-alpha.
|
|
46
|
+
"@loaders.gl/3d-tiles": "3.3.0-alpha.8",
|
|
47
|
+
"@loaders.gl/crypto": "3.3.0-alpha.8",
|
|
48
|
+
"@loaders.gl/draco": "3.3.0-alpha.8",
|
|
49
|
+
"@loaders.gl/gltf": "3.3.0-alpha.8",
|
|
50
|
+
"@loaders.gl/i3s": "3.3.0-alpha.8",
|
|
51
|
+
"@loaders.gl/images": "3.3.0-alpha.8",
|
|
52
|
+
"@loaders.gl/loader-utils": "3.3.0-alpha.8",
|
|
53
|
+
"@loaders.gl/polyfills": "3.3.0-alpha.8",
|
|
54
|
+
"@loaders.gl/schema": "3.3.0-alpha.8",
|
|
55
|
+
"@loaders.gl/textures": "3.3.0-alpha.8",
|
|
56
|
+
"@loaders.gl/tiles": "3.3.0-alpha.8",
|
|
57
|
+
"@loaders.gl/worker-utils": "3.3.0-alpha.8",
|
|
58
|
+
"@loaders.gl/zip": "3.3.0-alpha.8",
|
|
59
59
|
"@luma.gl/engine": "^8.5.4",
|
|
60
60
|
"@math.gl/core": "^3.5.1",
|
|
61
61
|
"@math.gl/culling": "^3.5.1",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"peerDependencies": {
|
|
76
76
|
"@loaders.gl/core": "^3.2.0"
|
|
77
77
|
},
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "69cfde0340328dd800c7c90151b56b406f47e9ae"
|
|
79
79
|
}
|
package/src/converter-cli.ts
CHANGED
|
@@ -196,7 +196,7 @@ function validateOptions(options: TileConversionOptions): ValidatedTileConversio
|
|
|
196
196
|
}
|
|
197
197
|
if (exceptions.length) {
|
|
198
198
|
exceptions.forEach((exeption) => exeption());
|
|
199
|
-
process.exit(
|
|
199
|
+
process.exit(1);
|
|
200
200
|
}
|
|
201
201
|
return <ValidatedTileConversionOptions>options;
|
|
202
202
|
}
|
|
@@ -240,7 +240,7 @@ function parseOptions(args: string[]): TileConversionOptions {
|
|
|
240
240
|
opts.inputType = getStringValue(index, args);
|
|
241
241
|
break;
|
|
242
242
|
case '--tileset':
|
|
243
|
-
opts.tileset =
|
|
243
|
+
opts.tileset = getURLValue(index, args);
|
|
244
244
|
break;
|
|
245
245
|
case '--name':
|
|
246
246
|
opts.name = getStringValue(index, args);
|
|
@@ -308,6 +308,20 @@ function getStringValue(index: number, args: string[]): string {
|
|
|
308
308
|
return value;
|
|
309
309
|
}
|
|
310
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Modyfy URL path to be compatible with fetch
|
|
313
|
+
* @param index - option's name index in the argument's array.
|
|
314
|
+
* The value of the option should be next to name of the option.
|
|
315
|
+
* @param args - cli arguments array
|
|
316
|
+
* @returns - string value of the option
|
|
317
|
+
*/
|
|
318
|
+
function getURLValue(index: number, args: string[]): string {
|
|
319
|
+
const value = getStringValue(index, args);
|
|
320
|
+
console.log(`Input tileset value: ${value}`);
|
|
321
|
+
console.log(`Modified tileset value: ${value.replace(/\\/g, '/')}`);
|
|
322
|
+
return value.replace(/\\/g, '/');
|
|
323
|
+
}
|
|
324
|
+
|
|
311
325
|
/**
|
|
312
326
|
* Get integer option value from cli arguments
|
|
313
327
|
* @param index - option's name index in the argument's array
|
|
@@ -126,13 +126,15 @@ export function convertBoundingVolumeToI3SFullExtent(
|
|
|
126
126
|
new Vector3()
|
|
127
127
|
);
|
|
128
128
|
|
|
129
|
+
// Converter sometimes returns min values that are bigger then max,
|
|
130
|
+
// so we should check and take bigger value from max and smaller for nim
|
|
129
131
|
return {
|
|
130
|
-
xmin: vertexMin[0],
|
|
131
|
-
xmax: vertexMax[0],
|
|
132
|
-
ymin: vertexMin[1],
|
|
133
|
-
ymax: vertexMax[1],
|
|
134
|
-
zmin: vertexMin[2],
|
|
135
|
-
zmax: vertexMax[2]
|
|
132
|
+
xmin: Math.min(vertexMin[0], vertexMax[0]),
|
|
133
|
+
xmax: Math.max(vertexMin[0], vertexMax[0]),
|
|
134
|
+
ymin: Math.min(vertexMin[1], vertexMax[1]),
|
|
135
|
+
ymax: Math.max(vertexMin[1], vertexMax[1]),
|
|
136
|
+
zmin: Math.min(vertexMin[2], vertexMax[2]),
|
|
137
|
+
zmax: Math.max(vertexMin[2], vertexMax[2])
|
|
136
138
|
};
|
|
137
139
|
}
|
|
138
140
|
|
|
@@ -207,7 +207,11 @@ export default class I3SConverter {
|
|
|
207
207
|
// console.log(tilesetJson); // eslint-disable-line
|
|
208
208
|
this.sourceTileset = new Tileset3D(sourceTilesetJson, tilesetOptions);
|
|
209
209
|
|
|
210
|
-
await this._createAndSaveTileset(
|
|
210
|
+
await this._createAndSaveTileset(
|
|
211
|
+
outputPath,
|
|
212
|
+
tilesetName,
|
|
213
|
+
sourceTilesetJson?.root?.boundingVolume?.region
|
|
214
|
+
);
|
|
211
215
|
await this._finishConversion({slpk: Boolean(slpk), outputPath, tilesetName});
|
|
212
216
|
return sourceTilesetJson;
|
|
213
217
|
} catch (error) {
|
|
@@ -224,7 +228,11 @@ export default class I3SConverter {
|
|
|
224
228
|
* @param outputPath - path to save output data
|
|
225
229
|
* @param tilesetName - new tileset path
|
|
226
230
|
*/
|
|
227
|
-
private async _createAndSaveTileset(
|
|
231
|
+
private async _createAndSaveTileset(
|
|
232
|
+
outputPath: string,
|
|
233
|
+
tilesetName: string,
|
|
234
|
+
boundingVolumeRegion?: number[]
|
|
235
|
+
): Promise<void> {
|
|
228
236
|
const tilesetPath = join(`${outputPath}`, `${tilesetName}`);
|
|
229
237
|
// Removing the tilesetPath needed to exclude erroneous files after conversion
|
|
230
238
|
try {
|
|
@@ -235,7 +243,7 @@ export default class I3SConverter {
|
|
|
235
243
|
|
|
236
244
|
this.layers0Path = join(tilesetPath, 'SceneServer', 'layers', '0');
|
|
237
245
|
|
|
238
|
-
this._formLayers0(tilesetName);
|
|
246
|
+
this._formLayers0(tilesetName, boundingVolumeRegion);
|
|
239
247
|
|
|
240
248
|
this.materialDefinitions = [];
|
|
241
249
|
this.materialMap = new Map();
|
|
@@ -275,10 +283,14 @@ export default class I3SConverter {
|
|
|
275
283
|
* Form object of 3DSceneLayer https://github.com/Esri/i3s-spec/blob/master/docs/1.7/3DSceneLayer.cmn.md
|
|
276
284
|
* @param tilesetName - Name of layer
|
|
277
285
|
*/
|
|
278
|
-
private _formLayers0(tilesetName: string): void {
|
|
286
|
+
private _formLayers0(tilesetName: string, boundingVolumeRegion?: number[]): void {
|
|
279
287
|
const fullExtent = convertBoundingVolumeToI3SFullExtent(
|
|
280
288
|
this.sourceTileset?.boundingVolume || this.sourceTileset?.root?.boundingVolume
|
|
281
289
|
);
|
|
290
|
+
if (boundingVolumeRegion) {
|
|
291
|
+
fullExtent.zmin = boundingVolumeRegion[4];
|
|
292
|
+
fullExtent.zmax = boundingVolumeRegion[5];
|
|
293
|
+
}
|
|
282
294
|
const extent = [fullExtent.xmin, fullExtent.ymin, fullExtent.xmax, fullExtent.ymax];
|
|
283
295
|
const layers0data = {
|
|
284
296
|
version: `{${uuidv4().toUpperCase()}}`,
|
|
@@ -627,9 +639,7 @@ export default class I3SConverter {
|
|
|
627
639
|
parentId: number,
|
|
628
640
|
level: number
|
|
629
641
|
): Promise<Node3DIndexDocument[]> {
|
|
630
|
-
|
|
631
|
-
this._checkAddRefinementTypeForTile(sourceTile);
|
|
632
|
-
}
|
|
642
|
+
this._checkAddRefinementTypeForTile(sourceTile);
|
|
633
643
|
|
|
634
644
|
await this._updateTilesetOptions();
|
|
635
645
|
await this.sourceTileset!._loadTile(sourceTile);
|