@loaders.gl/3d-tiles 3.1.6 → 3.2.0-alpha.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/dist.min.js +817 -93
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js +31 -63
- package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/es5/lib/parsers/parse-3d-tile-header.js +4 -1
- package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/es5/lib/utils/version.js +1 -1
- package/dist/es5/lib/utils/version.js.map +1 -1
- package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js +30 -13
- package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
- package/dist/esm/lib/parsers/parse-3d-tile-header.js +4 -1
- package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
- package/dist/esm/lib/utils/version.js +1 -1
- package/dist/esm/lib/utils/version.js.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts +18 -11
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +22 -14
- package/dist/lib/parsers/parse-3d-tile-gltf.d.ts +1 -1
- package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -1
- package/dist/lib/parsers/parse-3d-tile-header.js +1 -1
- package/package.json +8 -8
- package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +31 -25
- package/src/lib/parsers/{parse-3d-tile-gltf.js → parse-3d-tile-gltf.ts} +0 -0
- package/src/lib/parsers/parse-3d-tile-header.ts +1 -1
|
@@ -11,17 +11,24 @@ import type { Subtree } from '../../../types';
|
|
|
11
11
|
* @param level
|
|
12
12
|
* @param globalData
|
|
13
13
|
*/
|
|
14
|
-
export declare function parseImplicitTiles(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
14
|
+
export declare function parseImplicitTiles(params: {
|
|
15
|
+
subtree: Subtree;
|
|
16
|
+
options: any;
|
|
17
|
+
parentData?: {
|
|
18
|
+
mortonIndex: number;
|
|
19
|
+
x: number;
|
|
20
|
+
y: number;
|
|
21
|
+
z: number;
|
|
22
|
+
};
|
|
23
|
+
childIndex?: number;
|
|
24
|
+
level?: number;
|
|
25
|
+
globalData?: {
|
|
26
|
+
level: number;
|
|
27
|
+
mortonIndex: number;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
z: number;
|
|
31
|
+
};
|
|
25
32
|
}): Promise<{
|
|
26
33
|
children: never[];
|
|
27
34
|
lodMetricValue: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-3d-implicit-tiles.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-implicit-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAY1E;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"parse-3d-implicit-tiles.d.ts","sourceRoot":"","sources":["../../../../src/lib/parsers/helpers/parse-3d-implicit-tiles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAY1E;;;;;;;;;;;GAWG;AAEH,wBAAsB,kBAAkB,CAAC,MAAM,EAAE;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC;IACb,UAAU,CAAC,EAAE;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CACpF;;;;GA+HA;AA8GD;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,MAAM,CAGR"}
|
|
@@ -21,20 +21,21 @@ const SUBDIVISION_COUNT_MAP = {
|
|
|
21
21
|
* @param level
|
|
22
22
|
* @param globalData
|
|
23
23
|
*/
|
|
24
|
-
// eslint-disable-next-line max-params
|
|
25
24
|
// eslint-disable-next-line max-statements
|
|
26
|
-
async function parseImplicitTiles(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
25
|
+
async function parseImplicitTiles(params) {
|
|
26
|
+
const { options, parentData = {
|
|
27
|
+
mortonIndex: 0,
|
|
28
|
+
x: 0,
|
|
29
|
+
y: 0,
|
|
30
|
+
z: 0
|
|
31
|
+
}, childIndex = 0, globalData = {
|
|
32
|
+
level: 0,
|
|
33
|
+
mortonIndex: 0,
|
|
34
|
+
x: 0,
|
|
35
|
+
y: 0,
|
|
36
|
+
z: 0
|
|
37
|
+
} } = params;
|
|
38
|
+
let { subtree, level = 0 } = params;
|
|
38
39
|
const { subdivisionScheme, subtreeLevels, maximumLevel, contentUrlTemplate, subtreesUriTemplate, basePath } = options;
|
|
39
40
|
const tile = { children: [], lodMetricValue: 0, contentUrl: '' };
|
|
40
41
|
const childrenPerTile = SUBDIVISION_COUNT_MAP[subdivisionScheme];
|
|
@@ -92,7 +93,14 @@ async function parseImplicitTiles(subtree, options, parentData = {
|
|
|
92
93
|
const childTileLevel = level + 1;
|
|
93
94
|
const pData = { mortonIndex: childTileMortonIndex, x: childTileX, y: childTileY, z: childTileZ };
|
|
94
95
|
for (let index = 0; index < childrenPerTile; index++) {
|
|
95
|
-
const currentTile = await parseImplicitTiles(
|
|
96
|
+
const currentTile = await parseImplicitTiles({
|
|
97
|
+
subtree,
|
|
98
|
+
options,
|
|
99
|
+
parentData: pData,
|
|
100
|
+
childIndex: index,
|
|
101
|
+
level: childTileLevel,
|
|
102
|
+
globalData
|
|
103
|
+
});
|
|
96
104
|
if (currentTile.contentUrl || currentTile.children.length) {
|
|
97
105
|
const globalLevel = lev + 1;
|
|
98
106
|
const childCoordinates = { childTileX, childTileY, childTileZ };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function parseGltf3DTile(tile: any, arrayBuffer: any, options: any, context: any): Promise<void>;
|
|
1
|
+
export declare function parseGltf3DTile(tile: any, arrayBuffer: any, options: any, context: any): Promise<void>;
|
|
2
2
|
//# sourceMappingURL=parse-3d-tile-gltf.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-3d-tile-gltf.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-3d-tile-gltf.
|
|
1
|
+
{"version":3,"file":"parse-3d-tile-gltf.d.ts","sourceRoot":"","sources":["../../../src/lib/parsers/parse-3d-tile-gltf.ts"],"names":[],"mappings":"AAEA,wBAAsB,eAAe,CAAC,IAAI,KAAA,EAAE,WAAW,KAAA,EAAE,OAAO,KAAA,EAAE,OAAO,KAAA,iBAaxE"}
|
|
@@ -120,7 +120,7 @@ async function normalizeImplicitTileData(tile, rootSubtree, options) {
|
|
|
120
120
|
tile.lodMetricType = tiles_1.LOD_METRIC_TYPE.GEOMETRIC_ERROR;
|
|
121
121
|
tile.lodMetricValue = tile.geometricError;
|
|
122
122
|
tile.transformMatrix = tile.transform;
|
|
123
|
-
const { children, contentUrl } = await (0, parse_3d_implicit_tiles_1.parseImplicitTiles)(rootSubtree, options);
|
|
123
|
+
const { children, contentUrl } = await (0, parse_3d_implicit_tiles_1.parseImplicitTiles)({ subtree: rootSubtree, options });
|
|
124
124
|
if (contentUrl) {
|
|
125
125
|
tile.contentUrl = contentUrl;
|
|
126
126
|
tile.content = { uri: contentUrl.replace(`${options.basePath}/`, '') };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/3d-tiles",
|
|
3
|
-
"version": "3.1
|
|
3
|
+
"version": "3.2.0-alpha.1",
|
|
4
4
|
"description": "3D Tiles, an open standard for streaming massive heterogeneous 3D geospatial datasets.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,16 +34,16 @@
|
|
|
34
34
|
"build-bundle": "esbuild src/bundle.ts --bundle --outfile=dist/dist.min.js"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@loaders.gl/draco": "3.1
|
|
38
|
-
"@loaders.gl/gltf": "3.1
|
|
39
|
-
"@loaders.gl/loader-utils": "3.1
|
|
40
|
-
"@loaders.gl/math": "3.1
|
|
41
|
-
"@loaders.gl/tiles": "3.1
|
|
37
|
+
"@loaders.gl/draco": "3.2.0-alpha.1",
|
|
38
|
+
"@loaders.gl/gltf": "3.2.0-alpha.1",
|
|
39
|
+
"@loaders.gl/loader-utils": "3.2.0-alpha.1",
|
|
40
|
+
"@loaders.gl/math": "3.2.0-alpha.1",
|
|
41
|
+
"@loaders.gl/tiles": "3.2.0-alpha.1",
|
|
42
42
|
"@math.gl/core": "^3.5.1",
|
|
43
43
|
"@math.gl/geospatial": "^3.5.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@loaders.gl/core": "
|
|
46
|
+
"@loaders.gl/core": "4.0.0-alpha.4"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "423a2815092b08dcf93ad5b7dc2940b167305afe"
|
|
49
49
|
}
|
|
@@ -22,27 +22,33 @@ const SUBDIVISION_COUNT_MAP = {
|
|
|
22
22
|
* @param level
|
|
23
23
|
* @param globalData
|
|
24
24
|
*/
|
|
25
|
-
// eslint-disable-next-line max-params
|
|
26
25
|
// eslint-disable-next-line max-statements
|
|
27
|
-
export async function parseImplicitTiles(
|
|
28
|
-
subtree: Subtree
|
|
29
|
-
options: any
|
|
30
|
-
parentData
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
26
|
+
export async function parseImplicitTiles(params: {
|
|
27
|
+
subtree: Subtree;
|
|
28
|
+
options: any;
|
|
29
|
+
parentData?: {mortonIndex: number; x: number; y: number; z: number};
|
|
30
|
+
childIndex?: number;
|
|
31
|
+
level?: number;
|
|
32
|
+
globalData?: {level: number; mortonIndex: number; x: number; y: number; z: number};
|
|
33
|
+
}) {
|
|
34
|
+
const {
|
|
35
|
+
options,
|
|
36
|
+
parentData = {
|
|
37
|
+
mortonIndex: 0,
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0,
|
|
40
|
+
z: 0
|
|
41
|
+
},
|
|
42
|
+
childIndex = 0,
|
|
43
|
+
globalData = {
|
|
44
|
+
level: 0,
|
|
45
|
+
mortonIndex: 0,
|
|
46
|
+
x: 0,
|
|
47
|
+
y: 0,
|
|
48
|
+
z: 0
|
|
49
|
+
}
|
|
50
|
+
} = params;
|
|
51
|
+
let {subtree, level = 0} = params;
|
|
46
52
|
const {
|
|
47
53
|
subdivisionScheme,
|
|
48
54
|
subtreeLevels,
|
|
@@ -132,14 +138,14 @@ export async function parseImplicitTiles(
|
|
|
132
138
|
const pData = {mortonIndex: childTileMortonIndex, x: childTileX, y: childTileY, z: childTileZ};
|
|
133
139
|
|
|
134
140
|
for (let index = 0; index < childrenPerTile; index++) {
|
|
135
|
-
const currentTile = await parseImplicitTiles(
|
|
141
|
+
const currentTile = await parseImplicitTiles({
|
|
136
142
|
subtree,
|
|
137
143
|
options,
|
|
138
|
-
pData,
|
|
139
|
-
index,
|
|
140
|
-
childTileLevel,
|
|
144
|
+
parentData: pData,
|
|
145
|
+
childIndex: index,
|
|
146
|
+
level: childTileLevel,
|
|
141
147
|
globalData
|
|
142
|
-
);
|
|
148
|
+
});
|
|
143
149
|
|
|
144
150
|
if (currentTile.contentUrl || currentTile.children.length) {
|
|
145
151
|
const globalLevel = lev + 1;
|
|
File without changes
|
|
@@ -136,7 +136,7 @@ export async function normalizeImplicitTileData(tile, rootSubtree: Subtree, opti
|
|
|
136
136
|
tile.lodMetricValue = tile.geometricError;
|
|
137
137
|
tile.transformMatrix = tile.transform;
|
|
138
138
|
|
|
139
|
-
const {children, contentUrl} = await parseImplicitTiles(rootSubtree, options);
|
|
139
|
+
const {children, contentUrl} = await parseImplicitTiles({subtree: rootSubtree, options});
|
|
140
140
|
|
|
141
141
|
if (contentUrl) {
|
|
142
142
|
tile.contentUrl = contentUrl;
|