Skip to content

3D Anatomy Rendering ​

The body in the center of the Astronaut Health Intelligence Platform (AHI) is a real anatomical atlas: the open Z-Anatomy model, prepared in Blender and shipped as one compressed glTF binary (GLB) per anatomical system. The viewer (three.js with React Three Fiber) loads the systems on demand, shades them by tissue class and lets the user select any of its 250 structures. Health status, alerts and live vitals are drawn on top of the anatomy.

If the atlas cannot load, the viewer switches automatically to the earlier procedural model (generated in code), so the dashboard always has a body to show.

Code: frontend/web/src/features/anatomy/. The page data (status per region, live heart rate and breathing rate) is SIMULATED and DERIVED. The geometry is not health data: it is a third party reference asset with its own license, documented in 3D anatomy assets.

The 3D body in the center of the Ground view with a body system selected and its detail in the right panel

One reference body for everyone

The atlas is a single adult reference model, shown for every crew member. It is not a scan of the astronaut and it shows no individual anatomy. Status colors come from the simulated health data, never from the model.

Source model and why ​

QuestionAnswer
Which modelZ-Anatomy, "the libre 3D atlas of anatomy", itself based on BodyParts3D
LicenseCC BY-SA 4.0, so the derived files can be redistributed with attribution
Why this oneA whole body with named structures organized by anatomical system, which is what layers, selection and the health mapping need; a Blender source that can be processed headless and reproducibly
What AHI changedKept only physical bodies, grouped about 2,230 source objects into 250 structures, decimated, moved to the viewer frame and compressed
What AHI left outNon commercial upstream items (ear, kidney), reproductive structures (neutral reference body), labels and helpers

Full provenance, the required attribution lines, the list of modifications and the exclusions are in 3D anatomy assets.

Asset pipeline ​

The published files are generated, never edited by hand. One command (npm run anatomy:build, about 4 to 5 minutes) runs the whole chain.

StepScript (frontend/web/scripts/anatomy/)Result
1. Sourcefetch-source.mjsDownloads the archive from one allowed host, checks the SHA-256, extracts Startup.blend into a cache folder ignored by git
2. Blender exportexport_atlas.pySelects the real bodies, converts vessel and nerve curves to tubes, groups, decimates, moves to the atlas frame, writes one raw GLB per system
3. Kidneysbuild-kidneys.tsAHI procedural kidneys (the upstream kidney model is not redistributable)
4. Optimizeoptimize.mjsglTF Transform: dedup, weld, prune, quantized normals, meshopt compression; writes manifest.json
5. Validatevalidate.mjs (npm run anatomy:validate)Checks the published files against the manifest contract
Optionaldecode-for-preview.mjs, render_previews.pyPreview sheets of the published files (--previews)

Blender runs with --factory-startup --disable-autoexec, so scripts embedded in the source file never run. Prerequisites and options: 3D anatomy assets.

Manifest contract ​

public/anatomy/manifest.json is the contract between the pipeline, the viewer and the health mapping. Its type is AtlasManifest in src/features/anatomy/atlas/types.ts. The manifest holds anatomy facts only; which region and metrics relate to a structure is decided in code (Anatomy to health mapping).

Manifest fieldContent
versionBumped when ids or files change in an incompatible way (currently 1)
generatedAtBuild time (ISO 8601)
boundsWhole body extent in the atlas frame, in meters
sourcename, url, license, sha256 of the source archive, retrievedAt, attribution lines, excluded (upstream content left out, with the reason)
systemsOne entry per file: id, label, file, bytes, triangles, structureCount
structuresOne AtlasStructure per selectable structure
AtlasStructure fieldTypeMeaning
idstringStable kebab-case id, unique in the atlas. It is also the GLB node name, for example femur-left
namestringEnglish anatomical name for display, for example "Left femur"
systemAnatomySystemIdintegumentary, skeletal, muscular, cardiovascular, respiratory, nervous, digestive, urinary or other. Also the unit of lazy loading
tissueTissueClassDrives the viewer material (19 classes, see Materials)
side'L', 'R' or nullPaired structures carry their side; midline and merged structures are null
center, min, max[x, y, z]Bounding box center and extents in the atlas frame (meters). Used for camera framing and label anchors
trianglesnumberTriangle count of the mesh
sourceObjectsstring[]Names of the source objects merged into the structure (provenance and debugging)
origin'z-anatomy' or 'ahi-procedural'Where the geometry comes from. The two kidneys are ahi-procedural
parentstring, optionalId of a larger structure this one belongs to (three cases: coronary arteries and cardiac veins belong to heart, the deep structures of the cerebrum belong to brain)

