Skip to content

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

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

feat: add support --download flag to downloading and localizing 3D models from JLCPCB#2471
techmannih wants to merge 3 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
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

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.

always avoid using regex unless it greatly simplifies a solution, regex should never make a solution more complex (it makes it more complex here)

The easyeda converter converts circuit json into tsx internally, can't you use that to simplify this implementation and avoid regex.

Can you also make sure to properly handle the step model url, which was in the original feature request Ray made (this wouldn't have helped him because you didn't handle step model urls)

Why do you handle multiple remote urls in this way? Simplify your code, use .find instead of filter to find the cad component.

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