@ifc-lite/wasm 1.1.6 → 1.2.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/LICENSE +373 -0
- package/README.md +196 -87
- package/package.json +2 -2
- package/pkg/ifc-lite.d.ts +309 -25
- package/pkg/ifc-lite.js +837 -103
- package/pkg/ifc-lite_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
<
|
|
1
|
+
<table align="center">
|
|
2
|
+
<tr>
|
|
3
|
+
<td valign="top">
|
|
4
|
+
<img src="https://readme-typing-svg.herokuapp.com?font=JetBrains+Mono&weight=700&size=48&duration=2000&pause=5000&color=FFFFFF&vCenter=true&width=300&height=55&lines=IFClite" alt="IFClite">
|
|
5
|
+
<br>
|
|
6
|
+
<code>Fast</code> · <code>Lightweight</code> · <code>Columnar</code> · <code>Browser-native</code>
|
|
7
|
+
</td>
|
|
8
|
+
<td width="120" align="center" valign="middle">
|
|
9
|
+
<img src="docs/assets/logo.png" alt="" width="100">
|
|
10
|
+
</td>
|
|
11
|
+
</tr>
|
|
12
|
+
</table>
|
|
6
13
|
|
|
7
14
|
<p align="center">
|
|
8
|
-
<
|
|
15
|
+
<a href="https://www.ifclite.com/"><img src="https://img.shields.io/badge/🚀_Try_it_Live-ifclite.com-ff6b6b?style=for-the-badge&labelColor=1a1a2e" alt="Try it Live"></a>
|
|
9
16
|
</p>
|
|
10
17
|
|
|
11
18
|
<p align="center">
|
|
12
|
-
<a href="https://github.com/louistrue/ifc-lite/actions"><img src="https://img.shields.io/github/actions/workflow/status/louistrue/ifc-lite/
|
|
19
|
+
<a href="https://github.com/louistrue/ifc-lite/actions"><img src="https://img.shields.io/github/actions/workflow/status/louistrue/ifc-lite/release.yml?branch=main&style=flat-square&logo=github" alt="Build Status"></a>
|
|
13
20
|
<a href="https://github.com/louistrue/ifc-lite/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MPL--2.0-blue?style=flat-square" alt="License"></a>
|
|
14
21
|
<a href="https://www.npmjs.com/package/@ifc-lite/parser"><img src="https://img.shields.io/npm/v/@ifc-lite/parser?style=flat-square&logo=npm&label=parser" alt="npm parser"></a>
|
|
15
22
|
<a href="https://crates.io/crates/ifc-lite-core"><img src="https://img.shields.io/crates/v/ifc-lite-core?style=flat-square&logo=rust&label=core" alt="crates.io"></a>
|
|
16
23
|
</p>
|
|
17
24
|
|
|
18
25
|
<p align="center">
|
|
19
|
-
<a href="#features">Features</a>
|
|
20
|
-
<a href="#quick-start">Quick Start</a>
|
|
21
|
-
<a href="#documentation">Documentation</a>
|
|
22
|
-
<a href="#architecture">Architecture</a>
|
|
23
|
-
<a href="#performance">Performance</a>
|
|
26
|
+
<a href="#features">Features</a> ·
|
|
27
|
+
<a href="#quick-start">Quick Start</a> ·
|
|
28
|
+
<a href="#documentation">Documentation</a> ·
|
|
29
|
+
<a href="#architecture">Architecture</a> ·
|
|
30
|
+
<a href="#performance">Performance</a> ·
|
|
24
31
|
<a href="#contributing">Contributing</a>
|
|
25
32
|
</p>
|
|
26
33
|
|
|
@@ -28,48 +35,96 @@
|
|
|
28
35
|
|
|
29
36
|
## Overview
|
|
30
37
|
|
|
31
|
-
**
|
|
38
|
+
**IFClite** parses, processes, and renders IFC files in the browser using **Rust + WebAssembly** and **WebGPU**. Smaller and faster than the alternatives.
|
|
32
39
|
|
|
33
40
|
<p align="center">
|
|
34
|
-
<strong>~
|
|
41
|
+
<strong>~650 KB WASM (~260 KB gzipped)</strong> • <strong>2.6x faster</strong> • <strong>100% IFC4X3 schema (876 entities)</strong>
|
|
35
42
|
</p>
|
|
36
43
|
|
|
37
44
|
## Features
|
|
38
45
|
|
|
39
46
|
| Feature | Description |
|
|
40
47
|
|---------|-------------|
|
|
41
|
-
| **
|
|
42
|
-
| **
|
|
43
|
-
| **
|
|
44
|
-
| **
|
|
45
|
-
| **Zero-Copy GPU** | Direct WASM memory
|
|
48
|
+
| **Clean DX** | Columnar data structures, TypedArrays, consistent API. Built from scratch for clarity |
|
|
49
|
+
| **STEP/IFC Parsing** | Zero-copy tokenization with full IFC4X3 schema support (876 entities) |
|
|
50
|
+
| **Streaming Pipeline** | Progressive geometry processing. First triangles in 300-500ms |
|
|
51
|
+
| **WebGPU Rendering** | Modern GPU-accelerated 3D with depth testing and frustum culling |
|
|
52
|
+
| **Zero-Copy GPU** | Direct WASM memory to GPU buffers, 60-70% less RAM |
|
|
46
53
|
|
|
47
54
|
## Quick Start
|
|
48
55
|
|
|
49
|
-
###
|
|
56
|
+
### Option 1: Create a New Project (Recommended)
|
|
57
|
+
|
|
58
|
+
Get started instantly without cloning the repo:
|
|
50
59
|
|
|
51
|
-
|
|
52
|
-
-
|
|
53
|
-
-
|
|
60
|
+
```bash
|
|
61
|
+
npx create-ifc-lite my-ifc-app
|
|
62
|
+
cd my-ifc-app
|
|
63
|
+
npm install && npm run parse
|
|
64
|
+
```
|
|
54
65
|
|
|
55
|
-
|
|
66
|
+
Or create a React viewer:
|
|
56
67
|
|
|
57
68
|
```bash
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
69
|
+
npx create-ifc-lite my-viewer --template react
|
|
70
|
+
cd my-viewer
|
|
71
|
+
npm install && npm run dev
|
|
72
|
+
```
|
|
61
73
|
|
|
62
|
-
|
|
63
|
-
pnpm install
|
|
74
|
+
### Option 2: Install Packages Directly
|
|
64
75
|
|
|
65
|
-
|
|
66
|
-
pnpm build
|
|
76
|
+
Add IFClite to your existing project:
|
|
67
77
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
pnpm dev
|
|
78
|
+
```bash
|
|
79
|
+
npm install @ifc-lite/parser
|
|
71
80
|
```
|
|
72
81
|
|
|
82
|
+
```typescript
|
|
83
|
+
import { IfcParser } from '@ifc-lite/parser';
|
|
84
|
+
|
|
85
|
+
const parser = new IfcParser();
|
|
86
|
+
const result = parser.parse(ifcBuffer);
|
|
87
|
+
|
|
88
|
+
console.log(`Found ${result.entities.length} entities`);
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For full 3D rendering, add geometry and renderer packages:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
npm install @ifc-lite/parser @ifc-lite/geometry @ifc-lite/renderer
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Option 3: Rust/Cargo
|
|
98
|
+
|
|
99
|
+
For Rust projects:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cargo add ifc-lite-core
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
```rust
|
|
106
|
+
use ifc_lite_core::parse_ifc;
|
|
107
|
+
|
|
108
|
+
let result = parse_ifc(&ifc_bytes)?;
|
|
109
|
+
println!("Parsed {} entities", result.entities.len());
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Option 4: Clone the Repo (Contributors)
|
|
113
|
+
|
|
114
|
+
For contributing or running the full demo app:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
git clone https://github.com/louistrue/ifc-lite.git
|
|
118
|
+
cd ifc-lite
|
|
119
|
+
pnpm install && pnpm dev
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Open http://localhost:5173 and load an IFC file.
|
|
123
|
+
|
|
124
|
+
> **Note:** Requires Node.js 18+ and pnpm 8+. No Rust toolchain needed - WASM is pre-built.
|
|
125
|
+
>
|
|
126
|
+
> **📖 Full Guide**: See [Installation](docs/guide/installation.md) for detailed setup options including troubleshooting.
|
|
127
|
+
|
|
73
128
|
### Basic Usage
|
|
74
129
|
|
|
75
130
|
```typescript
|
|
@@ -78,13 +133,13 @@ import { Renderer } from '@ifc-lite/renderer';
|
|
|
78
133
|
|
|
79
134
|
// Parse IFC file
|
|
80
135
|
const parser = new IfcParser();
|
|
81
|
-
const result =
|
|
136
|
+
const result = parser.parse(ifcArrayBuffer);
|
|
82
137
|
|
|
83
138
|
// Access entities
|
|
84
139
|
const walls = result.entities.filter(e => e.type === 'IFCWALL');
|
|
85
140
|
console.log(`Found ${walls.length} walls`);
|
|
86
141
|
|
|
87
|
-
// Render geometry
|
|
142
|
+
// Render geometry (requires @ifc-lite/renderer)
|
|
88
143
|
const renderer = new Renderer(canvas);
|
|
89
144
|
await renderer.loadGeometry(result.geometry);
|
|
90
145
|
renderer.render();
|
|
@@ -94,20 +149,41 @@ renderer.render();
|
|
|
94
149
|
|
|
95
150
|
| Resource | Description |
|
|
96
151
|
|----------|-------------|
|
|
97
|
-
| [**
|
|
98
|
-
| [**
|
|
99
|
-
| [**
|
|
100
|
-
| [**
|
|
152
|
+
| [**Quick Start**](docs/guide/quickstart.md) | Parse your first IFC file in 5 minutes |
|
|
153
|
+
| [**Installation**](docs/guide/installation.md) | Detailed setup for npm, Cargo, and from source |
|
|
154
|
+
| [**User Guide**](https://louistrue.github.io/ifc-lite/) | Complete guides: parsing, geometry, rendering, querying |
|
|
155
|
+
| [**Tutorials**](docs/tutorials/building-viewer.md) | Build a viewer, custom queries, extend the parser |
|
|
156
|
+
| [**Architecture**](docs/architecture/overview.md) | System design with detailed diagrams |
|
|
157
|
+
| [**API Reference**](docs/api/typescript.md) | TypeScript, Rust, and WASM API docs |
|
|
158
|
+
| [**Contributing**](docs/contributing/setup.md) | Development setup and testing guide |
|
|
101
159
|
|
|
102
160
|
## Architecture
|
|
103
161
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
162
|
+
```mermaid
|
|
163
|
+
flowchart LR
|
|
164
|
+
IFC[IFC File] --> Tokenize
|
|
165
|
+
Tokenize --> Scan --> Decode
|
|
166
|
+
Decode --> Tables[Columnar Tables]
|
|
167
|
+
Decode --> Graph[Relationship Graph]
|
|
168
|
+
Tables --> Renderer[WebGPU Renderer]
|
|
169
|
+
Graph --> Export[glTF / Parquet]
|
|
170
|
+
|
|
171
|
+
style IFC fill:#6366f1,stroke:#312e81,color:#fff
|
|
172
|
+
style Tokenize fill:#2563eb,stroke:#1e3a8a,color:#fff
|
|
173
|
+
style Scan fill:#2563eb,stroke:#1e3a8a,color:#fff
|
|
174
|
+
style Decode fill:#10b981,stroke:#064e3b,color:#fff
|
|
175
|
+
style Tables fill:#f59e0b,stroke:#7c2d12,color:#fff
|
|
176
|
+
style Graph fill:#f59e0b,stroke:#7c2d12,color:#fff
|
|
177
|
+
style Renderer fill:#a855f7,stroke:#581c87,color:#fff
|
|
178
|
+
style Export fill:#a855f7,stroke:#581c87,color:#fff
|
|
179
|
+
```
|
|
107
180
|
|
|
108
|
-
|
|
181
|
+
IFC files flow through three processing layers. See the [Architecture Documentation](docs/architecture/overview.md) for detailed diagrams including data flow, memory model, and threading.
|
|
109
182
|
|
|
110
|
-
**
|
|
183
|
+
> **Deep Dive**: [Data Flow](docs/architecture/data-flow.md) ·
|
|
184
|
+
> [Parsing Pipeline](docs/architecture/parsing-pipeline.md) ·
|
|
185
|
+
> [Geometry Pipeline](docs/architecture/geometry-pipeline.md) ·
|
|
186
|
+
> [Rendering Pipeline](docs/architecture/rendering-pipeline.md)
|
|
111
187
|
|
|
112
188
|
## Project Structure
|
|
113
189
|
|
|
@@ -122,6 +198,7 @@ ifc-lite/
|
|
|
122
198
|
│ ├── parser/ # High-level IFC parser
|
|
123
199
|
│ ├── geometry/ # Geometry bridge (WASM)
|
|
124
200
|
│ ├── renderer/ # WebGPU rendering
|
|
201
|
+
│ ├── cache/ # Binary cache format
|
|
125
202
|
│ ├── query/ # Query system
|
|
126
203
|
│ ├── data/ # Columnar data structures
|
|
127
204
|
│ ├── spatial/ # Spatial indexing
|
|
@@ -131,34 +208,44 @@ ifc-lite/
|
|
|
131
208
|
├── apps/
|
|
132
209
|
│ └── viewer/ # React web application
|
|
133
210
|
│
|
|
134
|
-
|
|
135
|
-
└── plan/ # Technical specifications
|
|
211
|
+
└── docs/ # Documentation (MkDocs)
|
|
136
212
|
```
|
|
137
213
|
|
|
138
214
|
## Performance
|
|
139
215
|
|
|
140
216
|
### Bundle Size Comparison
|
|
141
217
|
|
|
142
|
-
| Library | Size | Gzipped |
|
|
143
|
-
|
|
144
|
-
| **
|
|
145
|
-
|
|
|
146
|
-
|
|
|
218
|
+
| Library | WASM Size | Gzipped |
|
|
219
|
+
|---------|-----------|---------|
|
|
220
|
+
| **IFClite** | **0.65 MB** | **0.26 MB** |
|
|
221
|
+
| web-ifc | 1.1 MB | 0.4 MB |
|
|
222
|
+
| IfcOpenShell | 15 MB | - |
|
|
147
223
|
|
|
148
224
|
### Parse Performance
|
|
149
225
|
|
|
150
|
-
| Model Size |
|
|
226
|
+
| Model Size | IFClite | Notes |
|
|
151
227
|
|------------|----------|-------|
|
|
152
|
-
| 10 MB | ~
|
|
153
|
-
| 50 MB | ~
|
|
154
|
-
| 100+ MB | ~
|
|
228
|
+
| 10 MB | ~100-200ms | Small models |
|
|
229
|
+
| 50 MB | ~600-700ms | Typical models |
|
|
230
|
+
| 100+ MB | ~1.5-2s | Complex geometry |
|
|
231
|
+
|
|
232
|
+
*Based on [benchmark results](tests/benchmark/benchmark-results.json) across 67 IFC files.*
|
|
233
|
+
|
|
234
|
+
### Zero-Copy GPU Pipeline
|
|
235
|
+
|
|
236
|
+
- **Zero-copy WASM to WebGPU**: Direct memory access from WASM linear memory to GPU buffers
|
|
237
|
+
- **60-70% reduction** in peak RAM usage
|
|
238
|
+
- **74% faster** parse time with optimized data flow
|
|
239
|
+
- **40-50% faster** geometry-to-GPU pipeline
|
|
155
240
|
|
|
156
241
|
### Geometry Processing
|
|
157
242
|
|
|
158
|
-
- **
|
|
243
|
+
- **5x faster** overall than web-ifc (median 2.18x, up to 104x on some files)
|
|
159
244
|
- Streaming pipeline with batched processing (100 meshes/batch)
|
|
160
245
|
- First triangles visible in **300-500ms**
|
|
161
246
|
|
|
247
|
+
*See [full benchmark data](tests/benchmark/benchmark-results.json) for per-file comparisons.*
|
|
248
|
+
|
|
162
249
|
## Browser Requirements
|
|
163
250
|
|
|
164
251
|
| Browser | Minimum Version | WebGPU |
|
|
@@ -168,51 +255,70 @@ ifc-lite/
|
|
|
168
255
|
| Firefox | 127+ | ✅ |
|
|
169
256
|
| Safari | 18+ | ✅ |
|
|
170
257
|
|
|
171
|
-
|
|
258
|
+
> **More Info**: See [Browser Requirements](docs/guide/browser-requirements.md) for WebGPU feature detection and fallbacks.
|
|
172
259
|
|
|
173
|
-
|
|
174
|
-
# Watch mode for all packages
|
|
175
|
-
pnpm -r dev
|
|
260
|
+
## Development (Contributors)
|
|
176
261
|
|
|
177
|
-
|
|
178
|
-
cd packages/parser && pnpm build
|
|
262
|
+
For contributing to IFClite itself:
|
|
179
263
|
|
|
180
|
-
|
|
181
|
-
|
|
264
|
+
```bash
|
|
265
|
+
git clone https://github.com/louistrue/ifc-lite.git
|
|
266
|
+
cd ifc-lite
|
|
267
|
+
pnpm install
|
|
182
268
|
|
|
183
|
-
#
|
|
184
|
-
|
|
269
|
+
pnpm dev # Start viewer in dev mode
|
|
270
|
+
pnpm build # Build all packages
|
|
271
|
+
pnpm test # Run tests
|
|
185
272
|
|
|
186
|
-
#
|
|
187
|
-
|
|
273
|
+
# Add a changeset when making changes
|
|
274
|
+
pnpm changeset # Describe your changes (required for releases)
|
|
188
275
|
|
|
189
|
-
#
|
|
190
|
-
cd
|
|
276
|
+
# Rust/WASM development (optional - WASM is pre-built)
|
|
277
|
+
cd rust && cargo build --release --target wasm32-unknown-unknown
|
|
278
|
+
bash scripts/build-wasm.sh # Rebuild WASM after Rust changes
|
|
191
279
|
```
|
|
192
280
|
|
|
193
281
|
## Packages
|
|
194
282
|
|
|
195
|
-
| Package | Description | Status |
|
|
196
|
-
|
|
197
|
-
|
|
|
198
|
-
| `@ifc-lite/
|
|
199
|
-
| `@ifc-lite/
|
|
200
|
-
| `@ifc-lite/
|
|
201
|
-
| `@ifc-lite/
|
|
202
|
-
| `@ifc-lite/
|
|
203
|
-
| `@ifc-lite/
|
|
283
|
+
| Package | Description | Status | Docs |
|
|
284
|
+
|---------|-------------|--------|------|
|
|
285
|
+
| `create-ifc-lite` | Project scaffolding CLI | ✅ Stable | [API](docs/api/typescript.md#create-ifc-lite) |
|
|
286
|
+
| `@ifc-lite/parser` | STEP tokenizer & entity extraction | ✅ Stable | [API](docs/api/typescript.md#parser) |
|
|
287
|
+
| `@ifc-lite/geometry` | Geometry processing bridge | ✅ Stable | [API](docs/api/typescript.md#geometry) |
|
|
288
|
+
| `@ifc-lite/renderer` | WebGPU rendering pipeline | ✅ Stable | [API](docs/api/typescript.md#renderer) |
|
|
289
|
+
| `@ifc-lite/cache` | Binary cache for instant loading | ✅ Stable | [API](docs/api/typescript.md#cache) |
|
|
290
|
+
| `@ifc-lite/query` | Fluent & SQL query system | 🚧 Beta | [API](docs/api/typescript.md#query) |
|
|
291
|
+
| `@ifc-lite/data` | Columnar data structures | ✅ Stable | [API](docs/api/typescript.md#data) |
|
|
292
|
+
| `@ifc-lite/spatial` | Spatial indexing & culling | 🚧 Beta | [API](docs/api/typescript.md#spatial) |
|
|
293
|
+
| `@ifc-lite/export` | Export (glTF, Parquet, etc.) | 🚧 Beta | [API](docs/api/typescript.md#export) |
|
|
204
294
|
|
|
205
295
|
## Rust Crates
|
|
206
296
|
|
|
207
|
-
| Crate | Description | Status |
|
|
208
|
-
|
|
209
|
-
| `ifc-lite-core` | STEP/IFC parsing | ✅ Stable |
|
|
210
|
-
| `ifc-lite-geometry` | Mesh triangulation | ✅ Stable |
|
|
211
|
-
| `ifc-lite-wasm` | WASM bindings | ✅ Stable |
|
|
297
|
+
| Crate | Description | Status | Docs |
|
|
298
|
+
|-------|-------------|--------|------|
|
|
299
|
+
| `ifc-lite-core` | STEP/IFC parsing | ✅ Stable | [docs.rs](https://docs.rs/ifc-lite-core) |
|
|
300
|
+
| `ifc-lite-geometry` | Mesh triangulation | ✅ Stable | [docs.rs](https://docs.rs/ifc-lite-geometry) |
|
|
301
|
+
| `ifc-lite-wasm` | WASM bindings | ✅ Stable | [docs.rs](https://docs.rs/ifc-lite-wasm) |
|
|
302
|
+
|
|
303
|
+
## Community Projects
|
|
304
|
+
|
|
305
|
+
Projects built by the community using IFClite (not officially maintained):
|
|
306
|
+
|
|
307
|
+
| Project | Author | Description |
|
|
308
|
+
|---------|--------|-------------|
|
|
309
|
+
| [bimifc.de](https://bimifc.de/) | [@holg](https://github.com/holg) | Pure Rust/Bevy IFC viewer, no TypeScript needed |
|
|
310
|
+
|
|
311
|
+
*Built something with IFClite? Open a PR to add it here!*
|
|
212
312
|
|
|
213
313
|
## Contributing
|
|
214
314
|
|
|
215
|
-
We welcome contributions!
|
|
315
|
+
We welcome contributions!
|
|
316
|
+
|
|
317
|
+
| Resource | Description |
|
|
318
|
+
|----------|-------------|
|
|
319
|
+
| [**Development Setup**](docs/contributing/setup.md) | Prerequisites, installation, and project structure |
|
|
320
|
+
| [**Testing Guide**](docs/contributing/testing.md) | Running tests, writing tests, CI |
|
|
321
|
+
| [**Release Process**](RELEASE.md) | Versioning and publishing workflow |
|
|
216
322
|
|
|
217
323
|
```bash
|
|
218
324
|
# Fork and clone
|
|
@@ -224,7 +330,10 @@ git checkout -b feature/my-feature
|
|
|
224
330
|
# Make changes and test
|
|
225
331
|
pnpm test
|
|
226
332
|
|
|
227
|
-
#
|
|
333
|
+
# Add a changeset to describe your changes
|
|
334
|
+
pnpm changeset
|
|
335
|
+
|
|
336
|
+
# Submit a pull request (include the changeset file)
|
|
228
337
|
```
|
|
229
338
|
|
|
230
339
|
## License
|
package/package.json
CHANGED