Skip to content

fix: avoid 3d preview failure when OBJ cad asset is unreachable - #1540

Open
itisrohit wants to merge 6 commits into
tscircuit:mainfrom
itisrohit:fix/jlcpcb-c2040-3d-preview
Open

fix: avoid 3d preview failure when OBJ cad asset is unreachable#1540
itisrohit wants to merge 6 commits into
tscircuit:mainfrom
itisrohit:fix/jlcpcb-c2040-3d-preview

Conversation

@itisrohit

@itisrohit itisrohit commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a narrower 3d preview failure case: when a cad_component includes both model_obj_url and model_step_url, the old path preferred OBJ first.

If that OBJ asset is unreachable, the preview fails instead of falling back cleanly.

Before After
Before: compilation error card After: rendered 3d board preview

Testing

bun test tests/jlcpcb-c2040-preview.test.ts

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
svg-tscircuit-com Ready Ready Preview, Comment Jun 5, 2026 9:42am

Request Review

@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

@itisrohit is attempting to deploy a commit to the mustafamulla29's projects Team on Vercel.

A member of the Team first needs to authorize it.

@mohan-bee mohan-bee 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.

I don't find any issue with the 3d rendering for c2040,

Image Image

@itisrohit itisrohit changed the title fix: avoid 3d preview failure for jlcpcb:c2040 fix: avoid 3d preview failure when OBJ cad asset is unreachable Jun 5, 2026
@itisrohit

Copy link
Copy Markdown
Contributor Author

You're right, the normal RP2040 3d render path looks fine.

This PR fixes a narrower case: when a cad_component includes both model_obj_url and model_step_url, the old 3d path preferred OBJ first. If that OBJ asset is unreachable, the render fails instead of falling back cleanly.

I've updated the PR title/body to reflect that narrower scope, and the regression test now targets that dual-source CAD case explicitly rather than the general c2040 render path.

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