@xeokit/xeokit-sdk 2.6.98 → 2.6.100-rc1-no-las

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/xeokit-sdk.cjs.js +37947 -52036
  2. package/dist/xeokit-sdk.es.js +37948 -52033
  3. package/dist/xeokit-sdk.es5.js +29439 -28306
  4. package/dist/xeokit-sdk.min.cjs.js +9 -8
  5. package/dist/xeokit-sdk.min.es.js +9 -8
  6. package/dist/xeokit-sdk.min.es5.js +19 -37
  7. package/package.json +13 -6
  8. package/src/plugins/CxConverterIFCLoaderPlugin/CxConverterIFCLoaderPlugin.js +81 -92
  9. package/src/plugins/CxConverterIFCLoaderPlugin/index.js +1 -1
  10. package/src/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.js +1 -0
  11. package/src/plugins/GLTFLoaderPlugin/GLTFSceneModelLoader.js +1 -0
  12. package/src/plugins/LASLoaderPlugin/LASLoaderPlugin.js +628 -628
  13. package/src/plugins/LASLoaderPlugin/index.js +1 -1
  14. package/src/plugins/NavCubePlugin/NavCubePlugin.js +1 -0
  15. package/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +5 -5
  16. package/src/plugins/XKTLoaderPlugin/parsers/ParserV10.js +5 -5
  17. package/src/plugins/XKTLoaderPlugin/parsers/ParserV12.js +9 -9
  18. package/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +5 -5
  19. package/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +5 -5
  20. package/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +5 -5
  21. package/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +5 -5
  22. package/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +5 -5
  23. package/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +5 -5
  24. package/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +5 -5
  25. package/src/plugins/XKTLoaderPlugin/parsers/ParserV9.js +5 -5
  26. package/src/plugins/index.js +2 -3
  27. package/src/viewer/scene/materials/Texture.js +2 -0
  28. package/src/viewer/scene/math/math.js +48 -2
  29. package/src/viewer/scene/webgl/Texture2D.js +7 -0
  30. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +26 -108
  31. package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +3 -14
  32. package/types/plugins/DotBIMLoaderPlugin/DotBIMLoaderPlugin.d.ts +5 -23
  33. package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +7 -25
  34. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +20 -100
  35. package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +3 -14
  36. package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +18 -83
  37. package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +21 -106
  38. package/types/viewer/Configs.d.ts +6 -24
  39. package/types/viewer/scene/CameraControl/CameraControl.d.ts +67 -446
  40. package/types/viewer/scene/Component.d.ts +1 -1
  41. package/types/viewer/scene/Entity.d.ts +40 -186
  42. package/types/viewer/scene/camera/Camera.d.ts +50 -170
  43. package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +8 -57
  44. package/types/viewer/scene/camera/CameraPath.d.ts +8 -13
  45. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +4 -22
  46. package/types/viewer/scene/camera/CustomProjection.d.ts +6 -21
  47. package/types/viewer/scene/camera/Frustum.d.ts +18 -90
  48. package/types/viewer/scene/camera/Ortho.d.ts +14 -54
  49. package/types/viewer/scene/camera/Perspective.d.ts +16 -70
  50. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +21 -25
  51. package/types/viewer/scene/geometry/VBOGeometry.d.ts +7 -7
  52. package/types/viewer/scene/lights/AmbientLight.d.ts +4 -26
  53. package/types/viewer/scene/lights/DirLight.d.ts +8 -52
  54. package/types/viewer/scene/lights/PointLight.d.ts +14 -93
  55. package/types/viewer/scene/materials/EdgeMaterial.d.ts +12 -37
  56. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +22 -119
  57. package/types/viewer/scene/materials/Fresnel.d.ts +10 -50
  58. package/types/viewer/scene/materials/LambertMaterial.d.ts +16 -90
  59. package/types/viewer/scene/materials/LinesMaterial.d.ts +7 -25
  60. package/types/viewer/scene/materials/MetallicMaterial.d.ts +40 -127
  61. package/types/viewer/scene/materials/PhongMaterial.d.ts +52 -185
  62. package/types/viewer/scene/materials/PointsMaterial.d.ts +20 -101
  63. package/types/viewer/scene/materials/SpecularMaterial.d.ts +41 -117
  64. package/types/viewer/scene/materials/Texture.d.ts +24 -62
  65. package/types/viewer/scene/models/SceneModel.d.ts +76 -233
  66. package/types/viewer/scene/models/SceneModelEntity.d.ts +50 -211
  67. package/types/viewer/scene/models/SceneModelMesh.d.ts +4 -4
  68. package/types/viewer/scene/models/SceneModelTransform.d.ts +14 -59
  69. package/types/viewer/scene/paths/CubicBezierCurve.d.ts +12 -73
  70. package/types/viewer/scene/paths/Curve.d.ts +6 -19
  71. package/types/viewer/scene/paths/Path.d.ts +10 -57
  72. package/types/viewer/scene/paths/QuadraticBezierCurve.d.ts +10 -57
  73. package/types/viewer/scene/paths/SplineCurve.d.ts +6 -32
  74. package/types/viewer/scene/scene/Scene.d.ts +94 -196
  75. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +12 -69
  76. package/types/viewer/scene/viewport/Viewport.d.ts +4 -14
  77. package/types/viewer/scene/webgl/PickResult.d.ts +13 -28
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@xeokit/xeokit-sdk",
3
- "version": "2.6.98",
3
+ "version": "2.6.100-rc1-no-las",
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",
7
7
  "types": "./types/index.d.ts",
