@sequent-org/ifc-viewer 1.0.2-ci.2.0 → 1.0.2-ci.4.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/README.md +201 -0
- package/package.json +29 -2
- package/src/IfcViewer.js +782 -0
- package/src/index.js +13 -0
- package/.github/workflows/npm-publish.yml +0 -39
- package/console-log.txt +0 -1924
- package/fragments.html +0 -46
- package/index.html +0 -101
- package/postcss.config.cjs +0 -7
- package/tailwind.config.cjs +0 -5
- package/vite.config.js +0 -36
package/fragments.html
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="ru">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Fragments Viewer (That Open)</title>
|
|
7
|
-
<style>
|
|
8
|
-
html, body { height: 100%; margin: 0; }
|
|
9
|
-
#app { height: 100%; display: flex; }
|
|
10
|
-
/* simple fallback layout */
|
|
11
|
-
.fallback { font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif; padding: 16px; }
|
|
12
|
-
</style>
|
|
13
|
-
<!-- Опционально: свои стили. CSS пакета опустим, чтобы избежать 404 с CDN. -->
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div id="app">
|
|
17
|
-
<!-- Если компоненты не подхватятся, пользователь увидит fallback -->
|
|
18
|
-
<div class="fallback">
|
|
19
|
-
<h3>Загрузка компонентов...</h3>
|
|
20
|
-
<p>Если интерфейс не появился, проверьте доступность CDN и перезагрузите страницу.</p>
|
|
21
|
-
</div>
|
|
22
|
-
</div>
|
|
23
|
-
|
|
24
|
-
<script type="module">
|
|
25
|
-
// Подключаем бандл через esm.sh с согласованной версией three (>=0.175)
|
|
26
|
-
import 'https://esm.sh/@thatopen/components@3.1.3?bundle&deps=three@0.176.0';
|
|
27
|
-
const app = document.querySelector('#app');
|
|
28
|
-
app.innerHTML = `
|
|
29
|
-
<to-app style="width:100%;height:100%">
|
|
30
|
-
<to-toolbar slot="toolbar"></to-toolbar>
|
|
31
|
-
<to-scene slot="main" id="scene"></to-scene>
|
|
32
|
-
<to-panels-right slot="right">
|
|
33
|
-
<to-panel-properties></to-panel-properties>
|
|
34
|
-
<to-panel-sections></to-panel-sections>
|
|
35
|
-
<to-panel-measure></to-panel-measure>
|
|
36
|
-
</to-panels-right>
|
|
37
|
-
<to-panels-left slot="left">
|
|
38
|
-
<to-panel-loader></to-panel-loader>
|
|
39
|
-
</to-panels-left>
|
|
40
|
-
</to-app>
|
|
41
|
-
`;
|
|
42
|
-
</script>
|
|
43
|
-
</body>
|
|
44
|
-
</html>
|
|
45
|
-
|
|
46
|
-
|
package/index.html
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
<!doctype html>
|
|
2
|
-
<html lang="ru" data-theme="light" class="h-dvh overflow-hidden">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<link rel="stylesheet" href="/src/style.css" />
|
|
7
|
-
<title>3D </title>
|
|
8
|
-
</head>
|
|
9
|
-
<body class="h-full flex flex-col overflow-hidden bg-base-100 text-base-content">
|
|
10
|
-
<div class="navbar bg-neutral text-neutral-content shrink-0">
|
|
11
|
-
<div class="navbar-start">
|
|
12
|
-
<div class="dropdown">
|
|
13
|
-
<div tabindex="0" role="button" class="btn btn-ghost lg:hidden" aria-label="Открыть меню">
|
|
14
|
-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"/></svg>
|
|
15
|
-
</div>
|
|
16
|
-
<ul tabindex="0" class="menu menu-sm dropdown-content bg-base-200 rounded-box z-10 mt-3 w-52 p-2 shadow">
|
|
17
|
-
<li><a>Главная</a></li>
|
|
18
|
-
<li><a>О нас</a></li>
|
|
19
|
-
<li><a>Контакты</a></li>
|
|
20
|
-
</ul>
|
|
21
|
-
</div>
|
|
22
|
-
<a class="btn btn-ghost text-xl">3D Viewer</a>
|
|
23
|
-
</div>
|
|
24
|
-
<div class="navbar-end hidden lg:flex gap-2">
|
|
25
|
-
<div class="join mr-2">
|
|
26
|
-
<button class="btn join-item" id="qualLow">Low</button>
|
|
27
|
-
<button class="btn join-item btn-active" id="qualMed">Med</button>
|
|
28
|
-
<button class="btn join-item" id="qualHigh">High</button>
|
|
29
|
-
</div>
|
|
30
|
-
<div class="join mr-2">
|
|
31
|
-
<button class="btn join-item" id="toggleEdges">Edges</button>
|
|
32
|
-
<button class="btn join-item" id="toggleShading">Flat</button>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="join mr-2">
|
|
35
|
-
<button class="btn join-item" id="clipX">Clip X</button>
|
|
36
|
-
<button class="btn join-item" id="clipY">Clip Y</button>
|
|
37
|
-
<button class="btn join-item" id="clipZ">Clip Z</button>
|
|
38
|
-
</div>
|
|
39
|
-
<button id="uploadBtn" class="btn bg-white text-black">Загрузить модель</button>
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<div id="app" class="w-full flex-1 relative min-h-0 overflow-hidden">
|
|
44
|
-
<!-- Кнопка открытия левой панели -->
|
|
45
|
-
<button id="sidebarToggle" class="btn btn-square btn-sm absolute left-3 top-3 z-30">☰</button>
|
|
46
|
-
|
|
47
|
-
<!-- ЛЕВАЯ ПАНЕЛЬ IFC -->
|
|
48
|
-
<div id="ifcSidebar" class="absolute inset-y-0 left-0 z-30 w-80 max-w-[80%] -translate-x-full transition-transform duration-300 ease-in-out pointer-events-none">
|
|
49
|
-
<div class="h-full bg-base-200/95 backdrop-blur-md shadow-xl border-r border-base-300 flex flex-col">
|
|
50
|
-
<div class="p-3 flex items-center justify-between border-b border-base-300">
|
|
51
|
-
<div class="font-semibold">IFC Structure</div>
|
|
52
|
-
<button id="sidebarClose" class="btn btn-ghost btn-sm">✕</button>
|
|
53
|
-
</div>
|
|
54
|
-
<div id="ifcInfo" class="p-3 text-xs opacity-80 border-b border-base-300"></div>
|
|
55
|
-
<div id="ifcActions" class="px-3 py-2 border-b border-base-300 flex items-center gap-2">
|
|
56
|
-
<label class="label cursor-pointer justify-start gap-2">
|
|
57
|
-
<input id="ifcIsolateToggle" type="checkbox" class="toggle toggle-sm" />
|
|
58
|
-
<span class="label-text text-xs">Скрывать остальные</span>
|
|
59
|
-
</label>
|
|
60
|
-
</div>
|
|
61
|
-
<div id="ifcTree" class="flex-1 overflow-auto p-2"></div>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
<div id="preloader" class="fixed inset-0 z-50 bg-black text-white opacity-100 transition-opacity duration-500 will-change-[opacity]">
|
|
65
|
-
<div class="absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 w-[150px] h-[150px]">
|
|
66
|
-
<svg viewBox="0 0 100 100" class="w-full h-full">
|
|
67
|
-
<g fill="none" stroke="#fff" stroke-linecap="round" stroke-linejoin="round" stroke-width="6">
|
|
68
|
-
<path d="M 21 40 V 59">
|
|
69
|
-
<animateTransform attributeName="transform" attributeType="XML" type="rotate" values="0 21 59; 180 21 59" dur="2s" repeatCount="indefinite" />
|
|
70
|
-
</path>
|
|
71
|
-
<path d="M 79 40 V 59">
|
|
72
|
-
<animateTransform attributeName="transform" attributeType="XML" type="rotate" values="0 79 59; -180 79 59" dur="2s" repeatCount="indefinite" />
|
|
73
|
-
</path>
|
|
74
|
-
<path d="M 50 21 V 40">
|
|
75
|
-
<animate attributeName="d" values="M 50 21 V 40; M 50 59 V 40" dur="2s" repeatCount="indefinite" />
|
|
76
|
-
</path>
|
|
77
|
-
<path d="M 50 60 V 79">
|
|
78
|
-
<animate attributeName="d" values="M 50 60 V 79; M 50 98 V 79" dur="2s" repeatCount="indefinite" />
|
|
79
|
-
</path>
|
|
80
|
-
<path d="M 50 21 L 79 40 L 50 60 L 21 40 Z">
|
|
81
|
-
<animate attributeName="stroke" values="rgba(255,255,255,1); rgba(100,100,100,0)" dur="2s" repeatCount="indefinite" />
|
|
82
|
-
</path>
|
|
83
|
-
<path d="M 50 40 L 79 59 L 50 79 L 21 59 Z"/>
|
|
84
|
-
<path d="M 50 59 L 79 78 L 50 98 L 21 78 Z">
|
|
85
|
-
<animate attributeName="stroke" values="rgba(100,100,100,0); rgba(255,255,255,1)" dur="2s" repeatCount="indefinite" />
|
|
86
|
-
</path>
|
|
87
|
-
<animateTransform attributeName="transform" attributeType="XML" type="translate" values="0 0; 0 -19" dur="2s" repeatCount="indefinite" />
|
|
88
|
-
</g>
|
|
89
|
-
</svg>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
<input id="ifcInput" type="file" accept=".ifc,.ifczip,.ifs" class="hidden" />
|
|
93
|
-
<div id="zoomPanel" class="absolute bottom-4 right-4 join invisible">
|
|
94
|
-
<button id="zoomOut" class="btn join-item">-</button>
|
|
95
|
-
<div id="zoomValue" class="btn join-item btn-ghost select-none">100%</div>
|
|
96
|
-
<button id="zoomIn" class="btn join-item">+</button>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
<script type="module" src="/src/main.js"></script>
|
|
100
|
-
</body>
|
|
101
|
-
</html>
|
package/postcss.config.cjs
DELETED
package/tailwind.config.cjs
DELETED
package/vite.config.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite';
|
|
2
|
-
import { fileURLToPath, URL } from 'node:url';
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
plugins: [
|
|
6
|
-
{
|
|
7
|
-
name: 'ifc-wasm-rewrite',
|
|
8
|
-
configureServer(server) {
|
|
9
|
-
server.middlewares.use((req, res, next) => {
|
|
10
|
-
const url = req.url || '';
|
|
11
|
-
// Перенаправляем любые запросы воркера к wasm внутри node_modules на наш публичный ассет
|
|
12
|
-
if (url.startsWith('/node_modules/web-ifc-three/wasm/web-ifc.wasm') || url.includes('/node_modules/web-ifc-three//wasm/web-ifc.wasm')) {
|
|
13
|
-
res.statusCode = 302;
|
|
14
|
-
res.setHeader('Location', '/wasm/web-ifc.wasm');
|
|
15
|
-
res.end();
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
next();
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
resolve: {
|
|
24
|
-
alias: {
|
|
25
|
-
// web-ifc-three ожидает mergeGeometries в BufferGeometryUtils,
|
|
26
|
-
// в three@0.149 его нет. Шимим через mergeBufferGeometries.
|
|
27
|
-
'three/examples/jsm/utils/BufferGeometryUtils': fileURLToPath(new URL('./src/compat/three-buffer-geometry-utils.js', import.meta.url)),
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
optimizeDeps: {
|
|
31
|
-
// Не оптимизировать emscripten-модули, чтобы не ломать загрузку wasm
|
|
32
|
-
exclude: ['web-ifc', 'web-ifc-three'],
|
|
33
|
-
},
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
|