@loaders.gl/tiles-3d 5.0.0-beta.2 → 5.0.0-beta.4

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 (54) hide show
  1. package/dist/3d-tiles/3d-tiles-archive-loader.js +1 -1
  2. package/dist/3d-tiles/dist.dev.js +502 -342
  3. package/dist/3d-tiles/dist.min.js +19 -19
  4. package/dist/3d-tiles/index.cjs +307 -183
  5. package/dist/3d-tiles/index.cjs.map +3 -3
  6. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.d.ts.map +1 -1
  7. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js +12 -8
  8. package/dist/3d-tiles/lib/classes/tile-3d-batch-table.js.map +1 -1
  9. package/dist/3d-tiles/lib/utils/version.js +1 -1
  10. package/dist/3d-tiles-archive-writer.cjs +1 -1
  11. package/dist/cesium-ion-loader-with-parser.cjs +301 -177
  12. package/dist/cesium-ion-loader-with-parser.cjs.map +3 -3
  13. package/dist/copc/copc-source-loader.js +1 -1
  14. package/dist/copc/copc-writer.js +1 -1
  15. package/dist/copc/index.cjs +358 -9
  16. package/dist/copc/index.cjs.map +3 -3
  17. package/dist/dist.min.js +2 -2
  18. package/dist/i3s/arcgis-webscene-loader.js +1 -1
  19. package/dist/i3s/dist.dev.js +3731 -694
  20. package/dist/i3s/dist.min.js +43 -35
  21. package/dist/i3s/i3s-attribute-loader.js +1 -1
  22. package/dist/i3s/i3s-building-scene-layer-loader.js +1 -1
  23. package/dist/i3s/i3s-content-loader.js +1 -1
  24. package/dist/i3s/i3s-lepcc-loader-types.js +1 -1
  25. package/dist/i3s/i3s-loader.js +1 -1
  26. package/dist/i3s/i3s-node-page-loader.js +1 -1
  27. package/dist/i3s/i3s-slpk-loader.js +1 -1
  28. package/dist/i3s/i3s-slpk-writer.js +1 -1
  29. package/dist/i3s/index.cjs +2542 -373
  30. package/dist/i3s/index.cjs.map +3 -3
  31. package/dist/i3s-content-worker-node.js +11 -11
  32. package/dist/i3s-content-worker-node.js.map +4 -4
  33. package/dist/i3s-content-worker.js +392 -56
  34. package/dist/i3s-lepcc-worker-node.js +369 -37
  35. package/dist/i3s-lepcc-worker-node.js.map +4 -4
  36. package/dist/i3s-lepcc-worker.js +340 -33
  37. package/dist/i3s-mesh-writer.cjs +2464 -295
  38. package/dist/i3s-mesh-writer.cjs.map +3 -3
  39. package/dist/i3s-slpk-writer.cjs +1 -1
  40. package/dist/index.cjs +1 -1
  41. package/dist/point-cloud-tile-source-loader-types.js +1 -1
  42. package/dist/point-cloud-tile-source-loader.cjs +1 -1
  43. package/dist/potree/dist.dev.js +84 -28
  44. package/dist/potree/dist.min.js +26 -26
  45. package/dist/potree/index.cjs +11 -6
  46. package/dist/potree/index.cjs.map +1 -1
  47. package/dist/potree/potree-bin-loader.js +1 -1
  48. package/dist/potree/potree-hierarchy-chunk-loader.js +1 -1
  49. package/dist/potree/potree-loader-types.js +1 -1
  50. package/dist/potree/potree-source-loader.js +1 -1
  51. package/dist/potree/potree-writer.js +1 -1
  52. package/dist/potree-loader.cjs +1 -1
  53. package/package.json +13 -13
  54. package/src/3d-tiles/lib/classes/tile-3d-batch-table.ts +12 -8
@@ -4,7 +4,7 @@
4
4
  import { PotreeBinFormat } from "./potree-format.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
7
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
8
8
  /**
9
9
  * Loader for potree Binary Point Attributes
10
10
  * */
@@ -4,7 +4,7 @@
4
4
  import { PotreeHierarchyChunkFormat } from "./potree-format.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
7
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
8
8
  /** Preloads the parser-bearing Potree hierarchy chunk loader implementation. */
