@sequent-org/ifc-viewer 1.0.21-ci.15.0 → 1.0.22000000001-ci.17.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
CHANGED
|
@@ -70,6 +70,20 @@ try {
|
|
|
70
70
|
globalThis.__THREE_BUFFER_GEOMETRY_UTILS_PATCH__ = patchedUtils;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// Патчим модуль BufferGeometryUtils через Promise (без top-level await)
|
|
74
|
+
if (typeof import.meta !== 'undefined' && import.meta.glob) {
|
|
75
|
+
// Для Vite - патчим через Promise
|
|
76
|
+
import('three/examples/jsm/utils/BufferGeometryUtils.js').then(utilsModule => {
|
|
77
|
+
if (utilsModule && !utilsModule.mergeGeometries) {
|
|
78
|
+
utilsModule.mergeGeometries = mergeGeometries;
|
|
79
|
+
console.log('✅ Three.js патч: mergeGeometries добавлен в BufferGeometryUtils модуль');
|
|
80
|
+
}
|
|
81
|
+
}).catch(e => {
|
|
82
|
+
// Игнорируем ошибки импорта
|
|
83
|
+
console.warn('Three.js патч: не удалось загрузить BufferGeometryUtils модуль:', e.message);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
73
87
|
console.log('✅ Three.js патч: BufferGeometryUtils готов для web-ifc-three');
|
|
74
88
|
} catch (error) {
|
|
75
89
|
console.warn('Three.js патч: ошибка при создании патча:', error.message);
|
package/src/ifc/IfcService.js
CHANGED
|
@@ -5,7 +5,8 @@ import { IFCLoader } from "web-ifc-three/IFCLoader.js";
|
|
|
5
5
|
// Примечание: IFCWorker не используется, так как мы отключаем Web Workers
|
|
6
6
|
// для стабильности работы в различных окружениях
|
|
7
7
|
|
|
8
|
-
//
|
|
8
|
+
// Применяем патч совместимости сразу при импорте
|
|
9
|
+
import '../compat/three-compat-patch.js';
|
|
9
10
|
|
|
10
11
|
export class IfcService {
|
|
11
12
|
/**
|
|
@@ -41,9 +42,6 @@ export class IfcService {
|
|
|
41
42
|
// Настройка конфигурации web-ifc
|
|
42
43
|
this._setupWebIfcConfig();
|
|
43
44
|
|
|
44
|
-
// Применяем патч совместимости Three.js после успешной инициализации
|
|
45
|
-
this._applyThreeJsPatch();
|
|
46
|
-
|
|
47
45
|
} catch (error) {
|
|
48
46
|
console.error('IfcService: критическая ошибка инициализации:', error);
|
|
49
47
|
this._handleCriticalError(error);
|
|
@@ -113,22 +111,6 @@ export class IfcService {
|
|
|
113
111
|
}
|
|
114
112
|
}
|
|
115
113
|
|
|
116
|
-
/**
|
|
117
|
-
* Применяет патч совместимости для Three.js 0.149+
|
|
118
|
-
* @private
|
|
119
|
-
*/
|
|
120
|
-
_applyThreeJsPatch() {
|
|
121
|
-
try {
|
|
122
|
-
// Динамически импортируем патч совместимости
|
|
123
|
-
import('../compat/three-compat-patch.js').then(() => {
|
|
124
|
-
console.log('✅ IfcService: Патч совместимости Three.js применен');
|
|
125
|
-
}).catch(error => {
|
|
126
|
-
console.warn('IfcService: не удалось применить патч совместимости:', error.message);
|
|
127
|
-
});
|
|
128
|
-
} catch (error) {
|
|
129
|
-
console.warn('IfcService: ошибка при применении патча совместимости:', error.message);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
114
|
|
|
133
115
|
/**
|
|
134
116
|
* Обработка критических ошибок инициализации
|