Repository navigation
Place flex-board CAD components during rendering - #4092
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
seveibar
marked this pull request as ready for review
September 23, 2026 05:12
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Create board-mounted CAD components in their assembled position/rotation during rendering. The board computes its fold once in PcbFlexRender; components calculate flat position/rotation, optionally apply the fold projection in an explicit conditional, then insert the CAD record. Folded records carry is_on_folded_board: true. getCircuitJson remains a plain export, and PCB placement/routing stay flat.
Use @tscircuit/flex-utils@0.0.5 from the pinned jscdn tarball as a development dependency. Bundle its JavaScript and declaration types via tsup noExternal/dts.resolve, so package consumers do not install flex-utils separately.
Validation: focused CAD/flex tests and the existing capsule snapshot pass. Dependency policy passes. Built JavaScript/declarations contain no external flex-utils imports; Node can import the built package with flex-utils removed from node_modules. The published CDN tarball installs without authentication.
CAD placement uses sequential statements instead of wrapping position/rotation literals in a resolver.
getBoardFoldContextonly gathers the containing board and flat PCB mount. The projection uses the shared named-argument API.