@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.
Files changed (25) hide show
  1. package/dist/dist.min.js +817 -93
  2. package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js +31 -63
  3. package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
  4. package/dist/es5/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
  5. package/dist/es5/lib/parsers/parse-3d-tile-header.js +4 -1
  6. package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
  7. package/dist/es5/lib/utils/version.js +1 -1
  8. package/dist/es5/lib/utils/version.js.map +1 -1
  9. package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js +30 -13
  10. package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
  11. package/dist/esm/lib/parsers/parse-3d-tile-gltf.js.map +1 -1
  12. package/dist/esm/lib/parsers/parse-3d-tile-header.js +4 -1
  13. package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
  14. package/dist/esm/lib/utils/version.js +1 -1
  15. package/dist/esm/lib/utils/version.js.map +1 -1
  16. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts +18 -11
  17. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
  18. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +22 -14
  19. package/dist/lib/parsers/parse-3d-tile-gltf.d.ts +1 -1
  20. package/dist/lib/parsers/parse-3d-tile-gltf.d.ts.map +1 -1
  21. package/dist/lib/parsers/parse-3d-tile-header.js +1 -1
  22. package/package.json +8 -8
  23. package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +31 -25
  24. package/src/lib/parsers/{parse-3d-tile-gltf.js → parse-3d-tile-gltf.ts} +0 -0
  25. 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(subtree: Subtree, options: any, parentData?: {
15
- mortonIndex: number;
16
- x: number;
17
- y: number;
18
- z: number;
19
- }, childIndex?: number, level?: number, globalData?: {
20
- level: number;
21
- mortonIndex: number;
22
- x: number;
23
- y: number;
24
- z: number;
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;AAGH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,GAAG,EACZ,UAAU,GAAE;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAKhE,EACD,UAAU,GAAE,MAAU,EACtB,KAAK,GAAE,MAAU,EACjB,UAAU,GAAE;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAM/E;;;;GA8GF;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"}
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(subtree, options, parentData = {
27
- mortonIndex: 0,
28
- x: 0,
29
- y: 0,
30
- z: 0
31
- }, childIndex = 0, level = 0, globalData = {
32
- level: 0,
33
- mortonIndex: 0,
34
- x: 0,
35
- y: 0,
36
- z: 0
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(subtree, options, pData, index, childTileLevel, globalData);
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.js"],"names":[],"mappings":"AAEA,wGAaC"}
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.6",
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.6",
38
- "@loaders.gl/gltf": "3.1.6",
39
- "@loaders.gl/loader-utils": "3.1.6",
40
- "@loaders.gl/math": "3.1.6",
41
- "@loaders.gl/tiles": "3.1.6",
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": "3.1.0"
46
+ "@loaders.gl/core": "4.0.0-alpha.4"
47
47
  },
48
- "gitHead": "4fe0724b942697a95ff3eb3af47b7a7c18556c52"
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: {mortonIndex: number; x: number; y: number; z: number} = {
31
- mortonIndex: 0,
32
- x: 0,
33
- y: 0,
34
- z: 0
35
- },
36
- childIndex: number = 0,
37
- level: number = 0,
38
- globalData: {level: number; mortonIndex: number; x: number; y: number; z: number} = {
39
- level: 0,
40
- mortonIndex: 0,
41
- x: 0,
42
- y: 0,
43
- z: 0
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;
@@ -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;