bimatter-viewer-react 0.5.2 → 0.5.4
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 +10 -1
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ models/
|
|
|
85
85
|
architecture.ifc
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
-
For
|
|
88
|
+
For main-thread IFC loading you need to copy ifc parser wasm file into your public folder. You can take it from bimatter-viewer-react/public/ifc-parser.wasm or by command:
|
|
89
89
|
|
|
90
90
|
```bash
|
|
91
91
|
cp node_modules/bimatter-viewer-react/public/ifc-parser.wasm public/ifc-parser.wasm
|
|
@@ -169,6 +169,15 @@ const models = await loader.loadModel(["/models/model.ifc"], {
|
|
|
169
169
|
});
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
+
IFC worker loading includes the default parser wasm in the package, so `wasmPath` is optional. Pass it only when you want to use your own hosted wasm file:
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
await loader.loadModel(["/models/model.ifc"], {
|
|
176
|
+
useWorker: true,
|
|
177
|
+
wasmPath: "/ifc-parser.wasm",
|
|
178
|
+
});
|
|
179
|
+
```
|
|
180
|
+
|
|
172
181
|
For IFC, `chunk` controls how many geometries are packed before a streamed mesh is emitted. For BMT, chunks are read as they are already stored in the file.
|
|
173
182
|
|
|
174
183
|
When you render chunks yourself in `onChunk`, set `collectWorkerChunks: false` to avoid keeping the same streamed geometry in the loader helper until the final result:
|