Skip to content

fix(to220): use standard 2.54mm lead pitch and respect p parameter - #804

Open
rudra496 wants to merge 2 commits into
tscircuit:mainfrom
rudra496:fix/to220-standard-pitch
Open

fix(to220): use standard 2.54mm lead pitch and respect p parameter#804
rudra496 wants to merge 2 commits into
tscircuit:mainfrom
rudra496:fix/to220-standard-pitch

Conversation

@rudra496

Copy link
Copy Markdown

Summary

Fixes #790.

Previously, `to220` computed its pin pitch dynamically from plastic body width (`Math.max(minPitch, maxHoleWidth / (numPins - 1))`), resulting in 2.6mm pitch on the standard 3-pin part instead of the JEDEC/KiCad 2.54mm (0.1") standard pitch, while ignoring the `p` parameter.

Changes

  1. Standard Pitch: Defaulted `p` to `"2.54mm"` in `to220_def`, matching JEDEC TO-220 and KiCad `TO-220-3_Vertical` standards.
  2. Respect `p` Parameter: Positioned plated holes according to `pitch = parameters.p` so custom pitch overrides (e.g. `to220_3_p3mm`) function properly.
  3. Unit Tests: Added `tests/to220-pitch.test.ts` verifying that `to220_3` defaults to 2.54mm pitch and respects custom `p` values.

Verification

  • `bun test tests/to220-pitch.test.ts` (2/2 passing).

Fixes tscircuit#790 by defaulting to220 lead pitch to standard 2.54mm (0.1 in) and honoring the p parameter rather than computing pitch from body width.
Copilot AI lite review requested due to automatic review settings August 15, 2026 20:39
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

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 was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

to220 uses a body-width-derived pin pitch (2.6mm) instead of the standard 2.54mm

2 participants