@loaders.gl/tile-converter 4.3.0-alpha.8 → 4.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/3d-tiles-converter/helpers/3d-tiles-content-converter.d.ts.map +1 -1
- package/dist/3d-tiles-converter/helpers/3d-tiles-content-converter.js +1 -2
- package/dist/3d-tiles-converter/helpers/load-i3s.d.ts.map +1 -1
- package/dist/converter.min.cjs +84 -84
- package/dist/deps-installer/deps-installer.js +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts +2 -2
- package/dist/i3s-converter/helpers/batch-ids-extensions.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/batch-ids-extensions.js +1 -1
- package/dist/i3s-converter/helpers/feature-attributes.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/load-3d-tiles.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/preprocess-3d-tiles.js +1 -2
- package/dist/i3s-converter/helpers/tileset-traversal.d.ts +3 -3
- package/dist/i3s-converter/helpers/tileset-traversal.d.ts.map +1 -1
- package/dist/i3s-server/bin/i3s-server.min.cjs +70 -70
- package/dist/i3s-server/utils/server-utils.d.ts +0 -3
- package/dist/i3s-server/utils/server-utils.d.ts.map +1 -1
- package/dist/index.cjs +11 -13
- package/dist/index.cjs.map +2 -2
- package/dist/pgm-loader.d.ts.map +1 -1
- package/dist/pgm-loader.js +1 -1
- package/package.json +16 -16
- package/src/3d-tiles-converter/helpers/3d-tiles-content-converter.ts +1 -2
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +6 -6
- package/src/i3s-converter/helpers/geometry-converter.ts +6 -2
- package/src/i3s-converter/helpers/preprocess-3d-tiles.ts +2 -2
- package/src/i3s-server/README.md +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-utils.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/utils/server-utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"server-utils.d.ts","sourceRoot":"","sources":["../../../src/i3s-server/utils/server-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,IAAI,WAAW,EAAC,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAC,MAAM,IAAI,UAAU,EAAC,MAAM,MAAM,CAAC;AAK/C;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,CAclE;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAC9B,YAAY,EAAE,MAAM,GAAG,MAAM,GAE5B,CAAC,KAAK,EAAE,MAAM,CAAC,cAAc,KAAK,IAAI,CAuBxC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,cAAc,EAAE,WAAW,GAAG,UAAU,GAAG,MAAM,IAAI,CAMzF"}
|
package/dist/index.cjs
CHANGED
|
@@ -1109,8 +1109,8 @@ function prepareNodes(nodes) {
|
|
|
1109
1109
|
}
|
|
1110
1110
|
|
|
1111
1111
|
// dist/i3s-converter/helpers/batch-ids-extensions.js
|
|
1112
|
-
var import_math = require("@loaders.gl/math");
|
|
1113
1112
|
var import_gltf = require("@loaders.gl/gltf");
|
|
1113
|
+
var import_math = require("@loaders.gl/math");
|
|
1114
1114
|
function getTextureByMetadataClass(tileContent, metadataClass) {
|
|
1115
1115
|
var _a2, _b;
|
|
1116
1116
|
const extFeatureMetadata = (_b = (_a2 = tileContent.gltf) == null ? void 0 : _a2.extensions) == null ? void 0 : _b[import_gltf.EXT_FEATURE_METADATA];
|
|
@@ -2325,7 +2325,7 @@ function convertScreenThresholdToGeometricError(node) {
|
|
|
2325
2325
|
|
|
2326
2326
|
// dist/pgm-loader.js
|
|
2327
2327
|
var import_geoid = require("@math.gl/geoid");
|
|
2328
|
-
var VERSION = true ? "4.3.0-alpha.
|
|
2328
|
+
var VERSION = true ? "4.3.0-alpha.8" : "latest";
|
|
2329
2329
|
var PGMLoader = {
|
|
2330
2330
|
dataType: null,
|
|
2331
2331
|
batchType: null,
|
|
@@ -3486,7 +3486,6 @@ var traverseDatasetWith = async ({ tile, traversalProps, processTile, postproces
|
|
|
3486
3486
|
// dist/i3s-converter/helpers/preprocess-3d-tiles.js
|
|
3487
3487
|
var import_gltf4 = require("@loaders.gl/gltf");
|
|
3488
3488
|
var import_core8 = require("@loaders.gl/core");
|
|
3489
|
-
var import_gltf5 = require("@loaders.gl/gltf");
|
|
3490
3489
|
var GLTF_PRIMITIVE_MODES = [
|
|
3491
3490
|
GLTFPrimitiveModeString.POINTS,
|
|
3492
3491
|
// 0
|
|
@@ -3541,7 +3540,7 @@ var getMeshTypesFromGLTF = (gltfJson) => {
|
|
|
3541
3540
|
var getMetadataClassesFromGLTF = (gltfJson) => {
|
|
3542
3541
|
var _a2, _b, _c, _d, _e, _f;
|
|
3543
3542
|
const result = /* @__PURE__ */ new Set();
|
|
3544
|
-
const extFeatureMetadataClasses = (_c = (_b = (_a2 = gltfJson.extensions) == null ? void 0 : _a2[
|
|
3543
|
+
const extFeatureMetadataClasses = (_c = (_b = (_a2 = gltfJson.extensions) == null ? void 0 : _a2[import_gltf4.EXT_FEATURE_METADATA]) == null ? void 0 : _b.schema) == null ? void 0 : _c.classes;
|
|
3545
3544
|
if (extFeatureMetadataClasses) {
|
|
3546
3545
|
for (const classKey of Object.keys(extFeatureMetadataClasses)) {
|
|
3547
3546
|
result.add(classKey);
|
|
@@ -5414,9 +5413,8 @@ var import_worker_utils2 = require("@loaders.gl/worker-utils");
|
|
|
5414
5413
|
|
|
5415
5414
|
// dist/3d-tiles-converter/helpers/3d-tiles-content-converter.js
|
|
5416
5415
|
var import_core12 = require("@loaders.gl/core");
|
|
5417
|
-
var
|
|
5416
|
+
var import_gltf5 = require("@loaders.gl/gltf");
|
|
5418
5417
|
var import_d_tiles3 = require("@loaders.gl/3d-tiles");
|
|
5419
|
-
var import_d_tiles4 = require("@loaders.gl/3d-tiles");
|
|
5420
5418
|
var import_core13 = require("@math.gl/core");
|
|
5421
5419
|
var import_types5 = require("@math.gl/types");
|
|
5422
5420
|
var import_geospatial6 = require("@math.gl/geospatial");
|
|
@@ -5464,7 +5462,7 @@ var Tiles3DContentConverter = class {
|
|
|
5464
5462
|
i3sTile;
|
|
5465
5463
|
tileType;
|
|
5466
5464
|
constructor(options = { outputVersion: "1.1" }) {
|
|
5467
|
-
this.tileType = options.outputVersion === "1.0" ?
|
|
5465
|
+
this.tileType = options.outputVersion === "1.0" ? import_d_tiles3.TILE3D_TYPE.BATCHED_3D_MODEL : import_d_tiles3.TILE3D_TYPE.GLTF;
|
|
5468
5466
|
}
|
|
5469
5467
|
/**
|
|
5470
5468
|
* The starter of content conversion
|
|
@@ -5473,7 +5471,7 @@ var Tiles3DContentConverter = class {
|
|
|
5473
5471
|
*/
|
|
5474
5472
|
async convert(i3sAttributesData, featureAttributes = null, attributeStorageInfo) {
|
|
5475
5473
|
const gltf = await this.buildGLTF(i3sAttributesData, featureAttributes, attributeStorageInfo);
|
|
5476
|
-
if (this.tileType ===
|
|
5474
|
+
if (this.tileType === import_d_tiles3.TILE3D_TYPE.BATCHED_3D_MODEL) {
|
|
5477
5475
|
const b3dm = (0, import_core12.encodeSync)({
|
|
5478
5476
|
gltfEncoded: new Uint8Array(gltf),
|
|
5479
5477
|
type: "b3dm",
|
|
@@ -5493,7 +5491,7 @@ var Tiles3DContentConverter = class {
|
|
|
5493
5491
|
async buildGLTF(i3sAttributesData, featureAttributes, attributeStorageInfo) {
|
|
5494
5492
|
const { tileContent, textureFormat, box } = i3sAttributesData;
|
|
5495
5493
|
const { material, attributes, indices: originalIndices, modelMatrix } = tileContent;
|
|
5496
|
-
const gltfBuilder = new
|
|
5494
|
+
const gltfBuilder = new import_gltf5.GLTFScenegraph();
|
|
5497
5495
|
const textureIndex = await this._addI3sTextureToGLTF(tileContent, textureFormat, gltfBuilder);
|
|
5498
5496
|
const pbrMetallicRoughness = material == null ? void 0 : material.pbrMetallicRoughness;
|
|
5499
5497
|
if (pbrMetallicRoughness && (pbrMetallicRoughness.metallicFactor === void 0 || pbrMetallicRoughness.metallicFactor === METALLIC_FACTOR_DEFAULT) && (pbrMetallicRoughness.roughnessFactor === void 0 || pbrMetallicRoughness.roughnessFactor === ROUGHNESS_FACTOR_DEFAULT)) {
|
|
@@ -5521,7 +5519,7 @@ var Tiles3DContentConverter = class {
|
|
|
5521
5519
|
material: materialIndex,
|
|
5522
5520
|
mode: 4
|
|
5523
5521
|
});
|
|
5524
|
-
if (this.tileType ===
|
|
5522
|
+
if (this.tileType === import_d_tiles3.TILE3D_TYPE.GLTF) {
|
|
5525
5523
|
this._createMetadataExtensions(gltfBuilder, meshIndex, featureAttributes, attributeStorageInfo, tileContent);
|
|
5526
5524
|
}
|
|
5527
5525
|
const transformMatrix = this._generateTransformMatrix(cartesianOrigin);
|
|
@@ -5529,16 +5527,16 @@ var Tiles3DContentConverter = class {
|
|
|
5529
5527
|
const sceneIndex = gltfBuilder.addScene({ nodeIndices: [nodeIndex] });
|
|
5530
5528
|
gltfBuilder.setDefaultScene(sceneIndex);
|
|
5531
5529
|
gltfBuilder.createBinaryChunk();
|
|
5532
|
-
return (0, import_core12.encodeSync)(gltfBuilder.gltf,
|
|
5530
|
+
return (0, import_core12.encodeSync)(gltfBuilder.gltf, import_gltf5.GLTFWriter, { gltfBuilder });
|
|
5533
5531
|
}
|
|
5534
5532
|
_createMetadataExtensions(gltfBuilder, meshIndex, featureAttributes, attributeStorageInfo, tileContent) {
|
|
5535
5533
|
var _a2;
|
|
5536
5534
|
const propertyAttributes = this._createPropertyAttibutes(featureAttributes, attributeStorageInfo);
|
|
5537
|
-
const tableIndex = (0,
|
|
5535
|
+
const tableIndex = (0, import_gltf5.createExtStructuralMetadata)(gltfBuilder, propertyAttributes);
|
|
5538
5536
|
const mesh = gltfBuilder.getMesh(meshIndex);
|
|
5539
5537
|
for (const primitive of mesh.primitives) {
|
|
5540
5538
|
if ((_a2 = tileContent.attributes._BATCHID) == null ? void 0 : _a2.value) {
|
|
5541
|
-
(0,
|
|
5539
|
+
(0, import_gltf5.createExtMeshFeatures)(gltfBuilder, primitive, tileContent.attributes._BATCHID.value, tableIndex);
|
|
5542
5540
|
}
|
|
5543
5541
|
}
|
|
5544
5542
|
}
|