Repository navigation
Support finite PCB bend regions from board outlines - #5
Merged
Merged
Conversation
This was referenced Oct 1, 2026
Collaborator
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
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.
Bends on one flex-board tail currently deform every point beyond the bend's infinite line, including neighboring tails. Add an optional board-local outline to
createPcbFoldso a finite boundary-to-boundary chord selects the connected region it cuts off. Include widened distal tips and allow overlapping bend positions on disjoint tails.CAD points/directions, inverse placement, rigid-mount checks, stiffeners, and surface meshes use the same selected region.
getCadFoldContextautomatically converts the Circuit JSON board outline from world coordinates to board-local coordinates. Existing two-argument calls retain their behavior.Addresses the folding utility underlying item 1 of tscircuit/tscircuit#5277. Core adoption is still required: update its flex-utils dependency and pass the emitted board outline minus
board.centerfromBoard.doInitialPcbFlexRender. Viewer/GLTF callers that construct folds directly need the same outline argument.Scope remains parallel bends sharing a moving direction on simple outlines. Incomplete chords, branching within a bend zone, and moving regions wrapping behind the proximal tangent fail explicitly.
Validation:
(100, -70). The left resistor folds to z ≈ 5.2146 mm and x rotation 90° while the right resistor stays flat; PCB records remain unchanged and CAD round-trips. This consumer patch is not included here because it requires adopting the new dependency release.Visual snapshots render the locally generated surface mesh with PoppyGL and use the standard
toMatchPngSnapshotfixture. The camera is identical in both images. Red RL follows the left tail through its 90° bend; blue RR stays on the flat right tail.