Skip to content

Fix origins for rotated SMT pads - #869

Open
seunghyukchoe wants to merge 2 commits into
tscircuit:mainfrom
seunghyukchoe:fix/rotated-smt-origin-bounds
Open

seunghyukchoe wants to merge 2 commits into
tscircuit:mainfrom
seunghyukchoe:fix/rotated-smt-origin-bounds

Conversation

@seunghyukchoe

@seunghyukchoe seunghyukchoe commented Sep 8, 2026

Copy link
Copy Markdown

Combining pin1location(...) with origin("bottomleft") currently measures rotated SMT pads using their unrotated width and height. For example:

fp.string("soic8_pin1location(topside,right)")
  .origin("bottomleft")
  .circuitJson()

The resulting copper starts at x = +0.2 mm, y = -0.2 mm instead of (0, 0).

Calculate the rotated copper bounds for rectangular and pill-shaped SMT pads, respecting corner_radius, the legacy rect_border_radius, and pill radius. This also handles non-quarter-turn angles with rounded corners.

Validation on macOS arm64 with Bun 1.3.14, against upstream d0d2ee19:

  • Nine new regression/control tests pass; seven fail against unchanged upstream.
  • Full suite: 573 passed, 0 failed (bun test --timeout 30000). The longer timeout accommodates remote KiCad reference downloads; four default-timeout failures on unchanged upstream passed when retried.
  • bun run build, bunx biome format ., and git diff --check pass. Formatting was checked before generating dist.
  • Ten new SVG snapshots rendered and visually inspected.

Related origin work: #867 and #868.

Prepared with OpenAI Codex assistance, including an independent code review. I can respond to review feedback and revise the change.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T10:39:36.392966Z 069e65c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50b9fc4d42

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread tests/origin-rotation.test.ts
Comment thread tests/origin-rotation.test.ts
@seunghyukchoe

Copy link
Copy Markdown
Author

@codex review

Added the three requested control-footprint snapshots in 069e65c. All generated footprints in the new tests now have SVG coverage.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 069e65cc8e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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