@ifc-lite/wasm 3.0.1 → 3.0.3
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 +8 -7
- package/package.json +1 -1
- package/pkg/ifc-lite_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -12,9 +12,10 @@ npm install @ifc-lite/wasm
|
|
|
12
12
|
|
|
13
13
|
## Direct WASM use
|
|
14
14
|
|
|
15
|
-
The text-based
|
|
16
|
-
(a `string`) — decode the buffer first
|
|
17
|
-
`
|
|
15
|
+
The text-based entity scanner (`scanEntitiesFast`) takes the raw IFC text
|
|
16
|
+
(a `string`) — decode the buffer first; `scanEntitiesFastBytes` takes the raw
|
|
17
|
+
`Uint8Array` bytes directly. The geometry methods (`buildPrePassOnce`,
|
|
18
|
+
`processGeometryBatch`, see below) also take the raw `Uint8Array` bytes.
|
|
18
19
|
|
|
19
20
|
```typescript
|
|
20
21
|
import init, { IfcAPI } from '@ifc-lite/wasm';
|
|
@@ -25,9 +26,9 @@ const api = new IfcAPI();
|
|
|
25
26
|
const buffer = await fetch('model.ifc').then(r => r.arrayBuffer());
|
|
26
27
|
const content = new TextDecoder().decode(buffer);
|
|
27
28
|
|
|
28
|
-
//
|
|
29
|
-
const
|
|
30
|
-
console.log(`Entities: ${
|
|
29
|
+
// Fast entity scan — returns an array of entity references
|
|
30
|
+
const refs = api.scanEntitiesFast(content);
|
|
31
|
+
console.log(`Entities: ${refs.length}`);
|
|
31
32
|
|
|
32
33
|
api.free(); // free the API instance
|
|
33
34
|
```
|
|
@@ -78,7 +79,7 @@ api.free(); // release the API instance when done
|
|
|
78
79
|
|
|
79
80
|
| Class | Purpose |
|
|
80
81
|
|---|---|
|
|
81
|
-
| `IfcAPI` | Top-level entry point — `
|
|
82
|
+
| `IfcAPI` | Top-level entry point — `scanEntitiesFast` / `scanEntitiesFastBytes` / `scanGeometryEntitiesFast`, `buildPrePassOnce` / `buildPrePassStreaming`, `processGeometryBatch`, `extractProfiles`, `parseSymbolicRepresentations` |
|
|
82
83
|
| `MeshCollection`, `MeshDataJs` | Tessellated geometry output |
|
|
83
84
|
| `ProfileCollection`, `ProfileEntryJs` | Cross-section profile data (extruded-area solids) |
|
|
84
85
|
| `SymbolicRepresentationCollection`, `SymbolicCircle`, `SymbolicPolyline` | 2D symbolic representations (for plan / annotation views) |
|
package/package.json
CHANGED
package/pkg/ifc-lite_bg.wasm
CHANGED
|
Binary file
|