Skip to content

Support STL CAD models in the shared loader#876

Open
nurik-1618 wants to merge 1 commit into
tscircuit:mainfrom
nurik-1618:codex/stl-loader-cache
Open

Support STL CAD models in the shared loader#876
nurik-1618 wants to merge 1 commit into
tscircuit:mainfrom
nurik-1618:codex/stl-loader-cache

Conversation

@nurik-1618
Copy link
Copy Markdown

@nurik-1618 nurik-1618 commented May 12, 2026

Summary

  • pass the CAD mesh model type into MixedStlModel so extensionless CDN URLs can still use the right loader
  • add an STL path to the existing shared model loader instead of parsing model_stl_url responses as OBJ text
  • keep cache keys stable by stripping only cachebust_origin and namespacing by loader type
  • add regression coverage for extensionless STL URLs, cache-key normalization, and STL parsing

Fixes a remaining model-loading gap for #93.

/claim #93

Verification

  • bun test tests/global-model-loader.test.ts
  • bun x biome check src/AnyCadComponent.tsx src/hooks/use-global-obj-loader.ts src/three-components/MixedStlModel.tsx tests/global-model-loader.test.ts
  • bun x tsc --noEmit
  • bun run build
  • bun run test:node-bundle
  • git diff --check

Full test note

  • bun test has 3 existing unrelated failures on current main expectations: 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 output contains nearby soldermask colors. The new focused STL loader test passes.

@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 6:33am

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