@xeokit/xeokit-sdk 2.6.99 → 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.
- package/dist/xeokit-sdk.cjs.js +37944 -52035
- package/dist/xeokit-sdk.es.js +37945 -52032
- package/dist/xeokit-sdk.es5.js +29439 -28307
- package/dist/xeokit-sdk.min.cjs.js +9 -8
- package/dist/xeokit-sdk.min.es.js +9 -8
- package/dist/xeokit-sdk.min.es5.js +19 -37
- package/package.json +13 -6
- package/src/plugins/CxConverterIFCLoaderPlugin/CxConverterIFCLoaderPlugin.js +81 -92
- package/src/plugins/CxConverterIFCLoaderPlugin/index.js +1 -1
- package/src/plugins/LASLoaderPlugin/LASLoaderPlugin.js +628 -628
- package/src/plugins/LASLoaderPlugin/index.js +1 -1
- package/src/plugins/NavCubePlugin/NavCubePlugin.js +1 -0
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV1.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV10.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV12.js +9 -9
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV2.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV3.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV4.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV5.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV6.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV7.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV8.js +5 -5
- package/src/plugins/XKTLoaderPlugin/parsers/ParserV9.js +5 -5
- package/src/plugins/index.js +2 -3
- package/src/viewer/scene/materials/Texture.js +2 -0
- package/src/viewer/scene/math/math.js +48 -2
- package/src/viewer/scene/webgl/Texture2D.js +7 -0
- package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +26 -108
- package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +3 -14
- package/types/plugins/DotBIMLoaderPlugin/DotBIMLoaderPlugin.d.ts +5 -23
- package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +5 -25
- package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +20 -100
- package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +3 -14
- package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +18 -83
- package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +21 -106
- package/types/viewer/Configs.d.ts +6 -24
- package/types/viewer/scene/CameraControl/CameraControl.d.ts +67 -446
- package/types/viewer/scene/Component.d.ts +1 -1
- package/types/viewer/scene/Entity.d.ts +40 -186
- package/types/viewer/scene/camera/Camera.d.ts +50 -170
- package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +8 -57
- package/types/viewer/scene/camera/CameraPath.d.ts +8 -13
- package/types/viewer/scene/camera/CameraPathAnimation.d.ts +4 -22
- package/types/viewer/scene/camera/CustomProjection.d.ts +6 -21
- package/types/viewer/scene/camera/Frustum.d.ts +18 -90
- package/types/viewer/scene/camera/Ortho.d.ts +14 -54
- package/types/viewer/scene/camera/Perspective.d.ts +16 -70
- package/types/viewer/scene/geometry/ReadableGeometry.d.ts +21 -25
- package/types/viewer/scene/geometry/VBOGeometry.d.ts +7 -7
- package/types/viewer/scene/lights/AmbientLight.d.ts +4 -26
- package/types/viewer/scene/lights/DirLight.d.ts +8 -52
- package/types/viewer/scene/lights/PointLight.d.ts +14 -93
- package/types/viewer/scene/materials/EdgeMaterial.d.ts +12 -37
- package/types/viewer/scene/materials/EmphasisMaterial.d.ts +22 -119
- package/types/viewer/scene/materials/Fresnel.d.ts +10 -50
- package/types/viewer/scene/materials/LambertMaterial.d.ts +16 -90
- package/types/viewer/scene/materials/LinesMaterial.d.ts +7 -25
- package/types/viewer/scene/materials/MetallicMaterial.d.ts +40 -127
- package/types/viewer/scene/materials/PhongMaterial.d.ts +52 -185
- package/types/viewer/scene/materials/PointsMaterial.d.ts +20 -101
- package/types/viewer/scene/materials/SpecularMaterial.d.ts +41 -117
- package/types/viewer/scene/materials/Texture.d.ts +24 -62
- package/types/viewer/scene/models/SceneModel.d.ts +76 -233
- package/types/viewer/scene/models/SceneModelEntity.d.ts +50 -211
- package/types/viewer/scene/models/SceneModelMesh.d.ts +4 -4
- package/types/viewer/scene/models/SceneModelTransform.d.ts +14 -59
- package/types/viewer/scene/paths/CubicBezierCurve.d.ts +12 -73
- package/types/viewer/scene/paths/Curve.d.ts +6 -19
- package/types/viewer/scene/paths/Path.d.ts +10 -57
- package/types/viewer/scene/paths/QuadraticBezierCurve.d.ts +10 -57
- package/types/viewer/scene/paths/SplineCurve.d.ts +6 -32
- package/types/viewer/scene/scene/Scene.d.ts +94 -196
- package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +12 -69
- package/types/viewer/scene/viewport/Viewport.d.ts +4 -14
- 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.
|
|
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
|
|
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.
|
|
56
|
-
"@loaders.gl/gltf": "4.3.
|
|
57
|
-
"@loaders.gl/las": "4.3.
|
|
58
|
-
"
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
async function fetchFile(url) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
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";
|