Skip to content

Update SVG snapshot for SOIC-20 footprint alignment analysis with improved dimensions and fill rules#519

Open
rushabhcodes wants to merge 3 commits intotscircuit:mainfrom
rushabhcodes:fix-soic
Open

Update SVG snapshot for SOIC-20 footprint alignment analysis with improved dimensions and fill rules#519
rushabhcodes wants to merge 3 commits intotscircuit:mainfrom
rushabhcodes:fix-soic

Conversation

@rushabhcodes
Copy link
Contributor

This pull request updates the SOIC (Small Outline Integrated Circuit) footprint generation logic to use more accurate default pad dimensions and improves type consistency throughout the code. The most important changes are:

Default SOIC pad dimensions and calculation logic:

  • Updated the default pad width (pw) from 0.6mm to 0.65mm and pad length (pl) from 1.0mm to 1.67mm in both the schema defaults and the fallback logic. Adjusted the proportional calculations for missing values to match the new defaults. [1] [2]
  • Modified the leg offset calculation in getCcwSoicCoords to add/subtract 0.23mm, improving the placement accuracy of the SOIC legs.
  • Changed the silkscreen width calculation to subtract 0.8 instead of 0.2, making the silkscreen outline more accurate when legs are not outside.

Type consistency and naming:

  • Replaced all uses of AnySoupElement with AnyCircuitElement in function signatures and return types for better semantic clarity and consistency with the rest of the codebase. [1] [2] [3]
  • Updated pad generation to use local variables for pad dimensions, ensuring consistent values are passed to pillpad and rectpad functions.

Copilot AI review requested due to automatic review settings March 8, 2026 17:25
@MustafaMulla29
Copy link
Contributor

Tests failing

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the SOIC footprint generator to better match KiCad geometry by revising default pad dimensions/placement math, and refreshes SVG snapshot outputs accordingly.

Changes:

  • Adjust SOIC default pad dimensions (pw/pl) and proportional fallback calculations.
  • Tweak SOIC leg offset and silkscreen width calculations for improved alignment accuracy.
  • Update snapshot SVGs for SOIC-20 / SOIC-8 / SOIC-28 parity and rendering diffs.

Reviewed changes

Copilot reviewed 1 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/fn/soic.ts Updates SOIC parameter defaults, coordinate math, silkscreen sizing, and element typing.
tests/kicad-parity/snapshots/soic20_boolean_difference.snap.svg Updates alignment-analysis SVG snapshot to reflect new geometry/rendering.
tests/kicad-parity/snapshots/soic20.snap.svg Updates KiCad parity snapshot to reflect new SOIC-20 geometry.
tests/snapshots/soic8.snap.svg Updates SOIC-8 snapshot for new default pad sizing/placement.
tests/snapshots/soic8_w5.3mm_p1.27mm.snap.svg Updates SOIC-8 (explicit w/p) snapshot for new geometry.
tests/snapshots/soic8_pw04_pl1_pillpads.snap.svg Updates SOIC-8 pill-pad snapshot for new geometry.
tests/snapshots/soic28_pw0762_pl1524.snap.svg Updates SOIC-28 snapshot for new geometry.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rushabhcodes
Copy link
Contributor Author

@MustafaMulla29

Copy link
Member

@techmannih techmannih left a comment

Choose a reason for hiding this comment

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

You need to add parity test for all which snapshot are changed.

@rushabhcodes rushabhcodes requested a review from techmannih March 8, 2026 18:44
@dagangtj
Copy link

Hi @rushabhcodes! I noticed the review comment requesting parity tests for all changed snapshots.

Looking at the PR changes, the following snapshots were modified but don't have corresponding parity tests:

  • soic8 variants (soic8, soic8_w5.3mm_p1.27mm, soic8_pw04_pl1_pillpads)
  • soic28_pw0762_pl1524

The existing soic20_kicad_parity.test.ts and sop8_kicad_parity.test.ts are good templates to follow. You'll need to find the appropriate KiCad circuit.json files in the tests/kicad-footprints/ directory for the comparison.

Happy to help if you need assistance identifying the correct KiCad files!

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.

5 participants