Skip to content

Detect model extensions before query strings#879

Open
jorgeschulz wants to merge 1 commit into
tscircuit:mainfrom
jorgeschulz:bounty/load-model-query-urls
Open

Detect model extensions before query strings#879
jorgeschulz wants to merge 1 commit into
tscircuit:mainfrom
jorgeschulz:bounty/load-model-query-urls

Conversation

@jorgeschulz
Copy link
Copy Markdown

Summary

/claim #93

  • adds getModelFileExtension so load3DModel detects file type from the URL path before query/hash suffixes
  • preserves the original URL passed to STL/OBJ/WRL/GLTF loaders
  • fixes valid URLs like model.glb?cachebust_origin=... being treated as unsupported
  • adds regression coverage for .glb, .obj, .stl, and .wrl URLs with query/hash suffixes

Verification

  • npx --yes bun@latest test tests/load-model-url-extension.test.ts
  • npx --yes bun@latest x tsc --noEmit
  • npx --yes bun@latest x biome check src/utils/load-model.ts tests/load-model-url-extension.test.ts
  • npx --yes bun@latest run build
  • git diff --check

Full test note

  • npx --yes bun@latest test has 3 existing unrelated failures on current main: two tests/preprocess-circuit-json.test.ts z-offset assertions expect 0.8/1.8 while current output is 0.7/1.7, and tests/outline-bounds.test.ts expects rgb(39,89,56) while current SVG contains nearby soldermask colors.

AI-assisted with Codex; I reviewed the diff and ran the checks above before opening this PR.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
3d-viewer Ready Ready Preview, Comment May 12, 2026 2:20pm

Request Review

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant