@loaders.gl/gltf 4.0.0-alpha.24 → 4.0.0-alpha.26

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 (77) hide show
  1. package/dist/dist.min.js +237 -146
  2. package/dist/es5/index.js +12 -0
  3. package/dist/es5/index.js.map +1 -1
  4. package/dist/es5/lib/api/gltf-extensions.js +1 -1
  5. package/dist/es5/lib/api/gltf-extensions.js.map +1 -1
  6. package/dist/es5/lib/extensions/EXT_mesh_features.js +12 -24
  7. package/dist/es5/lib/extensions/EXT_mesh_features.js.map +1 -1
  8. package/dist/es5/lib/extensions/EXT_structural_metadata.js +72 -28
  9. package/dist/es5/lib/extensions/EXT_structural_metadata.js.map +1 -1
  10. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js +38 -3
  11. package/dist/es5/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
  12. package/dist/es5/lib/extensions/utils/3d-tiles-utils.js +26 -18
  13. package/dist/es5/lib/extensions/utils/3d-tiles-utils.js.map +1 -1
  14. package/dist/es5/lib/gltf-utils/gltf-utils.js +29 -0
  15. package/dist/es5/lib/gltf-utils/gltf-utils.js.map +1 -1
  16. package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js +2 -0
  17. package/dist/es5/lib/types/gltf-ext-feature-metadata-schema.js.map +1 -0
  18. package/dist/es5/lib/types/gltf-ext-mesh-features-schema.js.map +1 -1
  19. package/dist/es5/lib/types/gltf-ext-structural-metadata-schema.js.map +1 -1
  20. package/dist/es5/lib/types/gltf-json-schema.js.map +1 -1
  21. package/dist/es5/lib/types/gltf-types.js.map +1 -1
  22. package/dist/es5/lib/utils/version.js +1 -1
  23. package/dist/esm/index.js +2 -0
  24. package/dist/esm/index.js.map +1 -1
  25. package/dist/esm/lib/api/gltf-extensions.js +1 -1
  26. package/dist/esm/lib/api/gltf-extensions.js.map +1 -1
  27. package/dist/esm/lib/extensions/EXT_mesh_features.js +13 -25
  28. package/dist/esm/lib/extensions/EXT_mesh_features.js.map +1 -1
  29. package/dist/esm/lib/extensions/EXT_structural_metadata.js +48 -14
  30. package/dist/esm/lib/extensions/EXT_structural_metadata.js.map +1 -1
  31. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js +38 -4
  32. package/dist/esm/lib/extensions/deprecated/EXT_feature_metadata.js.map +1 -1
  33. package/dist/esm/lib/extensions/utils/3d-tiles-utils.js +27 -19
  34. package/dist/esm/lib/extensions/utils/3d-tiles-utils.js.map +1 -1
  35. package/dist/esm/lib/gltf-utils/gltf-utils.js +30 -0
  36. package/dist/esm/lib/gltf-utils/gltf-utils.js.map +1 -1
  37. package/dist/esm/lib/types/gltf-ext-feature-metadata-schema.js +2 -0
  38. package/dist/esm/lib/types/gltf-ext-feature-metadata-schema.js.map +1 -0
  39. package/dist/esm/lib/types/gltf-ext-mesh-features-schema.js.map +1 -1
  40. package/dist/esm/lib/types/gltf-ext-structural-metadata-schema.js.map +1 -1
  41. package/dist/esm/lib/types/gltf-json-schema.js.map +1 -1
  42. package/dist/esm/lib/types/gltf-types.js.map +1 -1
  43. package/dist/esm/lib/utils/version.js +1 -1
  44. package/dist/index.d.ts +6 -3
  45. package/dist/index.d.ts.map +1 -1
  46. package/dist/lib/extensions/EXT_mesh_features.d.ts.map +1 -1
  47. package/dist/lib/extensions/EXT_structural_metadata.d.ts +9 -1
  48. package/dist/lib/extensions/EXT_structural_metadata.d.ts.map +1 -1
  49. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts +9 -0
  50. package/dist/lib/extensions/deprecated/EXT_feature_metadata.d.ts.map +1 -1
  51. package/dist/lib/extensions/utils/3d-tiles-utils.d.ts +12 -12
  52. package/dist/lib/extensions/utils/3d-tiles-utils.d.ts.map +1 -1
  53. package/dist/lib/gltf-utils/gltf-utils.d.ts +2 -0
  54. package/dist/lib/gltf-utils/gltf-utils.d.ts.map +1 -1
  55. package/dist/lib/types/gltf-ext-feature-metadata-schema.d.ts +421 -0
  56. package/dist/lib/types/gltf-ext-feature-metadata-schema.d.ts.map +1 -0
  57. package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts +4 -6
  58. package/dist/lib/types/gltf-ext-mesh-features-schema.d.ts.map +1 -1
  59. package/dist/lib/types/gltf-ext-structural-metadata-schema.d.ts +44 -25
  60. package/dist/lib/types/gltf-ext-structural-metadata-schema.d.ts.map +1 -1
  61. package/dist/lib/types/gltf-json-schema.d.ts +1 -420
  62. package/dist/lib/types/gltf-json-schema.d.ts.map +1 -1
  63. package/dist/lib/types/gltf-types.d.ts +3 -0
  64. package/dist/lib/types/gltf-types.d.ts.map +1 -1
  65. package/package.json +6 -6
  66. package/src/index.ts +10 -5
  67. package/src/lib/api/gltf-extensions.ts +1 -1
  68. package/src/lib/extensions/EXT_mesh_features.ts +18 -44
  69. package/src/lib/extensions/EXT_structural_metadata.ts +176 -96
  70. package/src/lib/extensions/deprecated/EXT_feature_metadata.ts +70 -11
  71. package/src/lib/extensions/utils/3d-tiles-utils.ts +50 -39
  72. package/src/lib/gltf-utils/gltf-utils.ts +38 -0
  73. package/src/lib/types/gltf-ext-feature-metadata-schema.ts +470 -0
  74. package/src/lib/types/gltf-ext-mesh-features-schema.ts +4 -6
  75. package/src/lib/types/gltf-ext-structural-metadata-schema.ts +46 -27
  76. package/src/lib/types/gltf-json-schema.ts +1 -468
  77. package/src/lib/types/gltf-types.ts +4 -0
