Skip to content

Translate courtyard outlines when changing footprint origins - #867

Open
pokemongo1027 wants to merge 1 commit into
tscircuit:mainfrom
pokemongo1027:fix/origin-courtyard-outlines
Open

pokemongo1027 wants to merge 1 commit into
tscircuit:mainfrom
pokemongo1027:fix/origin-courtyard-outlines

Conversation

@pokemongo1027

Copy link
Copy Markdown

Changing a footprint origin moves its copper and silkscreen but leaves pcb_courtyard_outline vertices at their original coordinates. For example, fp().sot23().origin("pin1") places the right edge of pin 3 at x = 2.9375mm while the courtyard still ends at x = 2.05mm, leaving copper outside the clearance outline.

Translate courtyard outline vertices by the same offset as the rest of the footprint. Map them into a new array with copied points because several footprint generators reuse module-level courtyard constants. This preserves earlier results and prevents offsets from accumulating across repeated generation. Rectangular courtyards retain their existing translation behavior.

Validation

  • Added regression cases for SOT-23 pin1 and bottomleft origins; both fail before the fix.
  • Tests also cover repeated generation, unchanged centered output, and rectangular courtyards translated exactly once.
  • Focused origin tests: 14 passed, 0 failed, 105 assertions.
  • Four SVG snapshots checked visually.
  • Package and TypeScript declaration build, formatting of changed source/tests, and diff checks passed.
  • Full suite on Windows with Bun 1.4.2: 565 passed, 3 failed. The same failures occur on unchanged upstream d0d2ee19b261781af97d405400eb88402598ac92: smf, parity/sod523, and diode-kicad-parity/sod523 (561 passed).

Prepared with AI assistance, local regression testing and independent code review.

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.

1 participant