@ifc-lite/wasm 1.16.6 → 1.16.8
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 +98 -312
- package/package.json +1 -1
- package/pkg/ifc-lite.d.ts +3 -3
- package/pkg/ifc-lite.js +6 -6
- package/pkg/ifc-lite_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -1,356 +1,142 @@
|
|
|
1
|
-
|
|
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>
|
|
13
|
-
|
|
14
|
-
<p align="center">
|
|
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>
|
|
16
|
-
</p>
|
|
17
|
-
|
|
18
|
-
<p align="center">
|
|
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>
|
|
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>
|
|
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>
|
|
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>
|
|
23
|
-
</p>
|
|
24
|
-
|
|
25
|
-
<p align="center">
|
|
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> ·
|
|
31
|
-
<a href="#contributing">Contributing</a>
|
|
32
|
-
</p>
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Overview
|
|
37
|
-
|
|
38
|
-
**IFClite** parses, processes, and renders IFC files in the browser using **Rust + WebAssembly** and **WebGPU**. Smaller and faster than the alternatives.
|
|
39
|
-
|
|
40
|
-
<p align="center">
|
|
41
|
-
<strong>~650 KB WASM (~260 KB gzipped)</strong> • <strong>2.6x faster</strong> • <strong>100% IFC4X3 schema (876 entities)</strong>
|
|
42
|
-
</p>
|
|
43
|
-
|
|
44
|
-
## Features
|
|
45
|
-
|
|
46
|
-
| Feature | Description |
|
|
47
|
-
|---------|-------------|
|
|
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 |
|
|
53
|
-
|
|
54
|
-
## Quick Start
|
|
55
|
-
|
|
56
|
-
### Option 1: Create a New Project (Recommended)
|
|
57
|
-
|
|
58
|
-
Get started instantly without cloning the repo:
|
|
1
|
+
# @ifc-lite/wasm
|
|
59
2
|
|
|
60
|
-
|
|
61
|
-
npx create-ifc-lite my-ifc-app
|
|
62
|
-
cd my-ifc-app
|
|
63
|
-
npm install && npm run parse
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
Or create a React viewer:
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
npx create-ifc-lite my-viewer --template react
|
|
70
|
-
cd my-viewer
|
|
71
|
-
npm install && npm run dev
|
|
72
|
-
```
|
|
3
|
+
Pre-built WebAssembly bindings for the IFClite Rust core. ~650 KB binary (~260 KB gzipped) covering STEP parsing, geometry tessellation, georeferencing, and zero-copy GPU upload.
|
|
73
4
|
|
|
74
|
-
|
|
5
|
+
> **You probably don't need to use this package directly.** It's the WASM binary plus generated JS/TypeScript bindings that `@ifc-lite/parser`, `@ifc-lite/geometry`, and `@ifc-lite/renderer` consume internally. Reach for it when you want raw access to the Rust core without the higher-level wrappers.
|
|
75
6
|
|
|
76
|
-
|
|
7
|
+
## Installation
|
|
77
8
|
|
|
78
9
|
```bash
|
|
79
|
-
npm install @ifc-lite/
|
|
10
|
+
npm install @ifc-lite/wasm
|
|
80
11
|
```
|
|
81
12
|
|
|
82
|
-
|
|
83
|
-
import { IfcParser } from '@ifc-lite/parser';
|
|
13
|
+
## Direct WASM use
|
|
84
14
|
|
|
85
|
-
|
|
86
|
-
const result = parser.parse(ifcBuffer);
|
|
15
|
+
`IfcAPI` methods take the raw IFC text (a `string`), not a `Uint8Array`. Decode the buffer first.
|
|
87
16
|
|
|
88
|
-
|
|
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
|
-
```
|
|
17
|
+
```typescript
|
|
18
|
+
import init, { IfcAPI } from '@ifc-lite/wasm';
|
|
96
19
|
|
|
97
|
-
|
|
20
|
+
await init(); // load and instantiate the WASM module
|
|
98
21
|
|
|
99
|
-
|
|
22
|
+
const api = new IfcAPI();
|
|
23
|
+
const buffer = await fetch('model.ifc').then(r => r.arrayBuffer());
|
|
24
|
+
const content = new TextDecoder().decode(buffer);
|
|
100
25
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
26
|
+
// Lightweight parse — returns { entityCount, ... }
|
|
27
|
+
const result = await api.parse(content);
|
|
28
|
+
console.log(`Entities: ${result.entityCount}`);
|
|
104
29
|
|
|
105
|
-
|
|
106
|
-
|
|
30
|
+
// Tessellated meshes — each entry has expressId, positions, indices, normals, color
|
|
31
|
+
const meshes = api.parseMeshes(content);
|
|
32
|
+
console.log(`${meshes.length} meshes`);
|
|
33
|
+
for (let i = 0; i < meshes.length; i++) {
|
|
34
|
+
const mesh = meshes.get(i);
|
|
35
|
+
console.log(mesh.ifcType, mesh.expressId, mesh.vertexCount, 'vertices');
|
|
36
|
+
}
|
|
107
37
|
|
|
108
|
-
|
|
109
|
-
|
|
38
|
+
meshes.free(); // free the Rust-side mesh buffer
|
|
39
|
+
api.free(); // free the API instance
|
|
110
40
|
```
|
|
111
41
|
|
|
112
|
-
|
|
42
|
+
## Streaming mesh batches
|
|
113
43
|
|
|
114
|
-
For
|
|
44
|
+
For progressive rendering, stream meshes in batches and yield to the browser between them:
|
|
115
45
|
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
46
|
+
```typescript
|
|
47
|
+
import init, { IfcAPI } from '@ifc-lite/wasm';
|
|
48
|
+
|
|
49
|
+
await init();
|
|
50
|
+
const api = new IfcAPI();
|
|
51
|
+
|
|
52
|
+
await api.parseMeshesAsync(content, {
|
|
53
|
+
batchSize: 100,
|
|
54
|
+
onRtcOffset: ({ x, y, z, hasRtc }) => {
|
|
55
|
+
if (hasRtc) viewer.setWorldOffset(x, y, z);
|
|
56
|
+
},
|
|
57
|
+
onBatch: (meshes, progress) => {
|
|
58
|
+
for (const mesh of meshes) scene.add(toThreeMesh(mesh));
|
|
59
|
+
console.log(`${progress.percent}%`);
|
|
60
|
+
},
|
|
61
|
+
onComplete: ({ totalMeshes }) => console.log(`Done — ${totalMeshes} meshes`),
|
|
62
|
+
});
|
|
120
63
|
```
|
|
121
64
|
|
|
122
|
-
|
|
65
|
+
## Zero-copy GPU upload
|
|
123
66
|
|
|
124
|
-
|
|
125
|
-
>
|
|
126
|
-
> **Git LFS:** Large benchmark fixtures are intentionally not downloaded during clone. Pull only the files you need, for example `git lfs pull --include="tests/models/ara3d/AC20-FZK-Haus.ifc"`.
|
|
127
|
-
>
|
|
128
|
-
> **📖 Full Guide**: See [Installation](docs/guide/installation.md) for detailed setup options including troubleshooting.
|
|
129
|
-
|
|
130
|
-
### Basic Usage
|
|
67
|
+
`parseToGpuGeometry` returns interleaved (position + normal) vertex data with pointers into WASM linear memory, ready for direct `GPUBuffer` upload:
|
|
131
68
|
|
|
132
69
|
```typescript
|
|
133
|
-
import {
|
|
134
|
-
import { Renderer } from '@ifc-lite/renderer';
|
|
135
|
-
|
|
136
|
-
// Parse IFC file
|
|
137
|
-
const parser = new IfcParser();
|
|
138
|
-
const result = parser.parse(ifcArrayBuffer);
|
|
139
|
-
|
|
140
|
-
// Access entities
|
|
141
|
-
const walls = result.entities.filter(e => e.type === 'IFCWALL');
|
|
142
|
-
console.log(`Found ${walls.length} walls`);
|
|
143
|
-
|
|
144
|
-
// Render geometry (requires @ifc-lite/renderer)
|
|
145
|
-
const renderer = new Renderer(canvas);
|
|
146
|
-
await renderer.loadGeometry(result.geometry);
|
|
147
|
-
renderer.render();
|
|
148
|
-
```
|
|
70
|
+
import init, { IfcAPI } from '@ifc-lite/wasm';
|
|
149
71
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
| [**Quick Start**](docs/guide/quickstart.md) | Parse your first IFC file in 5 minutes |
|
|
155
|
-
| [**Installation**](docs/guide/installation.md) | Detailed setup for npm, Cargo, and from source |
|
|
156
|
-
| [**User Guide**](https://louistrue.github.io/ifc-lite/) | Complete guides: parsing, geometry, rendering, querying |
|
|
157
|
-
| [**Tutorials**](docs/tutorials/building-viewer.md) | Build a viewer, custom queries, extend the parser |
|
|
158
|
-
| [**Architecture**](docs/architecture/overview.md) | System design with detailed diagrams |
|
|
159
|
-
| [**API Reference**](docs/api/typescript.md) | TypeScript, Rust, and WASM API docs |
|
|
160
|
-
| [**Contributing**](docs/contributing/setup.md) | Development setup and testing guide |
|
|
161
|
-
|
|
162
|
-
## Architecture
|
|
163
|
-
|
|
164
|
-
```mermaid
|
|
165
|
-
flowchart LR
|
|
166
|
-
IFC[IFC File] --> Tokenize
|
|
167
|
-
Tokenize --> Scan --> Decode
|
|
168
|
-
Decode --> Tables[Columnar Tables]
|
|
169
|
-
Decode --> Graph[Relationship Graph]
|
|
170
|
-
Tables --> Renderer[WebGPU Renderer]
|
|
171
|
-
Graph --> Export[glTF / Parquet]
|
|
172
|
-
|
|
173
|
-
style IFC fill:#6366f1,stroke:#312e81,color:#fff
|
|
174
|
-
style Tokenize fill:#2563eb,stroke:#1e3a8a,color:#fff
|
|
175
|
-
style Scan fill:#2563eb,stroke:#1e3a8a,color:#fff
|
|
176
|
-
style Decode fill:#10b981,stroke:#064e3b,color:#fff
|
|
177
|
-
style Tables fill:#f59e0b,stroke:#7c2d12,color:#fff
|
|
178
|
-
style Graph fill:#f59e0b,stroke:#7c2d12,color:#fff
|
|
179
|
-
style Renderer fill:#a855f7,stroke:#581c87,color:#fff
|
|
180
|
-
style Export fill:#a855f7,stroke:#581c87,color:#fff
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
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.
|
|
72
|
+
await init();
|
|
73
|
+
const api = new IfcAPI();
|
|
74
|
+
const gpuGeom = api.parseToGpuGeometry(content);
|
|
75
|
+
const memory = api.getMemory();
|
|
184
76
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
> [Rendering Pipeline](docs/architecture/rendering-pipeline.md)
|
|
77
|
+
// Direct views into WASM memory — no intermediate copy
|
|
78
|
+
const vertexView = new Float32Array(memory.buffer, gpuGeom.vertexDataPtr, gpuGeom.vertexDataLen);
|
|
79
|
+
const indexView = new Uint32Array(memory.buffer, gpuGeom.indicesPtr, gpuGeom.indicesLen);
|
|
189
80
|
|
|
190
|
-
|
|
81
|
+
device.queue.writeBuffer(gpuVertexBuffer, 0, vertexView);
|
|
82
|
+
device.queue.writeBuffer(gpuIndexBuffer, 0, indexView);
|
|
191
83
|
|
|
84
|
+
// IMPORTANT: views are only valid until the next WASM allocation. Free immediately after upload.
|
|
85
|
+
gpuGeom.free();
|
|
192
86
|
```
|
|
193
|
-
ifc-lite/
|
|
194
|
-
├── rust/ # Rust/WASM backend
|
|
195
|
-
│ ├── core/ # IFC/STEP parsing (~2,000 LOC)
|
|
196
|
-
│ ├── geometry/ # Geometry processing (~2,500 LOC)
|
|
197
|
-
│ └── wasm-bindings/ # JavaScript API (~800 LOC)
|
|
198
|
-
│
|
|
199
|
-
├── packages/ # TypeScript packages
|
|
200
|
-
│ ├── parser/ # High-level IFC parser
|
|
201
|
-
│ ├── geometry/ # Geometry bridge (WASM)
|
|
202
|
-
│ ├── renderer/ # WebGPU rendering
|
|
203
|
-
│ ├── cache/ # Binary cache format
|
|
204
|
-
│ ├── query/ # Query system
|
|
205
|
-
│ ├── data/ # Columnar data structures
|
|
206
|
-
│ ├── spatial/ # Spatial indexing
|
|
207
|
-
│ ├── export/ # Export formats
|
|
208
|
-
│ └── codegen/ # Schema generator
|
|
209
|
-
│
|
|
210
|
-
├── apps/
|
|
211
|
-
│ └── viewer/ # React web application
|
|
212
|
-
│
|
|
213
|
-
└── docs/ # Documentation (MkDocs)
|
|
214
|
-
```
|
|
215
|
-
|
|
216
|
-
## Performance
|
|
217
|
-
|
|
218
|
-
### Bundle Size Comparison
|
|
219
|
-
|
|
220
|
-
| Library | WASM Size | Gzipped |
|
|
221
|
-
|---------|-----------|---------|
|
|
222
|
-
| **IFClite** | **0.65 MB** | **0.26 MB** |
|
|
223
|
-
| web-ifc | 1.1 MB | 0.4 MB |
|
|
224
|
-
| IfcOpenShell | 15 MB | - |
|
|
225
|
-
|
|
226
|
-
### Parse Performance
|
|
227
87
|
|
|
228
|
-
|
|
229
|
-
|------------|----------|-------|
|
|
230
|
-
| 10 MB | ~100-200ms | Small models |
|
|
231
|
-
| 50 MB | ~600-700ms | Typical models |
|
|
232
|
-
| 100+ MB | ~1.5-2s | Complex geometry |
|
|
88
|
+
For deduplicated geometry (one mesh per shape, per-instance transforms), use `parseToGpuInstancedGeometry(content)` and iterate `GpuInstancedGeometryCollection`.
|
|
233
89
|
|
|
234
|
-
|
|
90
|
+
## Georeferencing
|
|
235
91
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
*See [full benchmark data](tests/benchmark/benchmark-results.json) for per-file comparisons.*
|
|
250
|
-
|
|
251
|
-
## Browser Requirements
|
|
252
|
-
|
|
253
|
-
| Browser | Minimum Version | WebGPU |
|
|
254
|
-
|---------|----------------|--------|
|
|
255
|
-
| Chrome | 113+ | ✅ |
|
|
256
|
-
| Edge | 113+ | ✅ |
|
|
257
|
-
| Firefox | 127+ | ✅ |
|
|
258
|
-
| Safari | 18+ | ✅ |
|
|
259
|
-
|
|
260
|
-
> **More Info**: See [Browser Requirements](docs/guide/browser-requirements.md) for WebGPU feature detection and fallbacks.
|
|
261
|
-
|
|
262
|
-
## Development (Contributors)
|
|
263
|
-
|
|
264
|
-
For contributing to IFClite itself:
|
|
265
|
-
|
|
266
|
-
```bash
|
|
267
|
-
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/louistrue/ifc-lite.git
|
|
268
|
-
cd ifc-lite
|
|
269
|
-
pnpm install
|
|
270
|
-
|
|
271
|
-
pnpm dev # Start viewer in dev mode
|
|
272
|
-
pnpm build # Build all packages
|
|
273
|
-
pnpm test # Run tests
|
|
274
|
-
|
|
275
|
-
# Add a changeset when making changes
|
|
276
|
-
pnpm changeset # Describe your changes (required for releases)
|
|
277
|
-
|
|
278
|
-
# Rust/WASM development (optional - WASM is pre-built)
|
|
279
|
-
cd rust && cargo build --release --target wasm32-unknown-unknown
|
|
280
|
-
bash scripts/build-wasm.sh # Rebuild WASM after Rust changes
|
|
92
|
+
```typescript
|
|
93
|
+
import init, { IfcAPI } from '@ifc-lite/wasm';
|
|
94
|
+
|
|
95
|
+
await init();
|
|
96
|
+
const api = new IfcAPI();
|
|
97
|
+
const georef = api.getGeoReference(content);
|
|
98
|
+
|
|
99
|
+
if (georef) {
|
|
100
|
+
console.log(`CRS: ${georef.crsName}`);
|
|
101
|
+
const [e, n, h] = georef.localToMap(10, 20, 5);
|
|
102
|
+
console.log(`Local (10,20,5) → Map (${e}, ${n}, ${h})`);
|
|
103
|
+
georef.free();
|
|
104
|
+
}
|
|
281
105
|
```
|
|
282
106
|
|
|
283
|
-
##
|
|
284
|
-
|
|
285
|
-
| Package | Description | Status | Docs |
|
|
286
|
-
|---------|-------------|--------|------|
|
|
287
|
-
| `create-ifc-lite` | Project scaffolding CLI | ✅ Stable | [API](docs/api/typescript.md#create-ifc-lite) |
|
|
288
|
-
| `@ifc-lite/parser` | STEP tokenizer & entity extraction | ✅ Stable | [API](docs/api/typescript.md#parser) |
|
|
289
|
-
| `@ifc-lite/geometry` | Geometry processing bridge | ✅ Stable | [API](docs/api/typescript.md#geometry) |
|
|
290
|
-
| `@ifc-lite/renderer` | WebGPU rendering pipeline | ✅ Stable | [API](docs/api/typescript.md#renderer) |
|
|
291
|
-
| `@ifc-lite/cache` | Binary cache for instant loading | ✅ Stable | [API](docs/api/typescript.md#cache) |
|
|
292
|
-
| `@ifc-lite/query` | Fluent & SQL query system | 🚧 Beta | [API](docs/api/typescript.md#query) |
|
|
293
|
-
| `@ifc-lite/data` | Columnar data structures | ✅ Stable | [API](docs/api/typescript.md#data) |
|
|
294
|
-
| `@ifc-lite/spatial` | Spatial indexing & culling | 🚧 Beta | [API](docs/api/typescript.md#spatial) |
|
|
295
|
-
| `@ifc-lite/export` | Export (glTF, Parquet, etc.) | 🚧 Beta | [API](docs/api/typescript.md#export) |
|
|
296
|
-
|
|
297
|
-
## Rust Crates
|
|
298
|
-
|
|
299
|
-
| Crate | Description | Status | Docs |
|
|
300
|
-
|-------|-------------|--------|------|
|
|
301
|
-
| `ifc-lite-core` | STEP/IFC parsing | ✅ Stable | [docs.rs](https://docs.rs/ifc-lite-core) |
|
|
302
|
-
| `ifc-lite-geometry` | Mesh triangulation | ✅ Stable | [docs.rs](https://docs.rs/ifc-lite-geometry) |
|
|
303
|
-
| `ifc-lite-wasm` | WASM bindings | ✅ Stable | [docs.rs](https://docs.rs/ifc-lite-wasm) |
|
|
304
|
-
|
|
305
|
-
## Community Projects
|
|
306
|
-
|
|
307
|
-
Projects built by the community using IFClite (not officially maintained):
|
|
308
|
-
|
|
309
|
-
| Project | Author | Description |
|
|
310
|
-
|---------|--------|-------------|
|
|
311
|
-
| [bimifc.de](https://bimifc.de/) | [@holg](https://github.com/holg) | Pure Rust/Bevy IFC viewer, no TypeScript needed |
|
|
107
|
+
## Exports
|
|
312
108
|
|
|
313
|
-
|
|
109
|
+
| Class | Purpose |
|
|
110
|
+
|---|---|
|
|
111
|
+
| `IfcAPI` | Top-level parser entry point — `parse`, `parseMeshes`, `parseMeshesAsync`, `parseToGpuGeometry`, `parseZeroCopy`, `getGeoReference`, `extractProfiles`, `parseSymbolicRepresentations`, … |
|
|
112
|
+
| `MeshCollection`, `MeshDataJs` | Tessellated geometry output |
|
|
113
|
+
| `MeshCollectionWithRtc`, `RtcOffsetJs` | Mesh collection with relative-to-centre offset for large-coordinate models |
|
|
114
|
+
| `InstancedMeshCollection`, `InstancedGeometry`, `InstanceData` | Instanced geometry path (deduplicated meshes + per-instance transforms) |
|
|
115
|
+
| `ZeroCopyMesh`, `GpuGeometry`, `GpuMeshMetadata` | Zero-copy GPU upload handles |
|
|
116
|
+
| `GpuInstancedGeometry`, `GpuInstancedGeometryCollection`, `GpuInstancedGeometryRef` | Zero-copy instanced path |
|
|
117
|
+
| `GeoReferenceJs` | Georeferencing transform |
|
|
118
|
+
| `ProfileCollection`, `ProfileEntryJs` | Cross-section profile data (extruded-area solids) |
|
|
119
|
+
| `SymbolicRepresentationCollection`, `SymbolicCircle`, `SymbolicPolyline` | 2D symbolic representations (for plan / annotation views) |
|
|
314
120
|
|
|
315
|
-
|
|
121
|
+
All classes implement `free()` and `[Symbol.dispose]()` — call `free()` (or use `using`) to release Rust-side memory.
|
|
316
122
|
|
|
317
|
-
|
|
123
|
+
## When to use a higher-level package instead
|
|
318
124
|
|
|
319
|
-
|
|
|
320
|
-
|
|
321
|
-
| [
|
|
322
|
-
| [
|
|
323
|
-
| [
|
|
125
|
+
| You want… | Use |
|
|
126
|
+
|---|---|
|
|
127
|
+
| A typed, idiomatic TS API for parsing | [`@ifc-lite/parser`](../parser/README.md) |
|
|
128
|
+
| Streaming geometry with worker support | [`@ifc-lite/geometry`](../geometry/README.md) |
|
|
129
|
+
| WebGPU rendering | [`@ifc-lite/renderer`](../renderer/README.md) |
|
|
130
|
+
| To avoid managing WASM lifecycles by hand | Any of the above |
|
|
324
131
|
|
|
325
|
-
|
|
326
|
-
# Fork and clone
|
|
327
|
-
GIT_LFS_SKIP_SMUDGE=1 git clone https://github.com/YOUR_USERNAME/ifc-lite.git
|
|
328
|
-
|
|
329
|
-
# Create a branch
|
|
330
|
-
git checkout -b feature/my-feature
|
|
132
|
+
## Rust source
|
|
331
133
|
|
|
332
|
-
|
|
333
|
-
pnpm test
|
|
134
|
+
This package ships the bindings only. The Rust source lives in [`rust/wasm-bindings/`](https://github.com/louistrue/ifc-lite/tree/main/rust/wasm-bindings) and the core in [`rust/core/`](https://github.com/louistrue/ifc-lite/tree/main/rust/core). Available on crates.io as `ifc-lite-core`.
|
|
334
135
|
|
|
335
|
-
|
|
336
|
-
pnpm changeset
|
|
136
|
+
## API
|
|
337
137
|
|
|
338
|
-
|
|
339
|
-
```
|
|
138
|
+
See the [WASM API Reference](https://louistrue.github.io/ifc-lite/api/wasm/).
|
|
340
139
|
|
|
341
140
|
## License
|
|
342
141
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
## Acknowledgments
|
|
346
|
-
|
|
347
|
-
- Built with [nom](https://github.com/rust-bakery/nom) for parsing
|
|
348
|
-
- [earcutr](https://github.com/nickel-org/earcutr) for polygon triangulation
|
|
349
|
-
- [nalgebra](https://nalgebra.org/) for linear algebra
|
|
350
|
-
- [wasm-bindgen](https://rustwasm.github.io/wasm-bindgen/) for Rust/JS interop
|
|
351
|
-
|
|
352
|
-
---
|
|
353
|
-
|
|
354
|
-
<p align="center">
|
|
355
|
-
Made with ❤️ for the AEC industry
|
|
356
|
-
</p>
|
|
142
|
+
[MPL-2.0](https://mozilla.org/MPL/2.0/)
|
package/package.json
CHANGED
package/pkg/ifc-lite.d.ts
CHANGED
|
@@ -1194,9 +1194,9 @@ export interface InitOutput {
|
|
|
1194
1194
|
readonly profileentryjs_expressId: (a: number) => number;
|
|
1195
1195
|
readonly symboliccircle_expressId: (a: number) => number;
|
|
1196
1196
|
readonly __wbg_gpuinstancedgeometryref_free: (a: number, b: number) => void;
|
|
1197
|
-
readonly
|
|
1198
|
-
readonly
|
|
1199
|
-
readonly
|
|
1197
|
+
readonly __wasm_bindgen_func_elem_1151: (a: number, b: number, c: number) => void;
|
|
1198
|
+
readonly __wasm_bindgen_func_elem_1150: (a: number, b: number) => void;
|
|
1199
|
+
readonly __wasm_bindgen_func_elem_1190: (a: number, b: number, c: number, d: number) => void;
|
|
1200
1200
|
readonly __wbindgen_export: (a: number) => void;
|
|
1201
1201
|
readonly __wbindgen_export2: (a: number, b: number, c: number) => void;
|
|
1202
1202
|
readonly __wbindgen_export3: (a: number, b: number) => number;
|
package/pkg/ifc-lite.js
CHANGED
|
@@ -212,12 +212,12 @@ if (!('encodeInto' in cachedTextEncoder)) {
|
|
|
212
212
|
|
|
213
213
|
let WASM_VECTOR_LEN = 0;
|
|
214
214
|
|
|
215
|
-
function
|
|
216
|
-
wasm.
|
|
215
|
+
function __wasm_bindgen_func_elem_1151(arg0, arg1, arg2) {
|
|
216
|
+
wasm.__wasm_bindgen_func_elem_1151(arg0, arg1, addHeapObject(arg2));
|
|
217
217
|
}
|
|
218
218
|
|
|
219
|
-
function
|
|
220
|
-
wasm.
|
|
219
|
+
function __wasm_bindgen_func_elem_1190(arg0, arg1, arg2, arg3) {
|
|
220
|
+
wasm.__wasm_bindgen_func_elem_1190(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
221
221
|
}
|
|
222
222
|
|
|
223
223
|
const GeoReferenceJsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -3093,7 +3093,7 @@ function __wbg_get_imports() {
|
|
|
3093
3093
|
const a = state0.a;
|
|
3094
3094
|
state0.a = 0;
|
|
3095
3095
|
try {
|
|
3096
|
-
return
|
|
3096
|
+
return __wasm_bindgen_func_elem_1190(a, state0.b, arg0, arg1);
|
|
3097
3097
|
} finally {
|
|
3098
3098
|
state0.a = a;
|
|
3099
3099
|
}
|
|
@@ -3207,7 +3207,7 @@ function __wbg_get_imports() {
|
|
|
3207
3207
|
};
|
|
3208
3208
|
imports.wbg.__wbindgen_cast_782a03ac5d769879 = function(arg0, arg1) {
|
|
3209
3209
|
// Cast intrinsic for `Closure(Closure { dtor_idx: 151, function: Function { arguments: [Externref], shim_idx: 152, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
3210
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
3210
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_1150, __wasm_bindgen_func_elem_1151);
|
|
3211
3211
|
return addHeapObject(ret);
|
|
3212
3212
|
};
|
|
3213
3213
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|