Skip to content

Add parameterized JST SMD footprints - #748

Merged
seveibar merged 1 commit into
mainfrom
agent/add-jst-smd
Jul 27, 2026
Merged

Add parameterized JST SMD footprints#748
seveibar merged 1 commit into
mainfrom
agent/add-jst-smd

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Summary

  • add a generic smd variant to the existing jst footprint family
  • generate one regular signal-pad row plus two symmetric hold-down pads
  • support signal pitch/dimensions, mounting-pad pitch/offset/dimensions, and mounting pads above or below the signal row
  • keep existing PH, ZH, and SH variants unchanged
  • add visual SVG snapshots for both mounting-pad orientations

Motivation

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:

  • C265108
  • C265440
  • C160354
  • C405941
  • C7429671
  • C7429680

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

jst4_smd_p2mm_pw1mm_pl6mm_mpx10.698mm_mpy2.316mm_mpw1.8mm_mpl3.4mm

Use mounttop when the hold-down pads are above the signal row.

Validation

  • bun test tests/jst.test.ts — 12 passed
  • bun run build
  • visual inspection of both new SVG snapshots
  • exact copper comparison against all six representative JLCPCB imports — 100% IoU each
  • full test run with network access — 493 passed; five unrelated existing local SVG-renderer mismatches remained (melf, sod323fl, diode1210, diode0603, and sod923)

@seveibar
seveibar marked this pull request as ready for review July 27, 2026 19:38
@seveibar
seveibar requested a review from techmannih as a code owner July 27, 2026 19:39
@seveibar
seveibar merged commit 4c1927c into main Jul 27, 2026
5 checks passed
Comment thread tests/jst.test.ts
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",
)
})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

2 participants