Skip to content

fix: include plated slot copper dimensions in origin bounds - #870

Open
ByungDooJang wants to merge 1 commit into
tscircuit:mainfrom
ByungDooJang:fix/plated-slot-origin-bounds
Open

ByungDooJang wants to merge 1 commit into
tscircuit:mainfrom
ByungDooJang:fix/plated-slot-origin-bounds

Conversation

@ByungDooJang

Copy link
Copy Markdown

Calling fp.string("usbcmidmount16").origin("bottomleft").circuitJson() places the leftmost copper edge at -0.6 mm and the bottom copper edge at -0.9 mm. The plated shell slots expose outer_width and outer_height, but applyOrigin only reads circular diameters, so it counts each slot as a point.

Use the outer width and height when present, retaining the existing diameter fallback for circular holes. The regression test checks that the generated connector's left and bottom copper edges reach zero and includes an SVG snapshot.

Validation on Windows x64:

  • Regression fails on the original helper and passes with this change.
  • Origin and USB-C tests: 17 passed with Bun 1.3.5 (the CI test version), also 17 passed with Bun 1.4.2.
  • Full suite with Bun 1.4.2: 562 passed, 3 failed. The existing smf, parity/sod523, and diode-kicad-parity/sod523 image mismatches reproduce with the unmodified helper (17 passed, 3 failed across those three files).
  • bun run build and formatting of the changed files pass. New SVG was rendered and visually inspected.

This change is limited to the dimensions used for the existing axis-aligned bounds calculation; it does not add rotation-aware geometry or change the separate rectangular-pad logic proposed in #384.

Prepared with OpenAI Codex assistance and checked with the tests above.

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