The application relies on seven ids, listed in REQUIRED_STRUCTURE_IDS: skin, heart, lung-left, lung-right, brain, kidney-left, kidney-right. Everything else is discovered from the manifest at run time. manifest.contract.test.ts validates the real manifest and every GLB against this contract in the unit tests.

Coordinate frame of every file: meters, Y up, body facing +Z, feet on y = 0, centered on x = 0 and z = 0. Anatomical left is +X. Every structure is one mesh node with an identity transform.

Systems and files ​

Numbers read from manifest.json (build of 2026-11-14). MB means bytes divided by 1,048,576.

SystemFileStructuresTrianglesBytesMB
integumentaryintegumentary.glb148,503256,6840.24
skeletalskeletal.glb41184,971995,6400.95
muscularmuscular.glb133299,8181,737,7001.66
cardiovascularcardiovascular.glb2989,893527,1000.50
respiratoryrespiratory.glb644,991235,0560.22
nervousnervous.glb17133,356694,5960.66
digestivedigestive.glb1041,990228,0160.22
urinaryurinary.glb410,82657,6760.06
otherother.glb926,008135,7080.13
Total9 files250880,3564,868,1764.64

What each system holds:

SystemContent
integumentaryskin: the whole body surface as one structure
skeletalSkull, mandible, teeth, vertebrae by region, ribs, sternum, cartilages and the limb bones per side (hand and foot bones merged)
muscular64 structures per side (large muscles one by one, small ones merged by group) plus 5 midline groups
cardiovascularHeart, coronary arteries, cardiac veins, great vessels, arteries and veins by body region
respiratoryLungs, trachea, bronchi, larynx, diaphragm
nervousBrain (cortex), deep structures of the cerebrum, cerebellum, brainstem, spinal cord and the nerves by region
digestiveTongue, salivary glands, pharynx, esophagus, stomach, intestines, liver, gallbladder, pancreas
urinaryKidneys (procedural), ureters, urinary bladder
otherEyes, thyroid, pituitary, pineal, adrenal glands, thymus, spleen

Component map ​

Everything lives in frontend/web/src/features/anatomy/. The public API did not change with the atlas: AnatomyViewer({ className, showControls, autoRotate, bloom, labelScale, compact, legend }).

File or folderRole
AnatomyViewer.tsxEntry point. Chooses the atlas viewer or the procedural fallback, inside an error boundary
atlas/types.tsManifest contract (AtlasManifest, AtlasStructure, REQUIRED_STRUCTURE_IDS)
atlas/manifest.tsLoads and caches the manifest (loadAtlasManifest, useAtlasManifest). No three.js
atlas/health.tsThe only place that links anatomy to health data. Pure TypeScript, unit tested
viewer/AtlasViewer.tsxCanvas, overlays (tooltip, loading, legend, controls, caption), quality tiers
viewer/AtlasScene.tsxLazy loading of the visible systems, picking, per frame driver
viewer/runtime.tsImperative three.js side: one mesh per structure, states, heart and lung motion
viewer/tissueMaterials.tsOne material per tissue class, plus the shader patch for the viewer states
viewer/Studio.tsxLighting, environment, floor and contact shadow
viewer/AtlasCamera.tsxOrbit controls, fly-to, preset views, idle rotation; reports its azimuth to the backdrop parallax
viewer/autoRotate.tsPure rule that decides when the idle rotation runs (unit tested)
viewer/SystemControls.tsxLayers popover, skin opacity, presets, view buttons, reset
viewer/Attribution.tsxPersistent source caption and the "About the reference anatomy" popover
viewer/layers.tsLayers derived from the manifest, presets, camera focus, label anchors
viewer/atlasLoader.tsGLB download with byte progress, meshopt decoding, session cache
viewer/atlasStore.tsLocal view state (hover, layers, skin opacity, camera requests) and lab switches
procedural/The previous procedural viewer (signed distance fields polygonized with Surface Nets, built in Web Workers), kept as the automatic fallback
Labels.tsx, Legend.tsx, regions.ts, hooks.tsShared by both viewers: floating labels, status legend, region configuration
lab.tsx (with anatomy-lab.html)Development lab page

