@loaders.gl/3d-tiles 4.0.0-alpha.12 → 4.0.0-alpha.14

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 (32) hide show
  1. package/dist/dist.min.js +690 -62
  2. package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js +63 -38
  3. package/dist/es5/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
  4. package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js +69 -44
  5. package/dist/es5/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
  6. package/dist/es5/lib/parsers/parse-3d-tile-header.js +12 -11
  7. package/dist/es5/lib/parsers/parse-3d-tile-header.js.map +1 -1
  8. package/dist/es5/lib/utils/version.js +1 -1
  9. package/dist/es5/types.js.map +1 -1
  10. package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js +45 -23
  11. package/dist/esm/lib/parsers/helpers/parse-3d-implicit-tiles.js.map +1 -1
  12. package/dist/esm/lib/parsers/helpers/parse-3d-tile-subtree.js +18 -14
  13. package/dist/esm/lib/parsers/helpers/parse-3d-tile-subtree.js.map +1 -1
  14. package/dist/esm/lib/parsers/parse-3d-tile-header.js +6 -4
  15. package/dist/esm/lib/parsers/parse-3d-tile-header.js.map +1 -1
  16. package/dist/esm/lib/utils/version.js +1 -1
  17. package/dist/esm/types.js.map +1 -1
  18. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts +4 -1
  19. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
  20. package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +65 -28
  21. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.d.ts.map +1 -1
  22. package/dist/lib/parsers/helpers/parse-3d-tile-subtree.js +24 -18
  23. package/dist/lib/parsers/parse-3d-tile-header.d.ts +30 -2
  24. package/dist/lib/parsers/parse-3d-tile-header.d.ts.map +1 -1
  25. package/dist/lib/parsers/parse-3d-tile-header.js +6 -5
  26. package/dist/types.d.ts +45 -3
  27. package/dist/types.d.ts.map +1 -1
  28. package/package.json +8 -7
  29. package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +76 -32
  30. package/src/lib/parsers/helpers/parse-3d-tile-subtree.ts +43 -35
  31. package/src/lib/parsers/parse-3d-tile-header.ts +37 -5
  32. package/src/types.ts +46 -4
package/src/types.ts CHANGED
@@ -294,20 +294,57 @@ export type Tiles3DTileContent = {
294
294
 
295
295
  /**
296
296
  * 3DTILES_implicit_tiling types
297
- * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling#subtree-file-format
297
+ * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling
298
+ * JSON Schema v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/subtree.schema.json
299
+ * JSON Schema vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/subtree.schema.json
298
300
  */
299
301
  export type Subtree = {
302
+ /** An array of buffers. */
300
303
  buffers: Buffer[];
304
+ /** An array of buffer views. */
301
305
  bufferViews: BufferView[];
306
+ /** The availability of tiles in the subtree. The availability bitstream is a 1D boolean array where tiles are ordered by their level in the subtree and Morton index
307
+ * within that level. A tile's availability is determined by a single bit, 1 meaning a tile exists at that spatial index, and 0 meaning it does not.
308
+ * The number of elements in the array is `(N^subtreeLevels - 1)/(N - 1)` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.
309
+ * Availability may be stored in a buffer view or as a constant value that applies to all tiles. If a non-root tile's availability is 1 its parent
310
+ * tile's availability shall also be 1. `tileAvailability.constant: 0` is disallowed, as subtrees shall have at least one tile.
311
+ */
302
312
  tileAvailability: Availability;
303
- contentAvailability: Availability;
313
+ /** It is array by spec but there are tiles that has a single object
314
+ * An array of content availability objects. If the tile has a single content this array will have one element; if the tile has multiple contents -
315
+ * as supported by 3DTILES_multiple_contents and 3D Tiles 1.1 - this array will have multiple elements.
316
+ */
317
+ contentAvailability: Availability | Availability[];
318
+ /** The availability of children subtrees. The availability bitstream is a 1D boolean array where subtrees are ordered by their Morton index in the level of the tree
319
+ * immediately below the bottom row of the subtree. A child subtree's availability is determined by a single bit, 1 meaning a subtree exists at that spatial index,
320
+ * and 0 meaning it does not. The number of elements in the array is `N^subtreeLevels` where N is 4 for subdivision scheme `QUADTREE` and 8 for `OCTREE`.
321
+ * Availability may be stored in a buffer view or as a constant value that applies to all child subtrees. If availability is 0 for all child subtrees,
322
+ * then the tileset does not subdivide further.
323
+ */
304
324
  childSubtreeAvailability: Availability;
325
+ // TODO: These are unused properties. Improve types when they are required
326
+ propertyTables: unknown;
327
+ tileMetadata: unknown;
328
+ contentMetadata: unknown;
329
+ subtreeMetadata: unknown;
305
330
  };
306
331
 
307
332
  export type Availability = {
333
+ /** Integer indicating whether all of the elements are available (1) or all are unavailable (0). */
308
334
  constant?: 0 | 1;
335
+ /** Index of a buffer view that indicates whether each element is available. The bitstream conforms to the boolean array encoding described
336
+ * in the 3D Metadata specification. If an element is available, its bit is 1, and if it is unavailable, its bit is 0. */
337
+ bitstream?: number;
338
+ /**
339
+ * v1.1 https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/specification/schema/Subtree/availability.schema.json
340
+ * vNext https://github.com/CesiumGS/3d-tiles/blob/8e5e67e078850cc8ce15bd1873fe54f11bbee02f/extensions/3DTILES_implicit_tiling/schema/subtree/availability.schema.json
341
+ * The schemas of vNext and 1.1 are same but there are tiles with `bufferView` property instead of `bitstream`
342
+ */
309
343
  bufferView?: number;
310
- // Internal bitstream type
344
+ /**
345
+ * Postprocessing property
346
+ * contain availability bits loaded from the bufferView
347
+ */
311
348
  explicitBitstream?: ExplicitBitstream;
312
349
  };
313
350
 
@@ -324,7 +361,8 @@ type Buffer = {
324
361
  byteLength: number;
325
362
  };
326
363
 
327
- type BufferView = {
364
+ /** Subtree buffer view */
365
+ export type BufferView = {
328
366
  buffer: number;
329
367
  byteOffset: number;
330
368
  byteLength: number;
@@ -334,6 +372,10 @@ type BufferView = {
334
372
  * Spec - https://github.com/CesiumGS/3d-tiles/tree/main/extensions/3DTILES_implicit_tiling
335
373
  */
336
374
  export type ImplicitTilingExensionData = ImplicitTilingData & {
375
+ /** This property is not part of the schema
376
+ * https://github.com/CesiumGS/3d-tiles/blob/main/extensions/3DTILES_implicit_tiling/schema/tile.3DTILES_implicit_tiling.schema.json
377
+ * But it can be seen in some test datasets. It is handled as substitute of `availableLevels`
378
+ */
337
379
  maximumLevel?: number;
338
380
  };
339
381