8
8
  "scripts": {
9
- "build": "rollup --config rollup.config.js; rollup --config rollup.minified.config.js",
9
+ "build": "rollup --config rollup.config.js",
10
10
  "dev-build": "rollup --config rollup.dev.config.js",
11
11
  "docs": "rm -Rf ./docs/*; ./node_modules/.bin/esdoc",
12
12
  "typedocs": "rm -Rf ./docs/*; typedoc --tsconfig tsconfig.json",
@@ -52,10 +52,16 @@
52
52
  },
53
53
  "homepage": "https://xeokit.io",
54
54
  "dependencies": {
55
- "@loaders.gl/core": "4.3.4",
56
- "@loaders.gl/gltf": "4.3.4",
57
- "@loaders.gl/las": "4.3.4",
58
- "html2canvas": "1.4.1"
55
+ "@loaders.gl/core": "^4.3.3",
56
+ "@loaders.gl/gltf": "^4.3.3",
57
+ "@loaders.gl/las": "^4.3.3",
58
+ "@rollup/plugin-replace": "^6.0.2",
59
+ "core-js": "^3.42.0",
60
+ "@rollup/plugin-replace": "^6.0.2",
61
+ "core-js": "^3.42.0",
62
+ "html2canvas": "^1.4.1",
63
+ "pako": "^2.1.0",
64
+ "pako": "^2.1.0"
59
65
  },
