@xeokit/xeokit-sdk 2.6.111 → 2.6.112

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.
@@ -1,11 +1,11 @@
1
1
  /**
2
- * xeokit-sdk v2.6.111
3
- * Commit: f70838c6581084cf8401daf800ff7c14582ec11a
4
- * Built: 2026-05-27T11:07:01.143Z
2
+ * xeokit-sdk v2.6.112
3
+ * Commit: 2ce58020bcf3e4af1f68e47009f413c448a8a2a4
4
+ * Built: 2026-06-25T15:09:42.607Z
5
5
  */
6
6
 
7
7
  if (typeof window !== 'undefined') {
8
- window.__XEOKIT__ = { version: '2.6.111', commit: 'f70838c6581084cf8401daf800ff7c14582ec11a', built: '2026-05-27T11:07:01.143Z' };
8
+ window.__XEOKIT__ = { version: '2.6.112', commit: '2ce58020bcf3e4af1f68e47009f413c448a8a2a4', built: '2026-06-25T15:09:42.607Z' };
9
9
  }
10
10
 
11
11
  'use strict';
@@ -111591,11 +111591,12 @@ function getBasePath(src) {
111591
111591
  function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok, error) {
111592
111592
  const spinner = plugin.viewer.scene.canvas.spinner;
111593
111593
  spinner.processes++;
111594
- parse$4(gltf, GLTFLoader, {
111594
+ const loadersGl = options.loadersGl;
111595
+ (loadersGl ? loadersGl.core.parse : parse$4)(gltf, loadersGl ? loadersGl.gltf.GLTFLoader : GLTFLoader, {
111595
111596
  ...(options.parseOptions || { }),
111596
111597
  baseUri: options.basePath
111597
111598
  }).then((gltfData) => {
111598
- const processedGLTF = postProcessGLTF(gltfData);
111599
+ const processedGLTF = (loadersGl ? loadersGl.gltf.postProcessGLTF : postProcessGLTF)(gltfData);
111599
111600
  const ctx = {
111600
111601
  src: src,
111601
111602
  entityId: options.entityId,
@@ -112497,6 +112498,9 @@ class GLTFLoaderPlugin extends Plugin {
112497
112498
  * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models.
112498
112499
  * @param {*} [params.parseOptions={}] Options to pass to loaders.gl parse method, eg. ````{ gltf: { excludeExtensions: { "KHR_texture_transform": false } } }````.
112499
112500
  * @param {Boolean} [params.entityPerMesh=false] Create an entity for each mesh, instead of grouping leaf meshes under their common entity.
112501
+ * @param {*} [params.loadersGl={core,gltf}] Alternative user-provided loaders.gl library.
112502
+ * This feature has been tested with loaders.gl 4.3.4 version.
112503
+ * Because loaders.gl is supplied externally, xeokit cannot guarantee compatibility with all loaders.gl versions.
112500
112504
  * @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}
112501
112505
  */
112502
112506
  load(params = {}) {
@@ -121082,6 +121086,9 @@ class ViewCullPlugin extends Plugin {
121082
121086
  if (cullDirty) {
121083
121087
  const kdNode = this._kdRoot;
121084
121088
  if (kdNode) {
121089
+ for (let objectIdx = 0, len = this._objectCullStates.numObjects; objectIdx < len; objectIdx++) {
121090
+ this._objectCullStates.setObjectViewCulled(objectIdx, false);
121091
+ }
121085
121092
  this._visitKDNode(kdNode);
121086
121093
  }
121087
121094
  }
@@ -123543,7 +123550,7 @@ function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
123543
123550
  if (!geometryArrays) {
123544
123551
 
123545
123552
  geometryArrays = {
123546
- batchThisMesh: (!options.reuseGeometries)
123553
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
123547
123554
  };
123548
123555
 
123549
123556
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
@@ -124057,7 +124064,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
124057
124064
 
124058
124065
  if (!geometryArrays) {
124059
124066
  geometryArrays = {
124060
- batchThisMesh: (!options.reuseGeometries)
124067
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
124061
124068
  };
124062
124069
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
124063
124070
  let geometryValid = false;
@@ -124663,7 +124670,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
124663
124670
 
124664
124671
  if (!geometryArrays) {
124665
124672
  geometryArrays = {
124666
- batchThisMesh: (!options.reuseGeometries)
124673
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
124667
124674
  };
124668
124675
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
124669
124676
  let geometryValid = false;
@@ -125311,7 +125318,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
125311
125318
 
125312
125319
  if (!geometryArrays) {
125313
125320
  geometryArrays = {
125314
- batchThisMesh: (!options.reuseGeometries)
125321
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
125315
125322
  };
125316
125323
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
125317
125324
  let geometryValid = false;
@@ -126046,7 +126053,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
126046
126053
 
126047
126054
  if (!geometryArrays) {
126048
126055
  geometryArrays = {
126049
- batchThisMesh: (!options.reuseGeometries)
126056
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
126050
126057
  };
126051
126058
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
126052
126059
  const axisLabel = eachGeometryAxisLabel[geometryIndex];
@@ -126982,7 +126989,7 @@ class XKTLoaderPlugin extends Plugin {
126982
126989
  * @param {String[]} [cfg.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
126983
126990
  * @param {String[]} [cfg.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
126984
126991
  * @param {Boolean} [cfg.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
126985
- * @param {Boolean} [cfg.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to internally expand
126992
+ * @param {Boolean|Function} [cfg.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to internally expand, a function will be called with a `{ instanceCount: <number> }` argument.
126986
126993
  * all geometry instances into batches (````false````), and not use instancing to render them. Setting this ````false```` can significantly
126987
126994
  * improve Viewer performance for models that have a lot of geometry reuse, but may also increase the amount of
126988
126995
  * browser and GPU memory they require. See [#769](https://github.com/xeokit/xeokit-sdk/issues/769) for more info.
@@ -127250,7 +127257,7 @@ class XKTLoaderPlugin extends Plugin {
127250
127257
  * @type {Boolean}
127251
127258
  */
127252
127259
  set reuseGeometries(value) {
127253
- this._reuseGeometries = value !== false;
127260
+ this._reuseGeometries = value;
127254
127261
  }
127255
127262
 
127256
127263
  /**
@@ -127292,9 +127299,9 @@ class XKTLoaderPlugin extends Plugin {
127292
127299
  * Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
127293
127300
  * @param {Boolean} [params.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
127294
127301
  * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models. See {@link XKTLoaderPlugin#globalizeObjectIds} for more info.
127295
- * @param {Boolean} [params.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to expand
127296
- * all geometry instances into batches (````false````), and not use instancing to render them. Setting this ````false```` can significantly
127297
- * improve Viewer performance for models that have excessive geometry reuse, but may also increases the amount of
127302
+ * @param {Boolean|Function} [params.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to expand
127303
+ * all geometry instances into batches (````false````), and not use instancing to render them. A function will be called with a `{ instanceCount: <number> }` argument. Setting this ````false```` can significantly
127304
+ * improve Viewer performance for models that have excessive geometry reuse, but may also increase the amount of
127298
127305
  * browser and GPU memory used by the model. See [#769](https://github.com/xeokit/xeokit-sdk/issues/769) for more info.
127299
127306
  * @param {Boolean} [params.dtxEnabled=true] When ````true```` (default) use data textures (DTX), where appropriate, to
127300
127307
  * represent the returned model. Set false to always use vertex buffer objects (VBOs). Note that DTX is only applicable
@@ -127321,7 +127328,8 @@ class XKTLoaderPlugin extends Plugin {
127321
127328
  const includeIds = params.includeIds || this._includeIds;
127322
127329
  const objectDefaults = params.objectDefaults || this._objectDefaults;
127323
127330
 
127324
- options.reuseGeometries = (params.reuseGeometries !== null && params.reuseGeometries !== undefined) ? params.reuseGeometries : (this._reuseGeometries !== false);
127331
+ const reuseGeometries = params.reuseGeometries ?? this._reuseGeometries;
127332
+ options.reuseGeometries = (typeof reuseGeometries !== "function") ? (() => reuseGeometries) : reuseGeometries;
127325
127333
 
127326
127334
  if (includeTypes) {
127327
127335
  options.includeTypesMap = {};
@@ -1,11 +1,11 @@
1
1
  /**
2
- * xeokit-sdk v2.6.111
3
- * Commit: f70838c6581084cf8401daf800ff7c14582ec11a
4
- * Built: 2026-05-27T11:07:01.143Z
2
+ * xeokit-sdk v2.6.112
3
+ * Commit: 2ce58020bcf3e4af1f68e47009f413c448a8a2a4
4
+ * Built: 2026-06-25T15:09:42.607Z
5
5
  */
6
6
 
7
7
  if (typeof window !== 'undefined') {
8
- window.__XEOKIT__ = { version: '2.6.111', commit: 'f70838c6581084cf8401daf800ff7c14582ec11a', built: '2026-05-27T11:07:01.143Z' };
8
+ window.__XEOKIT__ = { version: '2.6.112', commit: '2ce58020bcf3e4af1f68e47009f413c448a8a2a4', built: '2026-06-25T15:09:42.607Z' };
9
9
  }
10
10
 
11
11
  /** @private */
@@ -111587,11 +111587,12 @@ function getBasePath(src) {
111587
111587
  function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok, error) {
111588
111588
  const spinner = plugin.viewer.scene.canvas.spinner;
111589
111589
  spinner.processes++;
111590
- parse$4(gltf, GLTFLoader, {
111590
+ const loadersGl = options.loadersGl;
111591
+ (loadersGl ? loadersGl.core.parse : parse$4)(gltf, loadersGl ? loadersGl.gltf.GLTFLoader : GLTFLoader, {
111591
111592
  ...(options.parseOptions || { }),
111592
111593
  baseUri: options.basePath
111593
111594
  }).then((gltfData) => {
111594
- const processedGLTF = postProcessGLTF(gltfData);
111595
+ const processedGLTF = (loadersGl ? loadersGl.gltf.postProcessGLTF : postProcessGLTF)(gltfData);
111595
111596
  const ctx = {
111596
111597
  src: src,
111597
111598
  entityId: options.entityId,
@@ -112493,6 +112494,9 @@ class GLTFLoaderPlugin extends Plugin {
112493
112494
  * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models.
112494
112495
  * @param {*} [params.parseOptions={}] Options to pass to loaders.gl parse method, eg. ````{ gltf: { excludeExtensions: { "KHR_texture_transform": false } } }````.
112495
112496
  * @param {Boolean} [params.entityPerMesh=false] Create an entity for each mesh, instead of grouping leaf meshes under their common entity.
112497
+ * @param {*} [params.loadersGl={core,gltf}] Alternative user-provided loaders.gl library.
112498
+ * This feature has been tested with loaders.gl 4.3.4 version.
112499
+ * Because loaders.gl is supplied externally, xeokit cannot guarantee compatibility with all loaders.gl versions.
112496
112500
  * @returns {Entity} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}
112497
112501
  */
112498
112502
  load(params = {}) {
@@ -121078,6 +121082,9 @@ class ViewCullPlugin extends Plugin {
121078
121082
  if (cullDirty) {
121079
121083
  const kdNode = this._kdRoot;
121080
121084
  if (kdNode) {
121085
+ for (let objectIdx = 0, len = this._objectCullStates.numObjects; objectIdx < len; objectIdx++) {
121086
+ this._objectCullStates.setObjectViewCulled(objectIdx, false);
121087
+ }
121081
121088
  this._visitKDNode(kdNode);
121082
121089
  }
121083
121090
  }
@@ -123539,7 +123546,7 @@ function load$4(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
123539
123546
  if (!geometryArrays) {
123540
123547
 
123541
123548
  geometryArrays = {
123542
- batchThisMesh: (!options.reuseGeometries)
123549
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
123543
123550
  };
123544
123551
 
123545
123552
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
@@ -124053,7 +124060,7 @@ function load$3(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
124053
124060
 
124054
124061
  if (!geometryArrays) {
124055
124062
  geometryArrays = {
124056
- batchThisMesh: (!options.reuseGeometries)
124063
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
124057
124064
  };
124058
124065
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
124059
124066
  let geometryValid = false;
@@ -124659,7 +124666,7 @@ function load$2(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
124659
124666
 
124660
124667
  if (!geometryArrays) {
124661
124668
  geometryArrays = {
124662
- batchThisMesh: (!options.reuseGeometries)
124669
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
124663
124670
  };
124664
124671
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
124665
124672
  let geometryValid = false;
@@ -125307,7 +125314,7 @@ function load$1(viewer, options, inflatedData, sceneModel, metaModel, manifestCt
125307
125314
 
125308
125315
  if (!geometryArrays) {
125309
125316
  geometryArrays = {
125310
- batchThisMesh: (!options.reuseGeometries)
125317
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
125311
125318
  };
125312
125319
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
125313
125320
  let geometryValid = false;
@@ -126042,7 +126049,7 @@ function load(viewer, options, inflatedData, sceneModel, metaModel, manifestCtx)
126042
126049
 
126043
126050
  if (!geometryArrays) {
126044
126051
  geometryArrays = {
126045
- batchThisMesh: (!options.reuseGeometries)
126052
+ batchThisMesh: (!options.reuseGeometries({ instanceCount: geometryReuseCount }))
126046
126053
  };
126047
126054
  const primitiveType = eachGeometryPrimitiveType[geometryIndex];
126048
126055
  const axisLabel = eachGeometryAxisLabel[geometryIndex];
@@ -126978,7 +126985,7 @@ class XKTLoaderPlugin extends Plugin {
126978
126985
  * @param {String[]} [cfg.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
126979
126986
  * @param {String[]} [cfg.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
126980
126987
  * @param {Boolean} [cfg.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
126981
- * @param {Boolean} [cfg.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to internally expand
126988
+ * @param {Boolean|Function} [cfg.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to internally expand, a function will be called with a `{ instanceCount: <number> }` argument.
126982
126989
  * all geometry instances into batches (````false````), and not use instancing to render them. Setting this ````false```` can significantly
126983
126990
  * improve Viewer performance for models that have a lot of geometry reuse, but may also increase the amount of
126984
126991
  * browser and GPU memory they require. See [#769](https://github.com/xeokit/xeokit-sdk/issues/769) for more info.
@@ -127246,7 +127253,7 @@ class XKTLoaderPlugin extends Plugin {
127246
127253
  * @type {Boolean}
127247
127254
  */
127248
127255
  set reuseGeometries(value) {
127249
- this._reuseGeometries = value !== false;
127256
+ this._reuseGeometries = value;
127250
127257
  }
127251
127258
 
127252
127259
  /**
@@ -127288,9 +127295,9 @@ class XKTLoaderPlugin extends Plugin {
127288
127295
  * Viewer will hide backfaces on watertight meshes, show backfaces on open meshes, and always show backfaces on meshes when we slice them open with {@link SectionPlane}s.
127289
127296
  * @param {Boolean} [params.excludeUnclassifiedObjects=false] When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). This is useful when we don't want Entitys in the Scene that are not represented within IFC navigation components, such as {@link TreeViewPlugin}.
127290
127297
  * @param {Boolean} [params.globalizeObjectIds=false] Indicates whether to globalize each {@link Entity#id} and {@link MetaObject#id}, in case you need to prevent ID clashes with other models. See {@link XKTLoaderPlugin#globalizeObjectIds} for more info.
127291
- * @param {Boolean} [params.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to expand
127292
- * all geometry instances into batches (````false````), and not use instancing to render them. Setting this ````false```` can significantly
127293
- * improve Viewer performance for models that have excessive geometry reuse, but may also increases the amount of
127298
+ * @param {Boolean|Function} [params.reuseGeometries=true] Indicates whether to enable geometry reuse (````true```` by default) or whether to expand
127299
+ * all geometry instances into batches (````false````), and not use instancing to render them. A function will be called with a `{ instanceCount: <number> }` argument. Setting this ````false```` can significantly
127300
+ * improve Viewer performance for models that have excessive geometry reuse, but may also increase the amount of
127294
127301
  * browser and GPU memory used by the model. See [#769](https://github.com/xeokit/xeokit-sdk/issues/769) for more info.
127295
127302
  * @param {Boolean} [params.dtxEnabled=true] When ````true```` (default) use data textures (DTX), where appropriate, to
127296
127303
  * represent the returned model. Set false to always use vertex buffer objects (VBOs). Note that DTX is only applicable
@@ -127317,7 +127324,8 @@ class XKTLoaderPlugin extends Plugin {
127317
127324
  const includeIds = params.includeIds || this._includeIds;
127318
127325
  const objectDefaults = params.objectDefaults || this._objectDefaults;
127319
127326
 
127320
- options.reuseGeometries = (params.reuseGeometries !== null && params.reuseGeometries !== undefined) ? params.reuseGeometries : (this._reuseGeometries !== false);
127327
+ const reuseGeometries = params.reuseGeometries ?? this._reuseGeometries;
127328
+ options.reuseGeometries = (typeof reuseGeometries !== "function") ? (() => reuseGeometries) : reuseGeometries;
127321
127329
 
127322
127330
  if (includeTypes) {
127323
127331
  options.includeTypesMap = {};