Skip to content

Implement UTDFN-4-EP(1x1) / utdfn exposed-pad footprint - #892

Open
halc8312 wants to merge 8 commits into
tscircuit:mainfrom
halc8312:feat-utdfn4ep
Open

halc8312 wants to merge 8 commits into
tscircuit:mainfrom
halc8312:feat-utdfn4ep

Conversation

@halc8312

Copy link
Copy Markdown

Implements #183UTDFN-4-EP(1x1) (JLCPCB package name) and the UDFN/UTDFN exposed-pad family.

utdfn delegates to dfn with the KiCad UDFN-4-1EP_1x1mm_P0.65mm_EP0.48x0.48mm defaults: four 0.22mm x 0.25mm signal pads at x=+-0.54mm on 0.65mm pitch (overall width incl. terminals 1.3mm) and a 0.48mm x 0.48mm center exposed pad. num_pins and every DFN parameter stay overridable for other UDFN variants.

Name handling: utdfn4ep resolves through the ${fn}${pins} lookup with num_pins=4; normalizeDefinition rewrites UTDFN-4-EP / utdfn-4-ep(1x1) / UDFN-4-EP to utdfn4ep.

Tests (tests/utdfn.test.ts, includes the required SVG snapshot at tests/__snapshots__/utdfn4ep.snap.svg):

  • utdfn4ep emits exactly the four KiCad pad positions/sizes plus the 0.48mm x 0.48mm EP, asserted numerically.
  • utdfn6 produces six signal pads.

bun test green (580 tests incl. kicad-parity suite), biome format clean, tsc --noEmit adds zero new errors (the repo has pre-existing ones).

Copilot AI lite review requested due to automatic review settings September 19, 2026 08:54

Copilot AI left a comment

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.

Copilot review overview

🟡 Changes recommended

Add the typed fp.utdfn(...) API entry before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Implements UDFN/UTDFN exposed-pad footprint generation with DFN-compatible defaults, alias normalization, and tests.

Changes:

  • Added configurable utdfn generation and exposed-pad geometry.
  • Exported the generator and normalized package aliases.
  • Added geometry, pin-count, and SVG snapshot tests.
File Summary
tests/​utdfn.test.ts Adds geometry and pin-count coverage.
tests/​__snapshots__/​utdfn4ep.snap.svg Adds the visual regression snapshot.
src/​footprinter.ts Handles UDFN/UTDFN name normalization.
src/​fn/​utdfn.ts Implements the exposed-pad generator.
src/​fn/​index.ts Exports utdfn; the typed Footprinter entry is still needed.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/fn/index.ts
export { sot23 } from "./sot23"
export { sot25 } from "./sot25"
export { dfn } from "./dfn"
export { utdfn } from "./utdfn"
Comment thread tests/utdfn.test.ts
Comment on lines +50 to +54
const soup = fp.string("utdfn6").circuitJson()
const signalPads = soup.filter(
(e): e is PcbSmtPad => e.type === "pcb_smtpad" && isSignalPad(e),
)
expect(signalPads).toHaveLength(6)

This branch has not been deployed

No deployments
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