Skip to content

Add jlcpcb cad model support to eval#2699

Merged
techmannih merged 9 commits into
tscircuit:mainfrom
techmannih:jaaa
May 18, 2026
Merged

Add jlcpcb cad model support to eval#2699
techmannih merged 9 commits into
tscircuit:mainfrom
techmannih:jaaa

Conversation

@techmannih
Copy link
Copy Markdown
Member

What changed

  • add cadModel extraction to the default jlcpcb footprint resolver in getPlatformConfig
  • keep the existing render regression for jlcpcb: footprints and make it deterministic with a local C156301 fixture
  • add a dedicated resolver-level regression that verifies jlcpcb returns both footprintCircuitJson and extracted cadModel
  • add a committed C156301 circuit-json fixture for the tests

Why

kicad: and jlcpcb: both go through the generic lib:name footprint loading path in core, but they were not symmetric in eval.

For kicad:, the resolver already returned both:

  • footprintCircuitJson
  • explicit cadModel

For jlcpcb:, the resolver only returned footprintCircuitJson, even when the fetched circuit-json already contained embedded cad_component metadata. That meant PCB rendering worked, but jlcpcb: did not match the kicad: behavior for 3D model handoff.

Now that core has merged support for extracting CAD from library footprints, eval still needs to provide the same explicit resolver-level behavior as kicad: so the default platform config is complete and consistent.

Why this is needed in eval

eval is where the default platform wiring lives. This change makes the built-in jlcpcb footprint loader behave like the built-in kicad loader:

  • fetch footprint data
  • return footprintCircuitJson
  • return cadModel

The main difference is just the source of the CAD metadata:

  • kicad: constructs CAD URLs directly from the KiCad cache URL pattern
  • jlcpcb: extracts CAD metadata from the fetched EasyEDA-derived circuit-json

Test notes

The render and CAD tests use a committed C156301 circuit-json fixture instead of a live network fetch.

That is intentional so the tests stay deterministic and do not depend on EasyEDA availability or proxy behavior during CI. The part number and the payload are aligned to the same C156301 fixture.

Validation

  • bun test ./tests/features/jlcpcb-footprint-library-map.test.tsx ./tests/features/jlcpcb-footprint-library-map-cadmodel.test.tsx
  • bunx tsc --noEmit

@techmannih techmannih changed the title [codex] Add jlcpcb cad model support to eval Add jlcpcb cad model support to eval May 17, 2026
@techmannih techmannih marked this pull request as ready for review May 17, 2026 20:00
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d2138f0674

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread lib/getPlatformConfig.ts Outdated
Comment thread lib/getPlatformConfig.ts Outdated
Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never introduce a utils directory. Directory names should be domain specific and domain organized. Eg lib/getPlatformConfig/extractCadModelFromCircuitJson

@techmannih techmannih requested a review from seveibar May 18, 2026 05:02
Copy link
Copy Markdown
Contributor

@seveibar seveibar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment

@techmannih techmannih merged commit f94e4f6 into tscircuit:main May 18, 2026
12 checks passed
@tscircuitbot
Copy link
Copy Markdown
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

3 participants