Skip to content

feat: add support --download flag to downloading and localizing 3D models from JLCPCB#2471

Open
techmannih wants to merge 2 commits intotscircuit:mainfrom
techmannih:down
Open

feat: add support --download flag to downloading and localizing 3D models from JLCPCB#2471
techmannih wants to merge 2 commits intotscircuit:mainfrom
techmannih:down

Conversation

@techmannih
Copy link
Member

This PR adds the ability to download and localize 3D models (OBJ files) when importing components from JLCPCB using the tsci import command.

Summary of Changes

  • CLI Enhancement: Added a new --download flag to the tsci import command.
  • 3D Model Localization: Implemented logic to fetch .obj files directly from JLCPCB's CDN.
  • Component Linking: Automatically updates the generated TypeScript component to use the relative path of the downloaded 3D model instead of a remote URL.
  • Filename Resolution: Includes a robust parser for the content-disposition header to ensure the downloaded file uses the correct original filename from JLCPCB.
Screenshot_2026-03-19_10-46-52

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@techmannih techmannih requested a review from seveibar March 19, 2026 05:52
const remoteUrl = remoteUrlMatch[1]

try {
const response = await fetch(remoteUrl)
Copy link
Contributor

@MustafaMulla29 MustafaMulla29 Mar 19, 2026

Choose a reason for hiding this comment

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

ig you should be using platformFetch instead of fetch

return process.exit(1)
}
} else {
const partId = `C${choice.part}`
Copy link
Contributor

Choose a reason for hiding this comment

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

Unclear naming here, rename part and partId

partNumber is fine. lcscId is better than partId and used elsewhere

Copy link
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.

Regex on tsx is a hack

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