@sequent-org/ifc-viewer 1.2.2-ci.21.0 → 1.2.4-ci.23.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.2.2-ci.21.0",
4
+ "version": "1.2.4-ci.23.0",
5
5
  "type": "module",
6
6
  "description": "IFC 3D model viewer component for web applications - fully self-contained with local IFCLoader",
7
7
  "main": "src/index.js",
package/src/IfcViewer.js CHANGED
@@ -292,35 +292,24 @@ export class IfcViewer {
292
292
  _createInterface() {
293
293
  // Основная разметка просмотрщика
294
294
  const html = `
295
- <div class="ifc-viewer-container" style="width: 100%; height: 100%; position: relative; display: flex; flex-direction: column;">
295
+ <div class="ifc-viewer-container" style="width: 100%; height: 100%; position: relative; display: flex; flex-direction: column; border:0px red solid;">
296
296
  <!-- Верхняя панель управления -->
297
- <div id="ifcToolbar" class="navbar bg-neutral text-neutral-content shrink-0 px-4" style="${this.options.showToolbar ? '' : 'display: none;'}">
298
- <div class="navbar-start">
299
- <span class="text-lg font-semibold">IFC Viewer</span>
300
- </div>
301
- <div class="navbar-end flex gap-2">
302
- <!-- Качество рендеринга -->
303
- <div class="join">
304
- <button class="btn btn-sm join-item" id="ifcQualLow">Low</button>
305
- <button class="btn btn-sm join-item btn-active" id="ifcQualMed">Med</button>
306
- <button class="btn btn-sm join-item" id="ifcQualHigh">High</button>
307
- </div>
297
+ <div id="ifcToolbar" class="d-flex px-4" style="border:0px red solid; width: 250px; position: absolute; z-index: 1000; justify-content:space-between; bottom: 5px; left: calc(50% - 125px); ">
298
+
299
+ <div class="navbar-end flex gap-2">
308
300
 
309
301
  <!-- Стили отображения -->
310
302
  <div class="join">
311
- <button class="btn btn-sm join-item btn-active" id="ifcToggleEdges">Edges</button>
312
- <button class="btn btn-sm join-item btn-active" id="ifcToggleShading">Flat</button>
303
+ <button class="btn btn-sm join-item btn-active" id="ifcToggleEdges"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" class="c-tree__icon c-tree__icon--3d"><g fill="#252A3F" fill-rule="nonzero"><path d="M12.5 5L6.005 8.75v7.5L12.5 20l6.495-3.75v-7.5L12.5 5zm0-1.155l7.495 4.328v8.654L12.5 21.155l-7.495-4.328V8.173L12.5 3.845z"></path><path d="M12 12v8.059h1V12z"></path><path d="M5.641 9.157l7.045 4.025.496-.868-7.045-4.026z"></path><path d="M18.863 8.288l-7.045 4.026.496.868 7.045-4.025z"></path></g></svg></button>
313
304
  </div>
314
305
 
315
306
  <!-- Секущие плоскости -->
316
307
  <div class="join">
317
- <button class="btn btn-sm join-item" id="ifcClipX">Clip X</button>
318
- <button class="btn btn-sm join-item" id="ifcClipY">Clip Y</button>
319
- <button class="btn btn-sm join-item" id="ifcClipZ">Clip Z</button>
308
+ <button class="btn btn-sm join-item" id="ifcClipX" style="margin-right:2px"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="MuiSvgIcon-root MuiSvgIcon-fontSizeLarge" focusable="false" viewBox="0 0 24 24" aria-hidden="true"><path d="M9.6 3v9.07l3.87-1.72a2 2 0 01.81-.17 2.08 2.08 0 011.77 3.09 1.09 1.09 0 01-.56.56l-4.36 1.94L21.6 21V9z"></path><path d="M4.74 15.33l9.14-4.07a1 1 0 011.32.51 1 1 0 01-.51 1.32l-9.14 4.07 4 1.52L9 20l-6.6-2.53 2.53-6.6 1.32.51z"></path></svg></button>
309
+ <button class="btn btn-sm join-item" id="ifcClipZ" style="margin-right:2px"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="MuiSvgIcon-root MuiSvgIcon-fontSizeLarge" focusable="false" viewBox="0 0 24 24" aria-hidden="true"><path d="M8 13.82a1.09 1.09 0 01-.56-.56 2.08 2.08 0 011.78-3.09 2 2 0 01.81.17l3.87 1.72V3l-11 6v12l9.54-5.2z"></path><path d="M17.24 11.37l1.32-.51 2.53 6.6L14.5 20l-.5-1.32 4-1.52-9.18-4.07a1 1 0 01-.51-1.32 1 1 0 011.32-.51l9.14 4.07z"></path></svg></button>
310
+ <button class="btn btn-sm join-item" id="ifcClipY" style="margin-right:2px"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" class="MuiSvgIcon-root MuiSvgIcon-fontSizeLarge" focusable="false" viewBox="0 0 24 24" aria-hidden="true"><path d="M14.25 11.18v3.52A1.87 1.87 0 0111 15.88a1 1 0 01-.32-.72V11.1l-9 4.5L12.45 21l9.9-5.4z"></path><path d="M8.85 8.4L8 7.5 12.45 3 17 7.5l-.9.9-2.7-2.7v9a.9.9 0 01-.9.9.9.9 0 01-.9-.9v-9z"></path></svg></button>
320
311
  </div>
321
-
322
- <!-- Кнопка загрузки файла -->
323
- <button id="ifcUploadBtnTop" class="btn btn-sm bg-white text-black">📁 Загрузить</button>
312
+
324
313
  </div>
325
314
  </div>
326
315
 
@@ -389,13 +378,7 @@ export class IfcViewer {
389
378
  <div id="ifcSidebarToggleContainer" class="absolute top-4 left-4 z-30" style="display: none;">
390
379
  <button id="ifcSidebarToggle" class="btn btn-primary btn-sm">☰</button>
391
380
  </div>
392
-
393
- <!-- Панель управления (дополнительные кнопки) -->
394
- <div id="ifcControls" class="absolute top-4 left-4 z-30" style="${this.options.showControls ? 'margin-top: 3rem;' : 'display: none;'}">
395
- <!-- Кнопка загрузки -->
396
- <button id="ifcUploadBtn" class="btn btn-secondary btn-sm">📁</button>
397
- <input type="file" id="ifcFileInput" accept=".ifc,.ifczip,.zip" style="display: none;">
398
- </div>
381
+
399
382
 
400
383
  <!-- Панель зума (будет создана Viewer'ом) -->
401
384
  <div id="ifcZoomPanel" class="absolute bottom-4 right-4 z-30"></div>
@@ -1,7 +1,7 @@
1
1
  import * as WebIFC from 'web-ifc';
2
2
  import { IFCSPACE, IFCOPENINGELEMENT, IFCPRODUCTDEFINITIONSHAPE, IFCRELAGGREGATES, IFCRELCONTAINEDINSPATIALSTRUCTURE, IFCRELDEFINESBYPROPERTIES, IFCRELASSOCIATESMATERIAL, IFCRELDEFINESBYTYPE, IFCPROJECT, IFCBUILDING } from 'web-ifc';
3
3
  import { Mesh, Color, MeshLambertMaterial, DoubleSide, Matrix4, BufferGeometry, BufferAttribute, Loader, FileLoader } from 'three';
4
- import { mergeGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils';
4
+ import { mergeBufferGeometries } from 'three/examples/jsm/utils/BufferGeometryUtils.js';
5
5
 
6
6
  const nullIfcManagerErrorMessage = 'IfcManager is null!';
7
7
 
@@ -171,11 +171,11 @@ class IFCParser {
171
171
  const materials = [];
172
172
  Object.keys(this.geometriesByMaterials).forEach((key) => {
173
173
  const geometriesByMaterial = this.geometriesByMaterials[key].geometries;
174
- const merged = mergeGeometries(geometriesByMaterial);
174
+ const merged = mergeBufferGeometries(geometriesByMaterial);
175
175
  materials.push(this.geometriesByMaterials[key].material);
176
176
  geometries.push(merged);
177
177
  });
178
- const combinedGeometry = mergeGeometries(geometries, true);
178
+ const combinedGeometry = mergeBufferGeometries(geometries, true);
179
179
  this.cleanUpGeometryMemory(geometries);
180
180
  if (this.BVH)
181
181
  this.BVH.applyThreeMeshBVH(combinedGeometry);