@xeokit/xeokit-sdk 2.6.101 → 2.6.102
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.
- package/README.md +1 -1
- package/dist/xeokit-sdk.cjs.js +27 -25
- package/dist/xeokit-sdk.es.js +27 -25
- package/dist/xeokit-sdk.es5.js +26 -22
- package/dist/xeokit-sdk.min.cjs.js +5 -5
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +5 -5
- package/package.json +1 -1
- package/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +2 -4
- package/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +2 -3
- package/src/plugins/XKTLoaderPlugin/XKTLoaderPlugin.js +10 -10
- package/src/viewer/scene/model/layer/VBOLayer.js +1 -2
- package/src/viewer/scene/paths/Curve.js +8 -2
- package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +2 -2
- package/types/viewer/scene/paths/Curve.d.ts +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xeokit/xeokit-sdk",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.102",
|
|
4
4
|
"description": "3D BIM IFC Viewer SDK for AEC engineering applications. Open Source JavaScript Toolkit based on pure WebGL for top performance, real-world coordinates and full double precision",
|
|
5
5
|
"module": "./dist/xeokit-sdk.es.js",
|
|
6
6
|
"main": "./dist/xeokit-sdk.cjs.js",
|
|
@@ -13,7 +13,7 @@ import {IFCObjectDefaults} from "../../viewer/metadata/IFCObjectDefaults.js";
|
|
|
13
13
|
* * Creates an {@link Entity} for each object within the model, which is indicated by each glTF ````node```` that has a ````name```` attribute. Those Entities will have {@link Entity#isObject} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#objects}.
|
|
14
14
|
* * When loading, can set the World-space position, scale and rotation of each model within World space, along with initial properties for all the model's {@link Entity}s.
|
|
15
15
|
* * Not recommended for large models. For best performance with large glTF datasets, we recommend first converting them
|
|
16
|
-
* to ````.xkt```` format (
|
|
16
|
+
* to ````.xkt```` format (e.g. using [convert2xkt](https://github.com/xeokit/xeokit-convert)), then loading
|
|
17
17
|
* the ````.xkt```` using {@link XKTLoaderPlugin}.
|
|
18
18
|
*
|
|
19
19
|
* ## Metadata
|
|
@@ -36,8 +36,6 @@ import {IFCObjectDefaults} from "../../viewer/metadata/IFCObjectDefaults.js";
|
|
|
36
36
|
* Since this model contains IFC types, the GLTFLoaderPlugin will set the initial colors of object {@link Entity}s according
|
|
37
37
|
* to the standard IFC element colors in the GLTFModel's current map. Override that with your own map via property {@link GLTFLoaderPlugin#objectDefaults}.
|
|
38
38
|
*
|
|
39
|
-
* Read more about this example in the user guide on [Viewing BIM Models Offline](https://www.notion.so/xeokit/Viewing-an-IFC-Model-with-xeokit-c373e48bc4094ff5b6e5c5700ff580ee).
|
|
40
|
-
*
|
|
41
39
|
* ````javascript
|
|
42
40
|
* import {Viewer, GLTFLoaderPlugin} from "xeokit-sdk.es.js";
|
|
43
41
|
*
|
|
@@ -174,7 +172,7 @@ import {IFCObjectDefaults} from "../../viewer/metadata/IFCObjectDefaults.js";
|
|
|
174
172
|
* contains a MetaObject that corresponds to that Entity.
|
|
175
173
|
*
|
|
176
174
|
* When we've done that, then xeokit's {@link TreeViewPlugin} is able to have a node that represents the glTF model and controls
|
|
177
|
-
* the visibility of that Entity (
|
|
175
|
+
* the visibility of that Entity (i.e. to control the visibility of the entire model).
|
|
178
176
|
*
|
|
179
177
|
* The snippet below shows how this is done.
|
|
180
178
|
*
|
|
@@ -427,11 +427,10 @@ function loadDefaultScene(ctx) {
|
|
|
427
427
|
const nodeName = node.name;
|
|
428
428
|
let entityId = (((nodeName !== undefined) && (nodeName !== null) && nodeName)
|
|
429
429
|
||
|
|
430
|
-
((depth === 0) && ("
|
|
431
|
-
|
|
430
|
+
((depth === 0) && ("Node." + String(ctx.nextId++).padStart(4, "0"))));
|
|
432
431
|
if (entityId) {
|
|
433
432
|
while (ctx.sceneModel.objects[entityId]) {
|
|
434
|
-
entityId = "
|
|
433
|
+
entityId = nodeName + "." + String(ctx.nextId++).padStart(4, "0");
|
|
435
434
|
}
|
|
436
435
|
meshIdsStack.push(meshIds);
|
|
437
436
|
meshIds = [];
|
|
@@ -56,9 +56,9 @@ parsers[ParserV12.version] = ParserV12;
|
|
|
56
56
|
*
|
|
57
57
|
* # Creating *````.XKT````* Files and Metadata
|
|
58
58
|
*
|
|
59
|
-
* We have several
|
|
59
|
+
* We have several ways to convert your files into XKT. See these tutorials for more info:
|
|
60
60
|
*
|
|
61
|
-
* * [Converting Models to XKT with convert2xkt](https://
|
|
61
|
+
* * [Converting Models to XKT with convert2xkt](https://xeokit.io/blog/converting-models-to-xkt-with-convert2xkt) - how to convert various file formats (glTF, IFC, CityJSON, LAS/LAZ...) to XKT using our nodejs-based converter.
|
|
62
62
|
* * [Converting IFC Models to XKT using 3rd-Party Open Source Tools](https://www.notion.so/xeokit/Converting-IFC-Models-to-XKT-using-3rd-Party-Open-Source-Tools-c373e48bc4094ff5b6e5c5700ff580ee) - how to convert IFC files to XKT using 3rd-party open source CLI tools.
|
|
63
63
|
*
|
|
64
64
|
* # Scene representation
|
|
@@ -93,7 +93,7 @@ parsers[ParserV12.version] = ParserV12;
|
|
|
93
93
|
* Since this model contains IFC types, the XKTLoaderPlugin will set the initial appearance of each object
|
|
94
94
|
* {@link Entity} according to its IFC type in {@link XKTLoaderPlugin#objectDefaults}.
|
|
95
95
|
*
|
|
96
|
-
* Read more about this example in the user guide on [Viewing BIM Models Offline](https://
|
|
96
|
+
* Read more about this example in the user guide on [Viewing BIM Models Offline](https://xeokit.io/blog/viewing-an-ifc-model-with-xktloaderplugin).
|
|
97
97
|
*
|
|
98
98
|
* * [[Run example](https://xeokit.github.io/xeokit-sdk/examples/index.html#BIMOffline_XKT_metadata_Schependomlaan)]
|
|
99
99
|
*
|
|
@@ -462,7 +462,7 @@ parsers[ParserV12.version] = ParserV12;
|
|
|
462
462
|
* into a xeokit Viewer in one load operation, combining the XKT files into a single SceneModel and MetaModel.
|
|
463
463
|
*
|
|
464
464
|
* You can learn more about this conversion and loading process, with splitting, batch converting and batch loading,
|
|
465
|
-
* in [this tutorial](https://
|
|
465
|
+
* in [this tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance).
|
|
466
466
|
*
|
|
467
467
|
* To show how to use XKTLoaderPlugin to load a manifest of XKT files, let's imagine that we have a set of such XKT files. As
|
|
468
468
|
* described in the tutorial, they were converted by `ifc2gltf` from an IFC file into a set of glTF+JSON files, that were
|
|
@@ -507,7 +507,7 @@ parsers[ParserV12.version] = ParserV12;
|
|
|
507
507
|
* TreeViewPlugin,
|
|
508
508
|
* } from "xeokit-sdk.es.js";
|
|
509
509
|
*
|
|
510
|
-
*
|
|
510
|
+
* const viewer = new Viewer({
|
|
511
511
|
* canvasId: "myCanvas"
|
|
512
512
|
* });
|
|
513
513
|
*
|
|
@@ -533,7 +533,7 @@ parsers[ParserV12.version] = ParserV12;
|
|
|
533
533
|
*
|
|
534
534
|
* The main advantage here, of splitting IFC files like this within the conversion and import pipeline,
|
|
535
535
|
* is to reduce the memory pressure on each of the `ifc2gltf`, `convert2xkt` and XKTLoaderPlugin components.
|
|
536
|
-
* They work much reliably (and faster) when processing smaller files (
|
|
536
|
+
* They work much reliably (and faster) when processing smaller files (e.g. 20MB) than when processing large files (e.g. 500MB), where
|
|
537
537
|
* they have less trouble allocating the system memory they need for conversion and parsing.
|
|
538
538
|
*
|
|
539
539
|
* We can also provide an HTTP URL to the manifest:
|
|
@@ -885,9 +885,9 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
885
885
|
* Loads an ````.xkt```` model into this XKTLoaderPlugin's {@link Viewer}.
|
|
886
886
|
*
|
|
887
887
|
* Since xeokit/xeokit-sdk 1.9.0, XKTLoaderPlugin has supported XKT 8, which bundles the metamodel
|
|
888
|
-
* data (
|
|
888
|
+
* data (e.g. an IFC element hierarchy) in the XKT file itself. For XKT 8, we therefore no longer need to
|
|
889
889
|
* load the metamodel data from a separate accompanying JSON file, as we did with previous XKT versions.
|
|
890
|
-
* However, if we do choose to specify a separate metamodel JSON file to load (
|
|
890
|
+
* However, if we do choose to specify a separate metamodel JSON file to load (e.g. for backward compatibility
|
|
891
891
|
* in data pipelines), then that metamodel will be loaded and the metamodel in the XKT 8 file will be ignored.
|
|
892
892
|
*
|
|
893
893
|
* @param {*} params Loading parameters.
|
|
@@ -897,9 +897,9 @@ class XKTLoaderPlugin extends Plugin {
|
|
|
897
897
|
* @param {String} [params.metaModelSrc] Path or URL to an optional metadata file, as an alternative to the ````metaModelData```` parameter.
|
|
898
898
|
* @param {*} [params.metaModelData] JSON model metadata, as an alternative to the ````metaModelSrc```` parameter.
|
|
899
899
|
* @param {String} [params.manifestSrc] Path or URL to a JSON manifest file that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
900
|
-
* multiple XKT files. See [tutorial](https://
|
|
900
|
+
* multiple XKT files. See [tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance) for more info.
|
|
901
901
|
* @param {Object} [params.manifest] A JSON manifest object (as an alternative to a path or URL) that provides paths to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into
|
|
902
|
-
* multiple XKT files. See [tutorial](https://
|
|
902
|
+
* multiple XKT files. See [tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance) for more info.
|
|
903
903
|
* @param {{String:Object}} [params.objectDefaults] Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.
|
|
904
904
|
* @param {String[]} [params.includeTypes] When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
|
|
905
905
|
* @param {String[]} [params.excludeTypes] When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject#type} values in this list.
|
|
@@ -648,7 +648,6 @@ export class VBOLayer extends Layer {
|
|
|
648
648
|
}
|
|
649
649
|
origVec[3] = 1;
|
|
650
650
|
const sceneModelMatrix = model.matrix;
|
|
651
|
-
math.mulMat4v4(sceneModelMatrix, origVec, origVec);
|
|
652
651
|
const positions = retainedGeometry.quantizedPositions;
|
|
653
652
|
const worldPos = tempVec4a;
|
|
654
653
|
for (let i = 0, len = positions.length; i < len; i += 3) {
|
|
@@ -660,8 +659,8 @@ export class VBOLayer extends Layer {
|
|
|
660
659
|
math.transformPoint3(retainedGeometry.matrix, worldPos, worldPos);
|
|
661
660
|
}
|
|
662
661
|
worldPos[3] = 1;
|
|
663
|
-
math.mulMat4v4(sceneModelMatrix, worldPos, worldPos);
|
|
664
662
|
math.addVec3(origVec, worldPos, worldPos);
|
|
663
|
+
math.mulMat4v4(sceneModelMatrix, worldPos, worldPos);
|
|
665
664
|
callback(worldPos);
|
|
666
665
|
}
|
|
667
666
|
}
|
|
@@ -52,9 +52,15 @@ class Curve extends Component {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
* Gets the length of this Curve.
|
|
55
|
+
* Gets the approximate length of this Curve.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
57
|
+
* This method calculates the length by discretizing Curve into hardcoded number of straight segments. Then it sums
|
|
58
|
+
* lengths of these straight segments.
|
|
59
|
+
*
|
|
60
|
+
* If you need more control over the precision of the length calculation, we strongly encourage you to build
|
|
61
|
+
* your own custom function.
|
|
62
|
+
*
|
|
63
|
+
* @returns {Number} The approximate Curve length.
|
|
58
64
|
*/
|
|
59
65
|
get length() {
|
|
60
66
|
var lengths = this._getLengths();
|
|
@@ -32,9 +32,9 @@ export declare type LoadXKTModel = {
|
|
|
32
32
|
metaModelSrc?: string;
|
|
33
33
|
/** JSON model metadata, as an alternative to the ````metaModelSrc```` parameter. */
|
|
34
34
|
metaModelData?: any;
|
|
35
|
-
/** Path or URL to a JSON manifest file that provides paths or URLs to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split
|
|
35
|
+
/** Path or URL to a JSON manifest file that provides paths or URLs to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into multiple XKT files. See [tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance) for more info.*/
|
|
36
36
|
manifestSrc?: any;
|
|
37
|
-
/** A JSON manifest object (as an alternative to a path or URL) that provides paths or URLs to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split
|
|
37
|
+
/** A JSON manifest object (as an alternative to a path or URL) that provides paths or URLs to ````.xkt```` files to load as parts of the model. Use this option to load models that have been split into multiple XKT files. See [tutorial](https://xeokit.io/blog/automatically-splitting-large-models-for-better-performance) for more info. */
|
|
38
38
|
manifest?: object;
|
|
39
39
|
/** Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}. */
|
|
40
40
|
objectDefaults?: object;
|
|
@@ -41,9 +41,15 @@ export declare class Curve extends Component {
|
|
|
41
41
|
get tangent(): number[];
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
* Gets the length of this Curve.
|
|
44
|
+
* Gets the approximate length of this Curve.
|
|
45
45
|
*
|
|
46
|
-
*
|
|
46
|
+
* This method calculates the length by discretizing Curve into hardcoded number of straight segments. Then it sums
|
|
47
|
+
* lengths of these straight segments.
|
|
48
|
+
*
|
|
49
|
+
* If you need more control over the precision of the length calculation, we strongly encourage you to build
|
|
50
|
+
* your own custom function.
|
|
51
|
+
*
|
|
52
|
+
* @returns {Number} The approximate Curve length.
|
|
47
53
|
*/
|
|
48
54
|
get length(): number;
|
|
49
55
|
|