9
9
  async function preload() {
10
10
  const { PotreeHierarchyChunkLoaderWithParser } = await import("./potree-hierarchy-chunk-loader-with-parser.js");
@@ -4,7 +4,7 @@
4
4
  import { PotreeFormat } from "./potree-format.js";
5
5
  // __VERSION__ is injected by babel-plugin-version-inline
6
6
  // @ts-ignore TS2304: Cannot find name '__VERSION__'.
7
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
7
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
8
8
  /** Preloads the parser-bearing Potree loader implementation. */
9
9
  async function preload() {
10
10
  const { PotreeLoaderWithParser } = await import('@loaders.gl/tiles-3d/potree-loader');
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { PotreeNodesSource } from "./lib/potree-node-source.js";
5
5
  // @ts-ignore __VERSION__ is injected by the package build.
6
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
6
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
7
7
  import { PotreeBinFormat } from "./potree-format.js";
8
8
  /**
9
9
  * Creates point cloud data sources for Potree urls
@@ -3,7 +3,7 @@
3
3
  // Copyright (c) vis.gl contributors
4
4
  import { convertTableToMesh } from '@loaders.gl/core/schema-utils';
5
5
  // @ts-ignore __VERSION__ is injected by the package build.
6
- const VERSION = typeof "5.0.0-beta.2" !== 'undefined' ? "5.0.0-beta.2" : 'latest';
6
+ const VERSION = typeof "5.0.0-beta.4" !== 'undefined' ? "5.0.0-beta.4" : 'latest';
7
7
  /** Standard JSON metadata writer; use encodePotreeDataset for a complete dataset. */
8
8
  export const PotreeWriter = {
9
9
  name: 'Potree metadata',
@@ -261,7 +261,7 @@ var PotreeFormat = {
261
261
  };
262
262
 
263
263
  // dist/potree/potree-loader-types.js
264
- var VERSION2 = true ? "5.0.0-beta.2" : "latest";
264
+ var VERSION2 = true ? "5.0.0-beta.4" : "latest";
265
265
  async function preload2() {
266
266
  const { PotreeLoaderWithParser: PotreeLoaderWithParser3 } = await Promise.resolve().then(() => (init_potree_loader(), potree_loader_exports));
267
267
  return PotreeLoaderWithParser3;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/tiles-3d",
3
- "version": "5.0.0-beta.2",
3
+ "version": "5.0.0-beta.4",
4
4
  "description": "3D tileset runtime and loaders for 3D Tiles, I3S, COPC, and Potree",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -201,26 +201,26 @@
201
201
  "build-worker-i3s-lepcc-node": "node ../../scripts/build-codec-worker.mjs src/i3s/workers/i3s-lepcc-worker-node.ts --outfile=dist/i3s-lepcc-worker-node.js --platform=node --target=node16 --bundle --sourcemap --define:__VERSION__=\\\"$npm_package_version\\\""
202
202
  },
203
203
  "dependencies": {
204
- "@loaders.gl/archives": "5.0.0-beta.2",
205
- "@loaders.gl/compression": "5.0.0-beta.2",
206
- "@loaders.gl/images": "5.0.0-beta.2",
207
- "@loaders.gl/pointclouds": "5.0.0-beta.2",
208
- "@loaders.gl/scene": "5.0.0-beta.2",
209
- "@math.gl/core": "5.0.0-beta.2",
210
- "@math.gl/dggs": "5.0.0-beta.2",
211
- "@math.gl/earth": "5.0.0-beta.2",
212
- "@math.gl/geometry": "5.0.0-beta.2",
213
- "@math.gl/geospatial": "5.0.0-beta.2",
204
+ "@loaders.gl/archives": "5.0.0-beta.4",
205
+ "@loaders.gl/compression": "5.0.0-beta.4",
206
+ "@loaders.gl/images": "5.0.0-beta.4",
207
+ "@loaders.gl/pointclouds": "5.0.0-beta.4",
208
+ "@loaders.gl/scene": "5.0.0-beta.4",
209
+ "@math.gl/core": "5.0.0-beta.4",
210
+ "@math.gl/dggs": "5.0.0-beta.4",
211
+ "@math.gl/earth": "5.0.0-beta.4",
212
+ "@math.gl/geometry": "5.0.0-beta.4",
213
+ "@math.gl/geospatial": "5.0.0-beta.4",
214
214
  "probe.gl": "^5.0.0",
215
215
  "zod": "^4.1.12"
216
216
  },
217
217
  "devDependencies": {
218
218
  "@deck.gl/core": "^9.4.0",
219
- "@math.gl/dggs": "5.0.0-beta.2",
219
+ "@math.gl/dggs": "5.0.0-beta.4",
220
220
  "copc": "0.0.8"
221
221
  },
222
222
  "peerDependencies": {
223
223
  "@loaders.gl/core": "~5.0.0-alpha.0"
224
224
  },
225
- "gitHead": "d259e5bc74caf8d75e808314b7fef2fa1bd70ff7"
225
+ "gitHead": "c9420f06e870fa353889d55b684e3588d24574c2"
226
226
  }
@@ -44,9 +44,9 @@ export default class Tile3DBatchTableParser {
44
44
  this._extensions = this.json?.extensions || {};
45
45
 
46
46
  // Copy all top-level property fields from the json object, ignoring special fields
47
- this._properties = {};
48
- for (const propertyName in this.json) {
49
- if (!IGNORED_PROPERTY_FIELDS[propertyName]) {
47
+ this._properties = Object.create(null);
48
+ for (const propertyName of Object.keys(this.json)) {
49
+ if (!Object.hasOwn(IGNORED_PROPERTY_FIELDS, propertyName)) {
50
50
  this._properties[propertyName] = this.json[propertyName];
51
51
  }
52
52
  }
@@ -214,7 +214,7 @@ export default class Tile3DBatchTableParser {
214
214
  // Store any information needed to access the binary data, including the typed array,
215
215
  // componentCount (e.g. a VEC4 would be 4), and the type used to pack and unpack (e.g. Cartesian4).
216
216
  if (binaryProperty) {
217
- binaryProperties = binaryProperties || {};
217
+ binaryProperties ??= Object.create(null) as Record<string, any>;
218
218
  binaryProperties[name] = binaryProperty;
219
219
  }
220
220
  }
@@ -259,7 +259,7 @@ export default class Tile3DBatchTableParser {
259
259
  const result = traverseHierarchy(this._hierarchy, batchId, (hierarchy, instanceIndex) => {
260
260
  const classId = hierarchy.classIds[instanceIndex];
261
261
  const instances = hierarchy.classes[classId].instances;
262
- return defined(instances[name]) ? true : undefined;
262
+ return Object.hasOwn(instances, name) && defined(instances[name]) ? true : undefined;
263
263
  });
264
264
 
265
265
  return defined(result);
@@ -270,7 +270,7 @@ export default class Tile3DBatchTableParser {
270
270
  const classId = hierarchy.classIds[instanceIndex];
271
271
  const instances = hierarchy.classes[classId].instances;
272
272
  for (const name in instances) {
273
- if (instances.hasOwnProperty(name)) {
273
+ if (Object.hasOwn(instances, name)) {
274
274
  if (results.indexOf(name) === -1) {
275
275
  results.push(name);
276
276
  }
@@ -284,7 +284,9 @@ export default class Tile3DBatchTableParser {
284
284
  const classId = hierarchy.classIds[instanceIndex];
285
285
  const instanceClass = hierarchy.classes[classId];
286
286
  const indexInClass = hierarchy.classIndexes[instanceIndex];
287
- const propertyValues = instanceClass.instances[name];
287
+ const propertyValues = Object.hasOwn(instanceClass.instances, name)
288
+ ? instanceClass.instances[name]
289
+ : undefined;
288
290
  if (defined(propertyValues)) {
289
291
  if (defined(propertyValues.typedArray)) {
290
292
  return this._getBinaryProperty(propertyValues, indexInClass);
@@ -300,7 +302,9 @@ export default class Tile3DBatchTableParser {
300
302
  const classId = hierarchy.classIds[instanceIndex];
301
303
  const instanceClass = hierarchy.classes[classId];
302
304
  const indexInClass = hierarchy.classIndexes[instanceIndex];
303
- const propertyValues = instanceClass.instances[name];
305
+ const propertyValues = Object.hasOwn(instanceClass.instances, name)
306
+ ? instanceClass.instances[name]
307
+ : undefined;
304
308
  if (defined(propertyValues)) {
305
309
  assert(instanceIndex === batchId, `Inherited property "${name}" is read-only.`);
306
310
  if (defined(propertyValues.typedArray)) {