Skip to content

Optimize repeated OBJ model loading#881

Open
emptyteabot wants to merge 1 commit into
tscircuit:mainfrom
emptyteabot:fix-obj-model-cache
Open

Optimize repeated OBJ model loading#881
emptyteabot wants to merge 1 commit into
tscircuit:mainfrom
emptyteabot:fix-obj-model-cache

Conversation

@emptyteabot
Copy link
Copy Markdown

@emptyteabot emptyteabot commented May 12, 2026

/claim #93

Summary

  • normalize OBJ/WRL model cache keys by stripping cachebust_origin, so the same model URL from different editor origins shares one cached parse
  • always return cloned Object3D instances from the cache, including the first load, so scene attachment and material transparency changes do not mutate the cached template
  • clone materials for each model instance to avoid translucent/hover state leaking between repeated components

Tests

  • npx bun test tests/obj-model-cache.test.ts
  • npx tsc --noEmit
  • npm run build

Full npx bun test still has pre-existing failures in outline-bounds.test.ts and preprocess-circuit-json.test.ts on current dependency install; this PR's focused regression test passes.

AI-assisted with Codex; I reviewed the diff.

@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 3:14pm

Request Review

@emptyteabot
Copy link
Copy Markdown
Author

Ready for review. All GitHub checks and the Vercel preview are passing; this PR includes /claim #93 in the body for the Algora bounty.

@emptyteabot
Copy link
Copy Markdown
Author

If this PR is accepted for the bounty, Stripe payouts are not available for me. Can the bounty be paid as USDT/USDC to an EVM wallet instead? Wallet: 0xe2e86bdb8753c24032f2ad42b4c1bd9748385a7d

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