The panel that describes a selected structure is outside this folder: src/features/attention/StructureDetail.tsx and RegionEvents.tsx (Product tour). The mission backdrop behind the canvas lives in src/features/mission/backdrops/ (Mission backdrop).

Loading strategy and offline constraint ​

DecisionDetail
Lazy chunkThe whole viewer is loaded with a dynamic import() from the center stage
Manifest firstmanifest.json is fetched once per session. While it loads the viewer says "Loading reference anatomy"
Default systems preloadedAs soon as the manifest is known, the files of the default layers start downloading, before the canvas mounts. That is every file except muscular.glb: 8 files, about 3.0 MB
On demandmuscular.glb (1.66 MB) is fetched the first time the muscle layer is needed (selected, in alert or switched on)
ProgressStreamed fetch with byte progress; totals come from the sizes in the manifest. The first load shows a progress card, later loads a small pill at the top
Session cacheParsed geometry is cached for the whole session, so switching astronaut or remounting the viewer never downloads or parses a file twice. Only positions and normals are kept on the GPU
ValidationA response that is not a GLB (for example an HTML page returned for a missing file) is rejected before parsing

Offline constraint. The demo must work without internet access, so every file comes from the app's own server. The viewer requests only files under its own /anatomy/ folder: the meshopt decoder is the one bundled with three.js (no Draco, no decoder from a CDN) and the lighting environment is built in code (no remote HDR image).

Materials by tissue class ​

The upstream model has flat colors and no textures. The viewer assigns one physically based material per tissue class (TISSUE in tissueMaterials.ts); surface detail comes from geometry and lighting.

Tissue classesLook
skinTranslucent, with a depth pre-pass so the skin never blends with itself. Opacity is set by the user (default 22%)
bone, airway, glandMatte standard material in the natural tissue color
muscle, tendon, lungSoft fiber or velvet like reflection at grazing angles (sheen)
cartilage, tooth, heart, brain, liver, kidney, gut, eye, organThin wet layer on top (clearcoat), strongest on the eyes
artery, vein, nerveRed, blue and yellow thin tubes, pushed outward in proportion to the view distance so they stay readable in a full body shot and keep their true caliber in a close up

Tissue colors are a reference anatomy look, not a status encoding. Materials are shared: one instance per tissue, body region and variant (solid, ghost, hover, selected). A small shader patch adds the viewer states on top of the standard lighting through shared uniforms, so one write per region per frame updates every material.

Lighting and rendering ​

ElementDetail
EnvironmentProcedural environment map built from six light panels (drei Lightformer), rendered once
LightsA key light that casts shadows, a fill light and two rim lights, plus a faint hemisphere light. The rig turns with the camera, so every preset view is lit the same way
ShadowsThe shadow map is refreshed only when the rig has turned a little or the content changed, never per frame. A contact shadow under the feet is redrawn only when the content changes
FloorA soft pool of light with thin measurement rings
Tone mappingACES filmic
Post processingBloom only above luminance 1 (status highlights), then tone mapping. Can be disabled with the bloom prop
Quality tiershigh: device pixel ratio up to 1.75, 4x multisampling, shadows. low: pixel ratio 1, 2x multisampling, no shadows. The viewer drops to low when the performance monitor reports a decline
IntroA band of light sweeps up the body once when the first geometry arrives

