@sequent-org/ifc-viewer 1.0.10000001-ci.16.0 → 1.0.23000000000001-ci.18.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
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
import * as THREE from 'three';
|
|
5
5
|
import { mergeBufferGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
|
|
6
6
|
|
|
7
|
+
// Создаем патч для модуля BufferGeometryUtils
|
|
8
|
+
const originalBufferGeometryUtils = {
|
|
9
|
+
mergeBufferGeometries: mergeBufferGeometries
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// Добавляем mergeGeometries как алиас для mergeBufferGeometries
|
|
13
|
+
originalBufferGeometryUtils.mergeGeometries = mergeBufferGeometries;
|
|
14
|
+
|
|
7
15
|
// Создаем совместимую функцию mergeGeometries
|
|
8
16
|
function createMergeGeometries() {
|
|
9
17
|
return function mergeGeometries(geometries, useGroups = false) {
|
|
@@ -70,17 +78,39 @@ try {
|
|
|
70
78
|
globalThis.__THREE_BUFFER_GEOMETRY_UTILS_PATCH__ = patchedUtils;
|
|
71
79
|
}
|
|
72
80
|
|
|
73
|
-
// Патчим модуль BufferGeometryUtils через
|
|
81
|
+
// Патчим модуль BufferGeometryUtils через Promise (без top-level await)
|
|
74
82
|
if (typeof import.meta !== 'undefined' && import.meta.glob) {
|
|
75
|
-
// Для Vite - патчим через
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
// Для Vite - патчим через Promise
|
|
84
|
+
import('three/examples/jsm/utils/BufferGeometryUtils.js').then(utilsModule => {
|
|
85
|
+
if (utilsModule) {
|
|
86
|
+
// Добавляем mergeGeometries как алиас для mergeBufferGeometries
|
|
87
|
+
if (!utilsModule.mergeGeometries) {
|
|
88
|
+
utilsModule.mergeGeometries = mergeBufferGeometries;
|
|
89
|
+
}
|
|
90
|
+
// Также добавляем наш совместимый патч
|
|
79
91
|
utilsModule.mergeGeometries = mergeGeometries;
|
|
92
|
+
console.log('✅ Three.js патч: mergeGeometries добавлен в BufferGeometryUtils модуль');
|
|
80
93
|
}
|
|
81
|
-
}
|
|
94
|
+
}).catch(e => {
|
|
82
95
|
// Игнорируем ошибки импорта
|
|
83
|
-
|
|
96
|
+
console.warn('Three.js патч: не удалось загрузить BufferGeometryUtils модуль:', e.message);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// Патчим глобальный импорт для web-ifc-three
|
|
101
|
+
if (typeof globalThis !== 'undefined') {
|
|
102
|
+
// Создаем глобальный патч для импорта
|
|
103
|
+
globalThis.__THREE_BUFFER_GEOMETRY_UTILS__ = originalBufferGeometryUtils;
|
|
104
|
+
|
|
105
|
+
// Патчим возможные импорты web-ifc-three
|
|
106
|
+
const originalImport = globalThis.import || (() => {});
|
|
107
|
+
globalThis.import = function(module) {
|
|
108
|
+
if (module === 'three/examples/jsm/utils/BufferGeometryUtils' ||
|
|
109
|
+
module === 'three/examples/jsm/utils/BufferGeometryUtils.js') {
|
|
110
|
+
return Promise.resolve(originalBufferGeometryUtils);
|
|
111
|
+
}
|
|
112
|
+
return originalImport(module);
|
|
113
|
+
};
|
|
84
114
|
}
|
|
85
115
|
|
|
86
116
|
console.log('✅ Three.js патч: BufferGeometryUtils готов для web-ifc-three');
|