Skip to content

cockpit: fork GeoHelix from BodyHelix — isolate the map/terrain renderer#92

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/ice-iceland-dem
Jul 8, 2026
Merged

cockpit: fork GeoHelix from BodyHelix — isolate the map/terrain renderer#92
AdaWorldAPI merged 1 commit into
mainfrom
claude/ice-iceland-dem

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented Jul 8, 2026

Copy link
Copy Markdown
Owner

Isolation scaffold so incoming map-shader work can't regress the working anatomy body.

The map scenes (/geo, /ice, /garmin/:location) were sharing BodyHelix.tsx with the /helix anatomy body, branching internally via pathScene() / isGeoScene / uGeo. That means map-shader work — hypsometric tint, kurvenlineal brightness, sunset lighting, Ice/Ocean specular — would risk regressing the "already amazing" /helix.

This forks GeoHelix.tsx as a verbatim copy of BodyHelix (exactly as BodyHelix itself was forked from BodyV3 to protect /body, #64) and repoints the three map routes to it. /helix stays on BodyHelix, now completely untouched by any future geo work. Same BSO2 decoder + per-vertex helix-normal Gouraud shading; GeoHelix still resolves scenes via pathScene() from the path.

Behaviourally a no-op todayGeoHelix is a byte-for-byte copy, so /geo / /ice / /garmin render identically. This is purely the isolation scaffold the map-shader improvements (a follow-up PR) land on, so those can iterate freely with zero risk to the anatomy body.

Verify

npx tsc --noEmit clean. Cockpit-only change (not hub-client/), so no changelog entry required.

🤖 Generated with Claude Code

https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC


Generated by Claude Code

Summary by CodeRabbit

  • New Features

    • Added a new 3D viewer for helix, anatomy, and terrain/map scenes.
    • Enabled scene switching for /helix, /geo, /ice, and location-based Garmin views.
    • Added search, layer toggles, click-to-focus, translucency, and adaptive rendering controls.
  • Bug Fixes

    • Improved mesh loading and decoding for multiple data formats.
    • Added safer rendering for older and newer scene data.
    • Updated route handling so the new viewer is used for map and terrain pages.

The map scenes (/geo, /ice, /garmin/:location) were sharing BodyHelix.tsx with
the /helix anatomy body, branching internally via pathScene()/isGeoScene/uGeo.
That means map-shader work (incoming: hypsometric tint, kurvenlineal brightness,
sunset lighting, Ice/Ocean specular) would risk regressing the working anatomy
body — the "already amazing" /helix.

Fork GeoHelix.tsx as a verbatim copy of BodyHelix (exactly as BodyHelix itself
was forked from BodyV3 to protect /body, #64) and repoint the three map routes
to it. /helix stays on BodyHelix, now completely untouched by any future geo
work. Same BSO2 decoder + per-vertex helix-normal Gouraud shading; GeoHelix
still resolves scenes via pathScene() from the path.

Behaviourally a no-op today (GeoHelix is a byte-for-byte copy, so /geo /ice
/garmin render identically) — this is the isolation scaffold the map-shader
improvements land on. tsc --noEmit clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012jEwwaT5JZ5x8qWvcnaMYC
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_61cc0540-9ab7-4402-90fa-c34f1dd4cd1d)

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Introduces GeoHelix.tsx, a Three.js/React viewer decoding Signed360/BSO2 bake formats (grid ver-8 and general legacy versions) with terrain/sky shaders, LOD polling, x-ray toggling, and scene selection. Updates main.tsx to route /geo, /ice, and /garmin/:location to GeoHelix instead of BodyHelix.

Changes

GeoHelix Viewer

Layer / File(s) Summary
Scene resolution and shared helpers
cockpit/src/GeoHelix.tsx
Adds path-to-scene resolution, layer metadata, color utilities, F16 half-float LUT, and Signed360 math helpers (atanh inversion, RollingFloor r-LUT).
Bake decoders
cockpit/src/GeoHelix.tsx
Implements decodeGrid for ver-8 radix-grid bakes and a general decode path for older wire versions, reconstructing positions, normals, colors, indices, and applying per-concept max-diameter clamping.
Terrain, fragment, and sky shaders
cockpit/src/GeoHelix.tsx
Adds vertex shader terrain palette/relief exaggeration, fragment shader for translucency, and procedural sky dome shader for geo scenes.
Scene mounting and asset fetching
cockpit/src/GeoHelix.tsx
Implements mount() for Three.js scene setup (geometry, x-ray, on-demand rendering, orbit/focus picking, LOD polling, cleanup) plus gzip inflation and strict fetchSoa bake-loading policy from /body.manifest.json.
Component and routing wiring
cockpit/src/GeoHelix.tsx, cockpit/src/main.tsx
Defines the GeoHelix component with UI state (layer toggles, x-ray, LOD opt-in, search, scene selection) and updates routes for /geo, /ice, /garmin/:location to render GeoHelix.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Router as main.tsx Router
  participant GeoHelix
  participant fetchSoa
  participant Decoder as decode/decodeGrid
  participant Mount as mount()

  Router->>GeoHelix: navigate to /geo, /ice, or /garmin/:location
  GeoHelix->>fetchSoa: request bake for resolved scene
  fetchSoa->>fetchSoa: read /body.manifest.json, resolve bake name
  fetchSoa->>fetchSoa: fetch + inflate bytes
  fetchSoa-->>GeoHelix: return raw bake buffer
  GeoHelix->>Decoder: decode(buffer) or decodeGrid(buffer)
  Decoder-->>GeoHelix: positions, normals, colors, index, concepts
  GeoHelix->>Mount: mount(geometry data)
  Mount->>Mount: build Three.js scene, shaders, LOD polling
  Mount-->>GeoHelix: render loop active
Loading

Possibly related PRs

  • AdaWorldAPI/q2#89: Adds the iceland_dem.helix.soa.gz BSO2/helix bake asset that this PR's GeoHelix decoder and /ice route are built to consume.

Poem

A rabbit hops through terrain new,
Decoding heights of every hue,
Grids and rims and sky-domed blue,
LOD polling, x-ray view too.
🐇⛰️ /geo, /ice, hop on through!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: forking GeoHelix to isolate the map/terrain renderer.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
cockpit/src/GeoHelix.tsx (1)

243-375: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Extract the shared BSO2 decoder
decodeGrid, decode, HALF_LUT, the Signed360 helpers, and conceptColor are duplicated in cockpit/src/BodyHelix.tsx and cockpit/src/GeoHelix.tsx. Pull the pure decode path into a shared module so future bake-format changes only land once and both viewers stay in sync.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@cockpit/src/GeoHelix.tsx` around lines 243 - 375, The BSO2 decode logic is
duplicated between GeoHelix and BodyHelix, so future bake-format changes will
drift; extract the shared pure decoder into a common module and have both
viewers call it. Move the shared pieces from decode, decodeGrid, HALF_LUT, the
Signed360 helpers, and conceptColor into one reusable implementation, then keep
GeoHelix and BodyHelix as thin wrappers that only handle view-specific behavior.
Ensure the shared decoder still returns the same Decoded shape and preserves the
version-specific handling already in decode.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@cockpit/src/GeoHelix.tsx`:
- Around line 243-375: The BSO2 decode logic is duplicated between GeoHelix and
BodyHelix, so future bake-format changes will drift; extract the shared pure
decoder into a common module and have both viewers call it. Move the shared
pieces from decode, decodeGrid, HALF_LUT, the Signed360 helpers, and
conceptColor into one reusable implementation, then keep GeoHelix and BodyHelix
as thin wrappers that only handle view-specific behavior. Ensure the shared
decoder still returns the same Decoded shape and preserves the version-specific
handling already in decode.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 541b8336-b1f1-42ed-ae4f-b070ce4d4ff7

📥 Commits

Reviewing files that changed from the base of the PR and between 07d597c and 4b15fc5.

📒 Files selected for processing (2)
  • cockpit/src/GeoHelix.tsx
  • cockpit/src/main.tsx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants