Skip to content

Resolve relative model paths in tsci export glb and gltf (#5654) - #5876

Open
Abse2001 wants to merge 2 commits into
repro/glb-export-relative-stepfrom
fix/glb-export-relative-step
Open

Abse2001 wants to merge 2 commits into
repro/glb-export-relative-stepfrom
fix/glb-export-relative-step

Conversation

@Abse2001

Copy link
Copy Markdown
Contributor

Stack: 2/2, #5875, the repro → this fix. Merge this into the repro branch first, then merge #5875 to main.

Fixes #5654.

Cause

tsci build --glbs passes Circuit JSON through convertModelUrlsToFileUrls before calling convertCircuitJsonToGltf. That turns a relative model path like ./libraries/cap.step into a file:// URL the converter can fetch().

tsci export (lib/shared/export-snippet.ts) skipped that step for the glb and gltf formats. The converter received the bare relative path, and the fetch failed with 404 Not Found.

Change

The glb and gltf export branches now call convertModelUrlsToFileUrls(circuitJson) too, using the same helper build-glbs.ts, render-drawing-pages.ts and render-explosion-video.ts already import.

Result

The repro test is unchanged. Its snapshot of Failed to load STEP from … messages goes from one entry to [].

Checked by hand with bun cli/main.ts export on the repro's project:

Command Before After
tsci export -f glb 404, 21,772-byte GLB without the model No error, 214,124 bytes, the same as tsci build --glbs
tsci export -f gltf 404 No error, model loaded

The CLI test fixture can't run in my container, which has no IPv6 listen, so CI runs the test.


Generated by Claude Code

The glb and gltf export formats passed model URLs straight to the GLB
converter, which fetch()es them, so a relative cadModel stepUrl such as
./libraries/cap.step failed with 404. They now go through
convertModelUrlsToFileUrls like `tsci build --glbs` does. Fixes #5654.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PiJ1d34GaQJAWypDADnioN
…ative-step

# Conflicts:
#	tests/cli/export/export-glb-relative-step-model.test.ts
@Abse2001
Abse2001 requested a review from seveibar November 19, 2026 20:36
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