Interaction ​

  • Orbit (rotate, bounded pan) with damping. The orbit target never leaves the body.
  • Zoom to the pointer: the mouse wheel, a trackpad and a two finger pinch zoom toward the point under the pointer (or between the fingers), so what you aim at stays under the cursor while it grows; rotating afterwards pivots around the zoomed area. The distance limits are kept. Custom code in viewer/zoom.ts replaces the default orbit dolly; middle button drag zoom is no longer available.
  • Preset views: Front, Back, Left and Right (the body's own left and right), with an animated transition.
  • Reset: frames the whole body again and clears the selection.
  • Idle rotation (viewer/autoRotate.ts): the body turns slowly while nobody touches it. Any pointer down, drag, wheel or touch stops it, and it resumes 3 seconds after the last interaction. It also stays still while a structure or region is selected (the selected organ must not turn away), while a structure is hovered and during a camera fly-to, and resumes 3 seconds after the selection is cleared. Embeds can turn it off with the autoRotate prop.
  • Whole body shots are fitted to the free height between the top margin and the controls, and fitted again when the container resizes.

Monitor and Explore modes ​

A compact button in the viewer controls switches between two modes. The choice is remembered per device (localStorage key ahi.anatomy.interactionMode; blocked storage falls back to Monitor).

ModeWhat reacts to hover and clickOther structures
Monitor (default)Only structures that report under a monitored body regionContext only anatomy is drawn quieter (desaturated, dimmer) and the pointer passes through it, so a click reaches the monitored organ behind
ExploreEvery structureContext only structures open the "Context only" card, for anatomical reference

Monitor keeps the demo focused on what is measured; Explore keeps the atlas useful for learning.

Keyboard body navigator ​

The canvas is reachable with Tab as the body navigator (aria-roledescription="body navigator"). Up and Down move between monitored regions, Left and Right between the structures of the region, Home and End jump to the first or last, Enter selects and Esc clears. Every move is announced in an aria-live region, for example "Heart region. Status: Nominal."; a region without readings is announced as "no data". Pointer use is unchanged. See also Accessibility.

Selection ​

  • Hover (not on touch screens) shows a tooltip with the structure name, its system, the status of its region and a key value, or "Not monitored" for context only structures.
  • Click selects a structure. The camera flies to it from its own side of the body, everything else turns into a see-through ghost and the right panel opens the structure detail. Clicking the selected structure again, or empty space, clears the selection. Esc goes back.
  • Body system chips beside the body select a whole region instead of one structure.
  • The viewer calls selectStructure(id, regionOfStructure(structure)) on the app store. The selection contract is documented in Data model.

Layers and skin opacity ​

The Layers popover lists one toggle per anatomical system found in the manifest, with the structure count in its tooltip.

LayerDefaultNotes
SkinonTranslucent. The Skin opacity slider goes from 0 to 100% (default 22%)
MuscularautomaticAppears when muscles are selected or their region is in alert
Skeletal, Cardiovascular, Respiratory, Digestive, Urinaryon
NervousonBrain, cerebellum, brainstem and spinal cord
NervesoffPeripheral nerves are a separate layer because they are visually busy and context only
OtheroffGlands, thymus, spleen
Eyesfollows Skin and OtherNo toggle of its own, so open eyelids never show empty sockets
  • Presets: Default, Organs, Skeleton, Muscles and All. Each one sets the layers and a matching skin opacity.
  • The layer of the selected region or structure is always visible, whatever the toggles say.
  • In narrow containers the controls collapse to a compact pill and the view buttons move into the popover.

Visual states ​

Status colors are the same STATUS_META colors used everywhere in the app (Design system). Region status comes from the engine (Risk assessment).

StateWhat you seeMeaning
NormalNatural tissue color, no highlightThe region is nominal (LOW), or the structure is context only
HoveredCyan tint and a tooltipThe structure under the pointer. Click to select
SelectedCyan rim on the selection; every other structure becomes a faint blue ghost and the skin fadesFocus on one structure or one region. Ghosting is a viewing aid, not a status
Related to alertStatus colored rim that pulses (amber MODERATE, orange HIGH, red CRITICAL, stronger and faster with severity); monitored organs also get a glow that shows through the rib cage, and the body wall in front of them turns see-throughThe region the structure reports under is not nominal. The color marks the region, not a finding in that structure
Data unavailableDesaturated grey tissue, no pulse; heart or lungs stop movingThe region is NO_DATA. Missing data is never drawn as normal
  • When a region status changes, a short scan pulse (an expanding wavefront in the status color) starts from that region. It does not fire on first load or when switching crew member.
  • Whole body systems (skin, muscles, skeleton) glow less than single organs, because hundreds of structures light up at once.
  • Context only structures (digestive organs, glands, nerves and others) never show a status color.

Eyes and ears

The eyes are two atlas structures (eye-left, eye-right) and report under the eyes region, fed by periodic simulated eye exams (SANS monitoring). The atlas has no ear geometry (the inner ear is excluded for license reasons), so two small status colored rings on the sides of the head mark the ears region (hearing tests and noise). The rings are visual only; the ears are selected from their chip, label or the keyboard navigator. Details: Eye health and hearing.

Body scan ​

A bright band of light sweeps the body from head to feet every 6.5 s (the sweep itself takes 2.4 s), then rests. It is drawn by the shared tissue shader with two uniforms, so it adds no draw call and no extra pass. Any point of the body is crossed once per cycle, far below three flashes per second, and the band fades in and out. With prefers-reduced-motion the sweep is slow and dim.

Measured by the team on the same integrated GPU as below (AMD Radeon Vega 8): no frame rate loss and the same 119 draw calls with the scan on. This is one observation on one machine, not a benchmark.

Mission backdrop ​

The 3D stage (Ground view and Crew view) shows a scene of the active mission profile behind the body: one SVG per profile, placed behind the transparent WebGL canvas, so it costs no draw call. The scenery stays at the edges, the horizon and the sky; a dim layer behind the body and a vignette keep the anatomy and its status colors readable. A profile change crossfades in 0.6 s.

The camera reports its orbit angle every frame; parallax.ts writes it as a CSS variable (--stage-az) on the backdrop, which shifts by at most 18 px. No React render and no WebGL work is involved. Under prefers-reduced-motion the backdrop is static. The facts in its chip come from the cited profile table (Mission backdrops).

Live physiology ​

The scene reads the selected astronaut's live heart rate and breathing rate from the store every frame, without subscribing, so the animation never causes React re-renders.

StructureDriven byHow
Heart, with the coronary arteries and cardiac veinsLive HEART_RATEThe beat phase advances by HR / 60 per second. Each beat is a "lub dub" curve (S1, then S2 at about 30% of the period); the heart scales up by up to 5% around its center
LungsLive RESPIRATORY_RATEThe breath phase advances by RR / 60 per second, about 40% inhale and 60% exhale; the lungs scale by up to about 3 to 4% on three axes

When the heart or lungs region is NO_DATA, or the value is missing, the motion stops. A heart that stops beating during the sensor failure scenario is deliberate.

Picking ​

  • Raycasts run against bounding volume hierarchies built per system (drei Bvh).
  • Hover picking is throttled to one raycast every 45 ms while the pointer moves, and never runs while dragging.
  • Priority: a solid structure wins over a ghosted one, and the translucent skin only counts when nothing else is hit, so inner anatomy stays reachable through it. When the skin is nearly opaque (75% or more) it is picked like any solid surface.
  • A click is a pointer press and release within 6 pixels; a drag never selects.

Labels and legend ​

  • Floating labels appear for every region that is not nominal and for the focused region. They are plain DOM above the canvas, positioned by a projector inside the scene with no React render per frame. Anchors come from the manifest (the organ center, or a fixed spot of the body for whole body systems).
  • Labels use shape, color and words, never color alone.
  • Legend: collapsible, open by default when the viewer is wider than 820 px, with the note "Vs personal baseline. Simulated data."
  • Source caption: "Reference anatomy: Z-Anatomy atlas (CC BY-SA 4.0)" stays visible under the body. Its info button opens the credits and the statement that this is one reference model.
  • In presentation mode labels, tooltip, legend and controls scale up by 1.3.

Performance observations ​

Observations, not benchmarks

The numbers below were observed by the team on one development laptop (AMD Ryzen 5 3500U with integrated Radeon Vega 8 graphics, headless Chrome, frame rate capped at 60 by vsync). They were not repeated on other machines and are not a benchmark. They were taken on the asset build just before the published one, which had about 0.1% more triangles.

SituationFrame rateDraw callsTriangles drawn per frame (all passes)
Lab page, default systems58 to 60 fps119about 578k
Lab page, all systems56 to 59 fps273about 930k
Ground view at 1440x90055 to 57 fps
Crew view58 fps
Ground view with a body system detail open39 to 42 fps
  • With a detail panel open the previous procedural viewer measured 38 fps in the same state, so the panel, not the 3D scene, is the limit there.
  • Hover pick: 0.4 to 2.8 ms per raycast.
  • Atlas on screen 2.4 to 3.6 s after navigation with a warm browser cache.

What keeps it fast:

DecisionEffect
One GLB per system, loaded on demandThe largest file (muscles) is not downloaded for the default view
Meshopt compression, quantized normals4.64 MB for 880k triangles
One mesh per structure, shared materials and uniformsMaterial changes happen on events; per frame work is a few uniform writes and the heart and lung matrices
Cheap unlit ghost shaderDozens of overlapping ghost layers in a close up stay affordable
Shadows rendered on demandNo shadow pass on most frames
Bounds trees and throttled hoverPicking stays in the millisecond range
Shader warm upGhost and alert shaders compile with the first frame, not at the first selection or alert

Fallback and error handling ​

A 3D failure must never break the dashboard.

SituationBehavior
Manifest still loadingMessage "Loading reference anatomy"
Manifest missing, malformed, or without the required structuresProcedural model, with the notice "Reference atlas unavailable. Showing simplified model."
A system that holds a required structure fails to loadSame fallback
An optional system fails to loadEach file is tried up to 4 times, waiting 0.6, 1.8 and 5.4 s between tries; the layer shows "try 2", "try 3" while it retries. If every try fails the body stays and that layer shows retry: it stays clickable and starts a new download
The atlas viewer throws while renderingThe error boundary shows the procedural model
The procedural model also failsMessage "3D body view unavailable"; the rest of the dashboard keeps working

The procedural viewer is a separate lazy chunk, downloaded only when it is needed. It shows the seven body regions with the same status language and live animation, but it has no selectable structures: region selection, chips, alerts and the region detail keep working, and a structure selected earlier is described as unavailable.

Development lab ​

npm run dev also serves a dev only lab page at /anatomy-lab.html. It fakes region statuses and vitals through the store so every visual state can be checked (layers, structure selection, statuses, the forced fallback), and shows renderer statistics: frame rate, draw calls, triangles, pick time and structure count.

Limitations ​

  • One reference model at one scale for every crew member. The source is an adult male model; only the groin was made neutral, so the build, the proportions and the chest remain those of the source. It does not adapt to sex, height or body composition (a female reference model is on the roadmap).
  • No textures: the source has none, so surface detail comes from geometry and materials.
  • The kidneys are simple procedural shapes and sit behind the intestines when seen from the front; selecting the kidneys region flies the camera to the back.
  • Hover is disabled on touch devices (a tap selects).
  • The low quality tier is one way: once the performance monitor has reported a decline the viewer stays in low until it is remounted.
  • The rendering itself has no unit tests. The data layer and the viewer logic have: manifest contract, health mapping, selection, zoom math, interaction modes, retry policy, scan timing and keyboard navigation (Testing strategy). Visual states are checked by hand on the lab page.

Asset limitations (decimation, grouping, missing structures) are listed in 3D anatomy assets. All platform limitations: Limitations and known issues.

How to update the model ​

  1. Follow the rebuild and update procedure in 3D anatomy assets. The full guide, with every rule and option, is anatomy-assets.md in the repository.
  2. Keep structure ids stable. The seven required ids must exist; npm run anatomy:validate and manifest.contract.test.ts fail otherwise.
  3. To change which region a structure reports under, edit atlas/health.ts only (How to map a structure to a region).
  4. Update the numbers on this page from the new manifest.json.

Status ​

Implemented Atlas viewer, structure selection, health mapping, per system lazy loading with retry, zoom to pointer, Monitor and Explore modes, keyboard body navigator, body scan, eye and ear regions and the procedural fallback. Planned Female reference model, textures and a BodyParts3D kidney (Feature status matrix).

Next steps ​

Astronaut Health Intelligence Platform. Decision support only: not a diagnosis and not a medical device. Device data is simulated.