Add parameterized JST SMD footprints - #748
Merged
Merged
Conversation
Comment on lines
+34
to
+60
| test("jst4_smd with mounting pads below the signal row", () => { | ||
| const definition = | ||
| "jst4_smd_p2mm_pw1mm_pl6mm_mpx10.698mm_mpy2.316mm_mpw1.8mm_mpl3.4mm" | ||
| const circuitJson = fp.string(definition).circuitJson() | ||
| const params = fp.string(definition).json() as any | ||
|
|
||
| expect(params.num_pins).toBe(4) | ||
| expect(params.smd).toBe(true) | ||
| expect(params.mounttop).toBe(false) | ||
| expect(convertCircuitJsonToPcbSvg(circuitJson)).toMatchSvgSnapshot( | ||
| import.meta.path + "jst4_smd", | ||
| ) | ||
| }) | ||
|
|
||
| test("jst5_smd_mounttop", () => { | ||
| const definition = | ||
| "jst5_smd_mounttop_p1.5mm_pw0.7mm_pl5mm_mpx10.1mm_mpy1.85mm_mpw1.5mm_mpl2.3mm" | ||
| const circuitJson = fp.string(definition).circuitJson() | ||
| const params = fp.string(definition).json() as any | ||
|
|
||
| expect(params.num_pins).toBe(5) | ||
| expect(params.smd).toBe(true) | ||
| expect(params.mounttop).toBe(true) | ||
| expect(convertCircuitJsonToPcbSvg(circuitJson)).toMatchSvgSnapshot( | ||
| import.meta.path + "jst5_smd_mounttop", | ||
| ) | ||
| }) |
Contributor
There was a problem hiding this comment.
A *.test.ts file may have AT MOST one test(...). This file already contained multiple tests before this PR, and two additional test(...) calls were added here (lines 34–46 and 48–60). Each test should be split into its own numbered file, e.g., jst4.test.ts, jst5.test.ts, etc., rather than accumulating all tests in a single jst.test.ts file.
Spotted by Graphite (based on custom rule: Custom rule)
Is this helpful? React 👍 or 👎 to let us know.
Contributor
|
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.
Summary
smdvariant to the existingjstfootprint familyMotivation
Several JST and JST-style wire-to-board connectors in jlc5000 share this land-pattern topology but cannot currently be represented by a specific footprinter string. The new variant produces exact copper geometry for six benchmark parts:
Each representative string measured 100% copper IoU against its imported JLCPCB footprint. Once discovery support lands in
circuit-json-to-footprinter, these six parts should move the 95% benchmark from 351/450 to 357/450.Example
Use
mounttopwhen the hold-down pads are above the signal row.Validation
bun test tests/jst.test.ts— 12 passedbun run buildmelf,sod323fl,diode1210,diode0603, andsod923)