@loaders.gl/tile-converter 4.0.0-alpha.12 → 4.0.0-alpha.13
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 +2 -2
- package/dist/converter.min.js +65 -65
- package/dist/dist.min.js +760 -216
- package/dist/es5/3d-tiles-attributes-worker.js +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/batch-ids-extensions.js.map +1 -1
- package/dist/es5/i3s-converter/helpers/geometry-converter.js +6 -0
- package/dist/es5/i3s-converter/helpers/geometry-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/deps-installer/deps-installer.js +1 -1
- package/dist/esm/i3s-attributes-worker.js +1 -1
- package/dist/esm/i3s-converter/helpers/batch-ids-extensions.js.map +1 -1
- package/dist/esm/i3s-converter/helpers/geometry-converter.js +6 -0
- package/dist/esm/i3s-converter/helpers/geometry-converter.js.map +1 -1
- package/dist/esm/pgm-loader.js +1 -1
- package/dist/i3s-attributes-worker.js +2 -2
- package/dist/i3s-attributes-worker.js.map +2 -2
- package/dist/i3s-converter/helpers/geometry-converter.d.ts.map +1 -1
- package/dist/i3s-converter/helpers/geometry-converter.js +3 -0
- package/dist/i3s-converter/types.js +1 -1
- package/package.json +14 -14
- package/src/i3s-converter/helpers/batch-ids-extensions.ts +5 -5
- package/src/i3s-converter/helpers/geometry-converter.ts +15 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"geometry-converter.d.ts","sourceRoot":"","sources":["../../../src/i3s-converter/helpers/geometry-converter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,gBAAgB,EAAE,kBAAkB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"geometry-converter.d.ts","sourceRoot":"","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,CAAC,CAgD3C;AA4pCD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,kBAAkB,GAAG,IAAI,GAAG,gBAAgB,GAAG,IAAI,CAwBhG"}
|
|
@@ -1178,6 +1178,9 @@ function getPropertyTableExtension(tileContent) {
|
|
|
1178
1178
|
break;
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
|
+
if (!extensionName) {
|
|
1182
|
+
return { extensionName: null, extension: null };
|
|
1183
|
+
}
|
|
1181
1184
|
const extension = tileContent?.gltf?.extensions?.[extensionName];
|
|
1182
1185
|
return { extensionName, extension };
|
|
1183
1186
|
}
|
|
@@ -14,4 +14,4 @@ var GltfPrimitiveModeString;
|
|
|
14
14
|
GltfPrimitiveModeString["TRIANGLES"] = "TRIANGLES";
|
|
15
15
|
GltfPrimitiveModeString["TRIANGLE_STRIP"] = "TRIANGLE_STRIP";
|
|
16
16
|
GltfPrimitiveModeString["TRIANGLE_FAN"] = "TRIANGLE_FAN";
|
|
17
|
-
})(GltfPrimitiveModeString
|
|
17
|
+
})(GltfPrimitiveModeString || (exports.GltfPrimitiveModeString = GltfPrimitiveModeString = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/tile-converter",
|
|
3
|
-
"version": "4.0.0-alpha.
|
|
3
|
+
"version": "4.0.0-alpha.13",
|
|
4
4
|
"description": "Converter",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -46,18 +46,18 @@
|
|
|
46
46
|
"build-3d-tiles-attributes-worker": "esbuild src/workers/3d-tiles-attributes-worker.ts --outfile=dist/3d-tiles-attributes-worker.js --platform=node --target=esnext,node14 --external:join-images --minify --bundle --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@loaders.gl/3d-tiles": "4.0.0-alpha.
|
|
50
|
-
"@loaders.gl/crypto": "4.0.0-alpha.
|
|
51
|
-
"@loaders.gl/draco": "4.0.0-alpha.
|
|
52
|
-
"@loaders.gl/gltf": "4.0.0-alpha.
|
|
53
|
-
"@loaders.gl/i3s": "4.0.0-alpha.
|
|
54
|
-
"@loaders.gl/images": "4.0.0-alpha.
|
|
55
|
-
"@loaders.gl/loader-utils": "4.0.0-alpha.
|
|
56
|
-
"@loaders.gl/polyfills": "4.0.0-alpha.
|
|
57
|
-
"@loaders.gl/textures": "4.0.0-alpha.
|
|
58
|
-
"@loaders.gl/tiles": "4.0.0-alpha.
|
|
59
|
-
"@loaders.gl/worker-utils": "4.0.0-alpha.
|
|
60
|
-
"@loaders.gl/zip": "4.0.0-alpha.
|
|
49
|
+
"@loaders.gl/3d-tiles": "4.0.0-alpha.13",
|
|
50
|
+
"@loaders.gl/crypto": "4.0.0-alpha.13",
|
|
51
|
+
"@loaders.gl/draco": "4.0.0-alpha.13",
|
|
52
|
+
"@loaders.gl/gltf": "4.0.0-alpha.13",
|
|
53
|
+
"@loaders.gl/i3s": "4.0.0-alpha.13",
|
|
54
|
+
"@loaders.gl/images": "4.0.0-alpha.13",
|
|
55
|
+
"@loaders.gl/loader-utils": "4.0.0-alpha.13",
|
|
56
|
+
"@loaders.gl/polyfills": "4.0.0-alpha.13",
|
|
57
|
+
"@loaders.gl/textures": "4.0.0-alpha.13",
|
|
58
|
+
"@loaders.gl/tiles": "4.0.0-alpha.13",
|
|
59
|
+
"@loaders.gl/worker-utils": "4.0.0-alpha.13",
|
|
60
|
+
"@loaders.gl/zip": "4.0.0-alpha.13",
|
|
61
61
|
"@math.gl/core": "^3.5.1",
|
|
62
62
|
"@math.gl/culling": "^3.5.1",
|
|
63
63
|
"@math.gl/geoid": "^3.5.1",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"join-images": "^1.1.3",
|
|
81
81
|
"sharp": "^0.31.3"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "32421ea66db35040f1026be734a7ec9f905ecab7"
|
|
84
84
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {GLTFAccessorPostprocessed, GLTFMeshPrimitivePostprocessed} from '@loaders.gl/gltf';
|
|
2
2
|
import type {NumericArray} from '@loaders.gl/loader-utils';
|
|
3
3
|
import type {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
GLTF_EXT_feature_metadata_FeatureIdTexture,
|
|
5
|
+
GLTF_EXT_feature_metadata_Primitive
|
|
6
6
|
} from '@loaders.gl/gltf';
|
|
7
7
|
import {TypedArray} from '@math.gl/core';
|
|
8
8
|
import {TextureImageProperties} from '../../i3s-attributes-worker';
|
|
@@ -34,7 +34,7 @@ export function handleBatchIdsExtensions(
|
|
|
34
34
|
case EXT_FEATURE_METADATA:
|
|
35
35
|
return handleExtFeatureMetadataExtension(
|
|
36
36
|
attributes,
|
|
37
|
-
extensionData as
|
|
37
|
+
extensionData as GLTF_EXT_feature_metadata_Primitive,
|
|
38
38
|
images
|
|
39
39
|
);
|
|
40
40
|
case EXT_MESH_FEATURES:
|
|
@@ -59,7 +59,7 @@ function handleExtFeatureMetadataExtension(
|
|
|
59
59
|
attributes: {
|
|
60
60
|
[key: string]: GLTFAccessorPostprocessed;
|
|
61
61
|
},
|
|
62
|
-
extFeatureMetadata:
|
|
62
|
+
extFeatureMetadata: GLTF_EXT_feature_metadata_Primitive,
|
|
63
63
|
images: (TextureImageProperties | null)[]
|
|
64
64
|
): NumericArray {
|
|
65
65
|
// Take only first extension object to get batchIds attribute name.
|
|
@@ -146,7 +146,7 @@ function generateImplicitFeatureIds(
|
|
|
146
146
|
* @param featureIdTextures
|
|
147
147
|
*/
|
|
148
148
|
function generateBatchIdsFromTexture(
|
|
149
|
-
featureIdTexture:
|
|
149
|
+
featureIdTexture: GLTF_EXT_feature_metadata_FeatureIdTexture,
|
|
150
150
|
textureCoordinates: TypedArray,
|
|
151
151
|
images: (TextureImageProperties | null)[]
|
|
152
152
|
) {
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type {FeatureTableJson, Tiles3DTileContent} from '@loaders.gl/3d-tiles';
|
|
2
2
|
import type {
|
|
3
|
-
GLTF_EXT_feature_metadata,
|
|
4
|
-
GLTF_EXT_mesh_features,
|
|
5
3
|
GLTFAccessorPostprocessed,
|
|
6
4
|
GLTFMaterialPostprocessed,
|
|
7
5
|
GLTFNodePostprocessed,
|
|
8
6
|
GLTFMeshPrimitivePostprocessed,
|
|
9
7
|
GLTFMeshPostprocessed,
|
|
10
|
-
GLTFTexturePostprocessed
|
|
8
|
+
GLTFTexturePostprocessed,
|
|
9
|
+
GLTF_EXT_feature_metadata_GLTF
|
|
11
10
|
} from '@loaders.gl/gltf';
|
|
12
11
|
|
|
13
12
|
import {Vector3, Matrix4, Vector4} from '@math.gl/core';
|
|
@@ -1577,7 +1576,7 @@ export function getPropertyTable(tileContent: Tiles3DTileContent | null): Featur
|
|
|
1577
1576
|
return null;
|
|
1578
1577
|
}
|
|
1579
1578
|
case EXT_FEATURE_METADATA: {
|
|
1580
|
-
return getPropertyTableFromExtFeatureMetadata(extension as
|
|
1579
|
+
return getPropertyTableFromExtFeatureMetadata(extension as GLTF_EXT_feature_metadata_GLTF);
|
|
1581
1580
|
}
|
|
1582
1581
|
default:
|
|
1583
1582
|
return null;
|
|
@@ -1588,9 +1587,10 @@ export function getPropertyTable(tileContent: Tiles3DTileContent | null): Featur
|
|
|
1588
1587
|
* Check extensions which can be with property table inside.
|
|
1589
1588
|
* @param tileContent - 3DTiles tile content
|
|
1590
1589
|
*/
|
|
1591
|
-
function getPropertyTableExtension(
|
|
1592
|
-
|
|
1593
|
-
|
|
1590
|
+
function getPropertyTableExtension(tileContent: Tiles3DTileContent): {
|
|
1591
|
+
extensionName: null | string;
|
|
1592
|
+
extension: string | GLTF_EXT_feature_metadata_GLTF | null;
|
|
1593
|
+
} {
|
|
1594
1594
|
const extensionsWithPropertyTables = [EXT_FEATURE_METADATA, EXT_MESH_FEATURES];
|
|
1595
1595
|
const extensionsUsed = tileContent?.gltf?.extensionsUsed;
|
|
1596
1596
|
|
|
@@ -1599,7 +1599,6 @@ function getPropertyTableExtension(
|
|
|
1599
1599
|
}
|
|
1600
1600
|
|
|
1601
1601
|
let extensionName: string = '';
|
|
1602
|
-
|
|
1603
1602
|
for (const extensionItem of tileContent?.gltf?.extensionsUsed || []) {
|
|
1604
1603
|
if (extensionsWithPropertyTables.includes(extensionItem)) {
|
|
1605
1604
|
extensionName = extensionItem;
|
|
@@ -1607,7 +1606,13 @@ function getPropertyTableExtension(
|
|
|
1607
1606
|
}
|
|
1608
1607
|
}
|
|
1609
1608
|
|
|
1610
|
-
|
|
1609
|
+
if (!extensionName) {
|
|
1610
|
+
return {extensionName: null, extension: null};
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
const extension = tileContent?.gltf?.extensions?.[extensionName] as
|
|
1614
|
+
| string // EXT_mesh_features doesn't have global metadata
|
|
1615
|
+
| GLTF_EXT_feature_metadata_GLTF;
|
|
1611
1616
|
|
|
1612
1617
|
return {extensionName, extension};
|
|
1613
1618
|
}
|
|
@@ -1617,7 +1622,7 @@ function getPropertyTableExtension(
|
|
|
1617
1622
|
* @param extension
|
|
1618
1623
|
*/
|
|
1619
1624
|
function getPropertyTableFromExtFeatureMetadata(
|
|
1620
|
-
extension:
|
|
1625
|
+
extension: GLTF_EXT_feature_metadata_GLTF
|
|
1621
1626
|
): FeatureTableJson | null {
|
|
1622
1627
|
if (extension?.featureTables) {
|
|
1623
1628
|
/**
|