@ifc-lite/cache 2.1.0 → 2.1.1
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 +6 -2
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -46,8 +46,8 @@ If you already have a GLB blob (from a server, S3, etc.), skip the binary cache
|
|
|
46
46
|
```typescript
|
|
47
47
|
import { loadGLBToMeshData, parseGLB } from '@ifc-lite/cache';
|
|
48
48
|
|
|
49
|
-
const meshes =
|
|
50
|
-
//
|
|
49
|
+
const meshes = loadGLBToMeshData(new Uint8Array(glbBuffer)); // synchronous
|
|
50
|
+
// MeshData[] ready to feed into @ifc-lite/renderer
|
|
51
51
|
|
|
52
52
|
// Or get the parsed GLB structure if you need lower-level access
|
|
53
53
|
const { json, bin } = parseGLB(glbBuffer);
|
|
@@ -66,6 +66,10 @@ const rawKey = xxhash64(buffer); // same hash as a bigint
|
|
|
66
66
|
|
|
67
67
|
The cache keys models by the xxHash64 of the source IFC, and `reader.validate(cacheBuffer, sourceBuffer)` uses the same hash to detect when the source has changed.
|
|
68
68
|
|
|
69
|
+
## Format versioning
|
|
70
|
+
|
|
71
|
+
The binary layout is versioned via the exported `FORMAT_VERSION` constant. Readers accept entries written by the current or an older format version (with backward-compatible decoding, e.g. the per-mesh geometry-class byte added in v5) and reject entries written by a newer one, so mixed-version deployments fail safely toward a cold parse.
|
|
72
|
+
|
|
69
73
|
## Source-hash contract (and `omitSourceHash`)
|
|
70
74
|
|
|
71
75
|
By default the header stores the full-file `xxhash64` of the source in `sourceHash`, and `reader.validate()` / `read({ sourceBuffer })` compare against it. Hashing a large source can be a multi-second main-thread cost, so a caller that validates the source **another way** (e.g. an application-layer content hash plus a file modified-time guard, as the viewer's source-decoupled cache tier does) can pass `omitSourceHash: true`:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/cache",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "Binary cache format for IFC-Lite - fast model loading",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ifc-lite/data": "^2.
|
|
17
|
-
"@ifc-lite/geometry": "^3.1.
|
|
16
|
+
"@ifc-lite/data": "^2.5.1",
|
|
17
|
+
"@ifc-lite/geometry": "^3.1.3"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"typescript": "^6.0.3",
|