60
66
  "devDependencies": {
61
67
  "@babel/core": "^7.18.6",
@@ -64,6 +70,7 @@
64
70
  "@percy/playwright": "^1.0.7",
65
71
  "@playwright/test": "^1.49.1",
66
72
  "@rollup/plugin-babel": "^5.3.1",
73
+ "@rollup/plugin-commonjs": "^28.0.3",
67
74
  "@rollup/plugin-node-resolve": "^13.2.1",
68
75
  "@types/node": "^22.10.6",
69
76
  "auto-changelog": "^2.4.0",
@@ -1,97 +1,86 @@
1
- import { Plugin } from "../../viewer/Plugin.js";
2
- import { GLTFLoaderPlugin } from "../GLTFLoaderPlugin/GLTFLoaderPlugin.js";
1
+ // import { Plugin } from "../../viewer/Plugin.js";
2
+ // import { GLTFLoaderPlugin } from "../GLTFLoaderPlugin/GLTFLoaderPlugin.js";
3
+ // import { ifc2gltf } from "@creooxag/cxconverter";
3
4
 
4
- /**
5
- * Fetches a file from the given URL and returns its contents as text.
6
- *
7
- * @param {string} url - The URL to fetch the file from.
8
- * @returns {Promise<string>} A promise that resolves to the file contents.
9
- * @private
10
- */
11
- async function fetchFile(url) {
12
- try {
13
- const response = await fetch(url);
14
- if (!response.ok) {
15
- throw new Error(`HTTP error! Status: ${response.status}`);
16
- }
17
- return response.text();
18
- } catch (error) {
19
- console.error('Error fetching file:', error);
20
- }
21
- }
5
+ // /**
6
+ // * Fetches a file from the given URL and returns its contents as text.
7
+ // *
8
+ // * @param {string} url - The URL to fetch the file from.
9
+ // * @returns {Promise<string>} A promise that resolves to the file contents.
10
+ // * @private
11
+ // */
12
+ // async function fetchFile(url) {
13
+ // try {
14
+ // const response = await fetch(url);
15
+ // if (!response.ok) {
16
+ // throw new Error(`HTTP error! Status: ${response.status}`);
17
+ // }
18
+ // return response.text();
19
+ // } catch (error) {
20
+ // console.error('Error fetching file:', error);
21
+ // }
22
+ // }
22
23
 
23
- /**
24
- * {@link Viewer} plugin that uses [CxConverter](https://github.com/Creoox/cxconverter) to load BIM models directly from IFC files, using its WebAssembly buid from [npm package](https://www.npmjs.com/package/@creooxag/cxconverter).
25
- *
26
- * ## Overview
27
- * The WebAssembly build of CxConverter is still in alfa stage, so it may not work as expected. This documentation will be updated as the library and the plugin evolve. The example below shows how to use the plugin:
28
- * ````javascript
29
- * import { CxConverterIFCLoaderPlugin, Viewer } from "../../dist/xeokit-sdk.es.js";
30
- * const cxConverterIFCLoaderPlugin = new CxConverterIFCLoaderPlugin(viewer);
31
- *
32
- * const sceneModel = await cxConverterIFCLoaderPlugin.load({
33
- * src: "../../assets/models/ifc/Duplex.ifc"
34
- * });
35
- * ````
36
- See the code in action [here](https://xeokit.github.io/xeokit-sdk/examples/buildings/#cxConverterIFC_vbo_Duplex).
37
- */
24
+ // /**
25
+ // * {@link Viewer} plugin that uses [CxConverter](https://github.com/Creoox/cxconverter) to load BIM models directly from IFC files, using its WebAssembly buid from [npm package](https://www.npmjs.com/package/@creooxag/cx-converter).
26
+ // *
27
+ // * ## Overview
28
+ // * The WebAssembly build of CxConverter is still in alfa stage, so it may not work as expected. This documentation will be updated as the library and the plugin evolve. The example below shows how to use the plugin:
29
+ // * ````javascript
30
+ // * import { CxConverterIFCLoaderPlugin, Viewer } from "../../dist/xeokit-sdk.es.js";
31
+ // * const cxConverterIFCLoaderPlugin = new CxConverterIFCLoaderPlugin(viewer);
32
+ // *
33
+ // * const sceneModel = await cxConverterIFCLoaderPlugin.load({
34
+ // * src: "../../assets/models/ifc/Duplex.ifc"
35
+ // * });
36
+ // * ````
37
+ // See the code in action [here](https://xeokit.github.io/xeokit-sdk/examples/buildings/#cxConverterIFC_vbo_Duplex).
38
+ // */
38
39
 
39
- class CxConverterIFCLoaderPlugin extends Plugin {
40
- /**
41
- * @constructor
42
- * @param {Viewer} viewer The Viewer.
43
- * @param {Object} [cfg={}] Plugin configuration.
44
- */
45
- constructor(viewer, cfg = {}) {
46
- super("ifcLoader", viewer, cfg);
40
+ // class CxConverterIFCLoaderPlugin extends Plugin {
41
+ // /**
42
+ // * @constructor
43
+ // * @param {Viewer} viewer The Viewer.
44
+ // * @param {Object} [cfg={}] Plugin configuration.
45
+ // */
46
+ // constructor(viewer, cfg = {}) {
47
+ // super("ifcLoader", viewer, cfg);
47
48
 
48
- /**
49
- * The GLTFLoaderPlugin used internally to load the converted GLTF.
50
- * @type {GLTFLoaderPlugin}
51
- */
52
- this.gltfLoader = new GLTFLoaderPlugin(this.viewer);
53
- this.cxConverterModule = null;
54
- }
49
+ // /**
50
+ // * The GLTFLoaderPlugin used internally to load the converted GLTF.
51
+ // * @type {GLTFLoaderPlugin}
52
+ // */
53
+ // this.gltfLoader = new GLTFLoaderPlugin(this.viewer);
54
+ // }
55
55
 
56
- /**
57
- * Sets the CxConverter module to be used by this plugin.
58
- * @param {Object} module The CxConverter module.
59
- */
60
- setCxConverterModule(module) {
61
- this.cxConverterModule = module;
62
- }
63
-
64
- /**
65
- * Loads an IFC model from the given source.
66
- *
67
- * @param {Object} [params={}] Loading parameters.
68
- * @param {string} params.src Path to an IFC file.
69
- * @param {Function} [params.progressCallback] Callback to track loading progress.
70
- * @param {Function} [params.progressTextCallback] Callback to track loading progress with text updates.
71
- * @returns {Promise<SceneModel>} A promise that resolves to the loaded SceneModel.
72
- */
73
- async load(params = {}) {
74
- if (!this.cxConverterModule) {
75
- throw new Error("CxConverter module is not set. Use setCxConverterModule() to set it.");
76
- }
77
- if (!params.src) {
78
- this.error("load() param expected: src");
79
- }
80
- const data = await fetchFile(params.src);
81
- const { gltf, metaData } = await this.cxConverterModule.ifc2gltf(
82
- data,
83
- {
84
- remote: true,
85
- progressCallback: params.progressCallback,
86
- progressTextCallback: params.progressTextCallback
87
- }
88
- );
89
- const sceneModel = this.gltfLoader.load({
90
- id: "myModel",
91
- gltf: gltf,
92
- metaModelJSON: metaData
93
- });
94
- return sceneModel;
95
- }
96
- }
97
- export { CxConverterIFCLoaderPlugin };
56
+ // /**
57
+ // * Loads an IFC model from the given source.
58
+ // *
59
+ // * @param {Object} [params={}] Loading parameters.
60
+ // * @param {string} params.src Path to an IFC file.
61
+ // * @param {Function} [params.progressCallback] Callback to track loading progress.
62
+ // * @param {Function} [params.progressTextCallback] Callback to track loading progress with text updates.
63
+ // * @returns {Promise<SceneModel>} A promise that resolves to the loaded SceneModel.
64
+ // */
65
+ // async load(params = {}) {
66
+ // if (!params.src) {
67
+ // this.error("load() param expected: src");
68
+ // }
69
+ // const data = await fetchFile(params.src);
70
+ // const { gltf, metaData } = await ifc2gltf(
71
+ // data,
72
+ // {
73
+ // remote: true,
74
+ // progressCallback: params.progressCallback,
75
+ // progressTextCallback: params.progressTextCallback
76
+ // }
77
+ // );
78
+ // const sceneModel = this.gltfLoader.load({
79
+ // id: "myModel",
80
+ // gltf: gltf,
81
+ // metaModelJSON: metaData
82
+ // });
83
+ // return sceneModel;
84
+ // }
85
+ // }
86
+ // export { CxConverterIFCLoaderPlugin };
@@ -1 +1 @@
1
- export * from "./CxConverterIFCLoaderPlugin.js";
1
+ // export * from "./CxConverterIFCLoaderPlugin.js";
@@ -323,6 +323,7 @@ class GLTFLoaderPlugin extends Plugin {
323
323
  * primitives. Only works while {@link DTX#enabled} is also ````true````.
324
324
  * @param {Boolean} [params.autoMetaModel] When supplied, creates a default MetaModel with a single MetaObject.
325
325
  * @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.
326
+ * @param {*} [params.parseOptions={}] Options to pass to loaders.gl parse method, eg. ````{ gltf: { excludeExtensions: { "KHR_texture_transform": false } } }````.
326
327
  * @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}
327
328
  */
328
329
  load(params = {}) {
@@ -102,6 +102,7 @@ function parseGLTF(plugin, src, gltf, metaModelJSON, options, sceneModel, ok, er
102
102
  const spinner = plugin.viewer.scene.canvas.spinner;
103
103
  spinner.processes++;
104
104
  parse(gltf, GLTFLoader, {
105
+ ...(options.parseOptions || { }),
105
106
  baseUri: options.basePath
106
107
  }).then((gltfData) => {
107
108
  const processedGLTF = postProcessGLTF(gltfData);