@sequent-org/ifc-viewer 1.0.22000000001-ci.17.0 → 1.1.1-ci.20.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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sequent-org/ifc-viewer",
3
3
  "private": false,
4
- "version": "1.0.22000000001-ci.17.0",
4
+ "version": "1.1.1-ci.20.0",
5
5
  "type": "module",
6
6
  "description": "IFC 3D model viewer component for web applications",
7
7
  "main": "src/index.js",
@@ -13,7 +13,8 @@
13
13
  },
14
14
  "files": [
15
15
  "src/",
16
- "README.md"
16
+ "README.md",
17
+ "patches/"
17
18
  ],
18
19
  "keywords": [
19
20
  "ifc",
@@ -34,10 +35,12 @@
34
35
  "dev": "vite",
35
36
  "build": "vite build",
36
37
  "preview": "vite preview",
37
- "test:manual": "vite dev --open test.html"
38
+ "test:manual": "vite dev --open test.html",
39
+ "postinstall": "patch-package"
38
40
  },
39
41
  "devDependencies": {
40
- "vite": "^7.1.2"
42
+ "vite": "^7.1.2",
43
+ "patch-package": "^8.0.0"
41
44
  },
42
45
  "dependencies": {
43
46
  "three": "^0.149.0",
@@ -0,0 +1,27 @@
1
+ diff --git a/node_modules/web-ifc-three/IFCLoader.js b/node_modules/web-ifc-three/IFCLoader.js
2
+ index 1e86ae7..6ad6212 100644
3
+ --- a/node_modules/web-ifc-three/IFCLoader.js
4
+ +++ b/node_modules/web-ifc-three/IFCLoader.js
5
+ @@ -1,7 +1,7 @@
6
+ import * as WebIFC from 'web-ifc';
7
+ import { IFCSPACE, IFCOPENINGELEMENT, IFCPRODUCTDEFINITIONSHAPE, IFCRELAGGREGATES, IFCRELCONTAINEDINSPATIALSTRUCTURE, IFCRELDEFINESBYPROPERTIES, IFCRELASSOCIATESMATERIAL, IFCRELDEFINESBYTYPE, IFCPROJECT, IFCBUILDING } from 'web-ifc';
8
+ import { Mesh, Color, MeshLambertMaterial, DoubleSide, Matrix4, BufferGeometry, BufferAttribute, Loader, FileLoader } from 'three';
9
+ -import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils';
10
+ +import { mergeBufferGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
11
+
12
+ const nullIfcManagerErrorMessage = 'IfcManager is null!';
13
+
14
+ @@ -171,11 +171,11 @@ class IFCParser {
15
+ const materials = [];
16
+ Object.keys(this.geometriesByMaterials).forEach((key) => {
17
+ const geometriesByMaterial = this.geometriesByMaterials[key].geometries;
18
+ - const merged = mergeGeometries(geometriesByMaterial);
19
+ + const merged = mergeBufferGeometries(geometriesByMaterial);
20
+ materials.push(this.geometriesByMaterials[key].material);
21
+ geometries.push(merged);
22
+ });
23
+ - const combinedGeometry = mergeGeometries(geometries, true);
24
+ + const combinedGeometry = mergeBufferGeometries(geometries, true);
25
+ this.cleanUpGeometryMemory(geometries);
26
+ if (this.BVH)
27
+ this.BVH.applyThreeMeshBVH(combinedGeometry);
@@ -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) {
@@ -74,7 +82,12 @@ try {
74
82
  if (typeof import.meta !== 'undefined' && import.meta.glob) {
75
83
  // Для Vite - патчим через Promise
76
84
  import('three/examples/jsm/utils/BufferGeometryUtils.js').then(utilsModule => {
77
- if (utilsModule && !utilsModule.mergeGeometries) {
85
+ if (utilsModule) {
86
+ // Добавляем mergeGeometries как алиас для mergeBufferGeometries
87
+ if (!utilsModule.mergeGeometries) {
88
+ utilsModule.mergeGeometries = mergeBufferGeometries;
89
+ }
90
+ // Также добавляем наш совместимый патч
78
91
  utilsModule.mergeGeometries = mergeGeometries;
79
92
  console.log('✅ Three.js патч: mergeGeometries добавлен в BufferGeometryUtils модуль');
80
93
  }
@@ -83,6 +96,22 @@ try {
83
96
  console.warn('Three.js патч: не удалось загрузить BufferGeometryUtils модуль:', e.message);
84
97
  });
85
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
+ };
114
+ }
86
115
 
87
116
  console.log('✅ Three.js патч: BufferGeometryUtils готов для web-ifc-three');
88
117
  } catch (error) {