@@ -3,9 +3,10 @@ import {GLTFTextureInfoMetadata} from './gltf-json-schema';
3
3
  /* eslint-disable camelcase */
4
4
 
5
5
  /**
6
+ * glTF extension that provides structural metadata about vertices, texels, and features in a glTF asset.
6
7
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/glTF.EXT_structural_metadata.schema.json
7
8
  */
8
- export type GLTF_EXT_structural_metadata = {
9
+ export type GLTF_EXT_structural_metadata_GLTF = {
9
10
  /** An object defining classes and enums. */
10
11
  schema?: GLTF_EXT_structural_metadata_Schema;
11
12
  /** A uri to an external schema file. */
@@ -16,11 +17,12 @@ export type GLTF_EXT_structural_metadata = {
16
17
  propertyTextures?: GLTF_EXT_structural_metadata_PropertyTexture[];
17
18
  /** "An array of property attribute definitions, which may be referenced by index. */
18
19
  propertyAttributes?: GLTF_EXT_structural_metadata_PropertyAttribute[];
19
- /** For internal usage */
20
+ /** This is not part of the spec. GLTFLoader loads names of attributes crated into this property */
20
21
  dataAttributeNames?: string[];
21
22
  };
22
23
 
23
24
  /**
25
+ * An object defining classes and enums.
24
26
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/schema.schema.json
25
27
  */
26
28
  export type GLTF_EXT_structural_metadata_Schema = {
@@ -40,8 +42,8 @@ export type GLTF_EXT_structural_metadata_Schema = {
40
42
  enums?: {
41
43
  [key: string]: GLTF_EXT_structural_metadata_Enum;
42
44
  };
43
- extensions?: Record<string, any>;
44
- extras?: any;
45
+ extensions?: Record<string, unknown>;
46
+ extras?: unknown;
45
47
  };
46
48
 
47
49
  /**
@@ -53,15 +55,19 @@ export type GLTF_EXT_structural_metadata_Enum = {
53
55
  name?: string;
54
56
  /** The description of the enum. */
55
57
  description?: string;
56
- /** The type of the integer enum value. */
57
- valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64'; // default: "UINT16"
58
+ /**
59
+ * The type of the integer enum value.
60
+ * Default value is 'UINT16'
61
+ */
62
+ valueType?: 'INT8' | 'UINT8' | 'INT16' | 'UINT16' | 'INT32' | 'UINT32' | 'INT64' | 'UINT64';
58
63
  /** An array of enum values. Duplicate names or duplicate integer values are not allowed. */
59
64
  values: GLTF_EXT_structural_metadata_EnumValue[];
60
- extensions?: Record<string, any>;
61
- extras?: any;
65
+ extensions?: Record<string, unknown>;
66
+ extras?: unknown;
62
67
  };
63
68
 
64
69
  /**
70
+ * An enum value.
65
71
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/enum.value.schema.json
66
72
  */
67
73
  export type GLTF_EXT_structural_metadata_EnumValue = {
@@ -71,11 +77,12 @@ export type GLTF_EXT_structural_metadata_EnumValue = {
71
77
  description?: string;
72
78
  /** The integer enum value. */
73
79
  value: number;
74
- extensions?: Record<string, any>;
75
- extras?: any;
80
+ extensions?: Record<string, unknown>;
81
+ extras?: unknown;
76
82
  };
77
83
 
78
84
  /**
85
+ * A class containing a set of properties.
79
86
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.schema.json
80
87
  */
81
88
  export type GLTF_EXT_structural_metadata_Class = {
@@ -90,11 +97,12 @@ export type GLTF_EXT_structural_metadata_Class = {
90
97
  properties: {
91
98
  [key: string]: GLTF_EXT_structural_metadata_ClassProperty;
92
99
  };
93
- extensions?: Record<string, any>;
94
- extras?: any;
100
+ extensions?: Record<string, unknown>;
101
+ extras?: unknown;
95
102
  };
96
103
 
97
104
  /**
105
+ * A class property.
98
106
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/class.property.schema.json
99
107
  */
100
108
  export type GLTF_EXT_structural_metadata_ClassProperty = {
@@ -185,8 +193,9 @@ export type GLTF_EXT_structural_metadata_ClassProperty = {
185
193
  * If not required, individual entities may include `noData` values, or the entire property may be omitted.
186
194
  * As a result, `noData` has no effect on a required property.
187
195
  * Client implementations may use required properties to make performance optimizations.
196
+ * Default value is false.
188
197
  */
189
- required?: boolean; // default false;
198
+ required?: boolean;
190
199
 
191
200
  /**
192
201
  * A `noData` value represents missing data — also known as a sentinel value — wherever it appears.
@@ -201,10 +210,14 @@ export type GLTF_EXT_structural_metadata_ClassProperty = {
201
210
  * The semantic cannot be used by other properties in the class.
202
211
  */
203
212
  semantic?: string;
204
- extensions?: Record<string, any>;
205
- extras?: any;
213
+ extensions?: Record<string, unknown>;
214
+ extras?: unknown;
206
215
  };
207
216
 
217
+ /**
218
+ * Properties conforming to a class, organized as property values stored in binary columnar arrays.
219
+ * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.schema.json
220
+ */
208
221
  export type GLTF_EXT_structural_metadata_PropertyTable = {
209
222
  /** The name of the property table, e.g. for display purposes. */
210
223
  name?: string;
@@ -220,11 +233,12 @@ export type GLTF_EXT_structural_metadata_PropertyTable = {
220
233
  properties?: {
221
234
  [key: string]: GLTF_EXT_structural_metadata_PropertyTable_Property;
222
235
  };
223
- extensions?: Record<string, any>;
224
- extras?: any;
236
+ extensions?: Record<string, unknown>;
237
+ extras?: unknown;
225
238
  };
226
239
 
227
240
  /**
241
+ * An array of binary property values.
228
242
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTable.property.schema.json
229
243
  */
230
244
  export type GLTF_EXT_structural_metadata_PropertyTable_Property = {
@@ -262,11 +276,13 @@ export type GLTF_EXT_structural_metadata_PropertyTable_Property = {
262
276
  stringOffsets?: number;
263
277
  /**
264
278
  * The type of values in `arrayOffsets`.
279
+ * Default value is 'UINT32'
265
280
  */
266
281
  arrayOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;
267
282
 
268
283
  /**
269
284
  * The type of values in `stringOffsets`.
285
+ * Default value is 'UINT32'
270
286
  */
271
287
  stringOffsetType?: 'UINT8' | 'UINT16' | 'UINT32' | 'UINT64' | string;
272
288
  /**
@@ -293,13 +309,14 @@ export type GLTF_EXT_structural_metadata_PropertyTable_Property = {
293
309
  * This is the minimum of all property values, after the transforms based on the `normalized`, `offset`, and `scale` properties have been applied.
294
310
  */
295
311
  min?: number | number[];
296
- extensions?: Record<string, any>;
297
- extras?: any;
298
- /** For internal usage */
312
+ extensions?: Record<string, unknown>;
313
+ extras?: unknown;
314
+ /** This is not part of the spec. GLTFLoader loads feature tables data into this property */
299
315
  data?: unknown;
300
316
  };
301
317
 
302
318
  /**
319
+ * Properties conforming to a class, organized as property values stored in textures.
303
320
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyTexture.schema.json
304
321
  */
305
322
  export type GLTF_EXT_structural_metadata_PropertyTexture = {
@@ -322,11 +339,12 @@ export type GLTF_EXT_structural_metadata_PropertyTexture = {
322
339
  properties?: {
323
340
  [key: string]: GLTFTextureInfoMetadata;
324
341
  };
325
- extensions?: Record<string, any>;
326
- extras?: any;
342
+ extensions?: Record<string, unknown>;
343
+ extras?: unknown;
327
344
  };
328
345
 
329
346
  /**
347
+ * Properties conforming to a class, organized as property values stored in attributes.
330
348
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/propertyAttribute.schema.json
331
349
  */
332
350
  export type GLTF_EXT_structural_metadata_PropertyAttribute = {
@@ -340,13 +358,14 @@ export type GLTF_EXT_structural_metadata_PropertyAttribute = {
340
358
  * Required properties must be included in this dictionary.
341
359
  */
342
360
  properties?: {
343
- [key: string]: any;
361
+ [key: string]: unknown;
344
362
  };
345
- extensions?: Record<string, any>;
346
- extras?: any;
363
+ extensions?: Record<string, unknown>;
364
+ extras?: unknown;
347
365
  };
348
366
 
349
367
  /**
368
+ * Structural metadata about a glTF primitive.
350
369
  * @see https://github.com/CesiumGS/glTF/blob/3d-tiles-next/extensions/2.0/Vendor/EXT_structural_metadata/schema/mesh.primitive.EXT_structural_metadata.schema.json
351
370
  */
352
371
  export type GLTF_EXT_structural_metadata_Primitive = {
@@ -354,6 +373,6 @@ export type GLTF_EXT_structural_metadata_Primitive = {
354
373
  propertyTextures?: number[];
355
374
  /** An array of indexes of property attributes in the root `EXT_structural_metadata` object. */
356
375
  propertyAttributes?: number[];
357
- extensions?: Record<string, any>;
358
- extras?: any;
376
+ extensions?: Record<string, unknown>;
377
+ extras?: unknown;
359
378
  };