Expand description
S5.8 — the asset cache + real-mesh acquisition path (user-triggered).
The interim visual (anatomy_render.rs) renders a coloured silhouette because the real 3D body needs
~200–290 MB of CCF/HRA GLB downloads with no cache. This module is the user-triggered acquisition +
cache: when the person clicks “Download body assets” in the Studio UI, the host discovers the
reference-organ manifest from the HRA SPARQL endpoint, fetches each GLB from its CDN URL, compiles it
to a sealed .10d (via anatomy_body::compile_body), and writes both the raw GLB and the compiled
.10d to a gitignored cache under {storage_root}/assets/ccf/{model}/. Subsequent runs load the
cached .10d directly — no re-download. The cache is the person’s own, generated on demand.
The discover/fetch are blocking network I/O (reqwest blocking, off the async runtime via
spawn_blocking in the desktop command). The compile is pure CPU. Progress is reported per organ so
the UI can show a real progress bar. Everything is honest about what did and did not cache — failed
fetches/compiles are reported, never silently dropped.
Structs§
- Acquire
Progress - Per-organ progress reported during acquisition — drives the UI progress bar.
- Acquire
Report - The final report from an acquisition run — honest about what did and did not cache.
- Body
Assets Status - The status of a model’s cache — what the UI shows to decide “download” vs “view”.
- Cache
Manifest - The cache manifest — records what was acquired, when, and from where.
- Cached
Organ Entry - One entry in the cache manifest — a cached organ with its source URL + sizes.
Functions§
- acquire_
body_ assets - Acquire + cache the body assets for a model — user-triggered, blocking network I/O. Discovers the
reference-organ manifest from the HRA SPARQL endpoint, fetches each GLB, compiles it to
.10d, and writes both + a manifest to the cache. Progress is reported viaprogressper organ. Failed fetches/compiles are reported in the result, never silently dropped. The cache directory is created on demand; an existing cache is refreshed (re-fetched + re-compiled) so the person can update. - acquire_
body_ assets_ controlled - Cancellable form used by the desktop job centre. Cancellation is checked between remote fetches and before/after the bounded compile phase, so a request never leaves a half-written manifest.
- cache_
dir - The cache root for a model:
{storage_root}/assets/ccf/{model}/. - cached_
organ_ keys - The cached organ keys for a model (empty if not cached).
- clear_
cache - Delete the cache for a model (idempotent — no-op if not cached).
- glb_
path - Where a raw GLB is cached:
{cache_dir}/glb/{organ_key}. - is_
cached - Whether the cache is present and complete (manifest exists + every referenced
.10dis on disk). - load_
cached_ 10d - Load a cached
.10dfor one organ. ReturnsErrif not cached or the file is unreadable. - load_
manifest - Load the cache manifest, or
Noneif not cached. - manifest_
path - Where the cache manifest lives:
{cache_dir}/manifest.json. - status
- The status of a model’s cache (cached = manifest present + every referenced
.10don disk). - ten_
d_ path - Where a compiled
.10dis cached:{cache_dir}/10d/{organ_key}.10d.