Repository navigation
fix: synchronize footprint polarity with component pin labels - #4836
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Abse2001
commented
Oct 22, 2026
Abse2001
left a comment
Contributor
Author
There was a problem hiding this comment.
The polarity behavior looks good in the focused tests. Just two small convention fixes before approval.
seveibar
approved these changes
Oct 22, 2026
Contributor
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
1 similar comment
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.
A diode/LED can connect its electrical anode to pad 2 through
pinLabelswhile footprinter still draws its positive artwork beside pad 1. Resolve polarity before generating the footprint so the electrical terminals and fabrication/silkscreen artwork use the same mapping.For example,
<led footprint="led0805" pinLabels={{ pin1: ["cathode", "neg"], pin2: ["anode", "pos"] }} />now generates the footprint withanodepin2_cathodepin1, without modifying user props or numeric pad identities. Explicit footprint polarity options must agree with the labels; contradictory inputs produce a readable error.Also forwards capacitor
polarizedto footprinter, selecting capacitor geometry for bare chip sizes when needed. Explicit capacitorpositivepin/negativepinoptions and the cathode-first defaults of DO-219AD/SOD-323HE now initialize unambiguous electrical aliases instead of attaching both positive and negative aliases to each pin. CapacitorpinLabelsare not added here; that API is not accepted by the current capacitor props schema.Reproduction and snapshots
bun test tests/components/normal-components/footprinter-polarity-labels.test.tsxfails on unchanged main: the positive annotation lies on the opposite side of the body from its emitted electrical anode (dot product −2.59875, expected positive). It passes with this fix. Additional board regressions cover matching/conflicting options, input immutability, cathode-first defaults, capacitor controls, rotation and bottom-layer mirroring.Footprinter integration
Related marking PRs: tscircuit/footprinter#926 and tscircuit/footprinter#927. This PR passes the required options; rendering the new printed
+marks still requires those changes to be released and consumed. No dependency version is changed here. Separate local end-to-end checks against each actual PR build confirm all four diode/LED cases and all four capacitor cases put the printed mark on the resolved positive terminal. Committed tests use core's declared dependency, without module mocks or sibling package links.Validation
git diff --checkpassed.