@sequent-org/ifc-viewer 1.0.14-ci.13.0 → 1.0.21-ci.15.0
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/package.json +2 -3
- package/src/IfcViewer.js +12 -0
- package/src/compat/three-compat-patch.js +18 -0
- package/src/ifc/IfcService.js +1 -1
- package/src/index.js +3 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sequent-org/ifc-viewer",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.21-ci.15.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "IFC 3D model viewer component for web applications",
|
|
7
7
|
"main": "src/index.js",
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"exports": {
|
|
10
10
|
".": {
|
|
11
11
|
"import": "./src/index.js"
|
|
12
|
-
}
|
|
13
|
-
"./style.css": "./src/style.css"
|
|
12
|
+
}
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"src/",
|
package/src/IfcViewer.js
CHANGED
|
@@ -14,6 +14,18 @@ import { Viewer } from "./viewer/Viewer.js";
|
|
|
14
14
|
import { IfcService } from "./ifc/IfcService.js";
|
|
15
15
|
import { IfcTreeView } from "./ifc/IfcTreeView.js";
|
|
16
16
|
|
|
17
|
+
// Загружаем стили при импорте IfcViewer
|
|
18
|
+
if (typeof window !== 'undefined' && !document.querySelector('style[data-ifc-viewer]')) {
|
|
19
|
+
import('./style.css').then(() => {
|
|
20
|
+
// Добавляем маркер, что стили загружены
|
|
21
|
+
const style = document.createElement('style');
|
|
22
|
+
style.setAttribute('data-ifc-viewer', 'loaded');
|
|
23
|
+
document.head.appendChild(style);
|
|
24
|
+
}).catch(error => {
|
|
25
|
+
console.warn('IfcViewer: не удалось загрузить стили:', error.message);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
|
|
17
29
|
export class IfcViewer {
|
|
18
30
|
/**
|
|
19
31
|
* Создаёт новый экземпляр IfcViewer
|
|
@@ -56,3 +56,21 @@ if (typeof window !== 'undefined' && window.THREE) {
|
|
|
56
56
|
console.warn('Three.js патч: не удалось применить к глобальному THREE:', error.message);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
+
|
|
60
|
+
// Патчим модуль BufferGeometryUtils напрямую для web-ifc-three
|
|
61
|
+
try {
|
|
62
|
+
// Создаем объект с обеими функциями для совместимости
|
|
63
|
+
const patchedUtils = {
|
|
64
|
+
mergeGeometries: mergeGeometries,
|
|
65
|
+
mergeBufferGeometries: mergeBufferGeometries
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
// Экспортируем для возможного использования другими модулями
|
|
69
|
+
if (typeof globalThis !== 'undefined') {
|
|
70
|
+
globalThis.__THREE_BUFFER_GEOMETRY_UTILS_PATCH__ = patchedUtils;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
console.log('✅ Three.js патч: BufferGeometryUtils готов для web-ifc-three');
|
|
74
|
+
} catch (error) {
|
|
75
|
+
console.warn('Three.js патч: ошибка при создании патча:', error.message);
|
|
76
|
+
}
|
package/src/ifc/IfcService.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Сервис загрузки IFC моделей и добавления их в сцену three.js
|
|
2
2
|
// Требует three@^0.149 и web-ifc-three совместимой версии
|
|
3
3
|
|
|
4
|
-
import { IFCLoader } from "web-ifc-three/IFCLoader";
|
|
4
|
+
import { IFCLoader } from "web-ifc-three/IFCLoader.js";
|
|
5
5
|
// Примечание: IFCWorker не используется, так как мы отключаем Web Workers
|
|
6
6
|
// для стабильности работы в различных окружениях
|
|
7
7
|
|
package/src/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// Основная точка входа пакета @sequent-org/ifc-viewer
|
|
2
2
|
// Автоматически подключает стили и экспортирует API
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
|
|
4
|
+
// CSS импорт закомментирован для совместимости с Node.js
|
|
5
|
+
// Стили загружаются автоматически через IfcViewer.js
|
|
6
|
+
// import './style.css';
|
|
6
7
|
|
|
7
8
|
// Экспортируем основной класс
|
|
8
9
|
export { IfcViewer } from "./IfcViewer.js";
|