Skip to content

Fix KiCad boolean-difference rendering for rounded and circular SMT pads#692

Open
rushabhcodes wants to merge 1 commit into
tscircuit:mainfrom
rushabhcodes:fix/kicad-boolean-difference-pad-geometry
Open

Fix KiCad boolean-difference rendering for rounded and circular SMT pads#692
rushabhcodes wants to merge 1 commit into
tscircuit:mainfrom
rushabhcodes:fix/kicad-boolean-difference-pad-geometry

Conversation

@rushabhcodes

Copy link
Copy Markdown
Contributor

Summary

Fixes incorrect SMT pad geometry in KiCad boolean-difference visualizations.

Problem

The boolean-difference converter treated SMT pads with width and height as plain rectangles. This caused:

  • KiCad roundrect pads to lose their corner radius
  • Circular BGA pads to render as squares
  • Shape inaccuracies to be hidden in parity comparisons

Changes

  • Build exact rounded-rectangle polygons using line segments and quarter-circle arcs
  • Preserve and clamp corner_radius values
  • Handle circular and polygon SMT pads before the rectangular fallback
  • Regenerate affected KiCad parity snapshots

Impact

Boolean-difference snapshots now accurately represent real KiCad pad geometry, making footprint parity regressions easier to detect and trust.

Verification

  • 108 KiCad parity tests pass
  • Production build and declaration generation pass
  • Affected snapshots cover rounded resistors, diodes, QFP/QFN packages, and circular BGA pads

Copilot AI review requested due to automatic review settings July 4, 2026 06:35

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.

@rushabhcodes

Copy link
Copy Markdown
Contributor Author

I’ll fix the remaining regression in a follow-up PR.

@techmannih techmannih left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@rushabhcodes I think @anil08607 is working on that one, he send a message in the contributor channel.

@techmannih

Copy link
Copy Markdown
Member

@rushabhcodes It would be good for us if a new contributor wants to work on it. We should encourage and help them instead of blocking them. That will motivate more people to contribute and benefit the project in the long run..

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.

4 participants