Skip to content

feat: add fanout boundary padding props - #763

Merged
seveibar merged 1 commit into
mainfrom
agent/fanout-boundary-padding
Jul 28, 2026
Merged

feat: add fanout boundary padding props#763
seveibar merged 1 commit into
mainfrom
agent/fanout-boundary-padding

Conversation

@seveibar

Copy link
Copy Markdown
Contributor

Summary

  • add reusable FanoutBoundaryPadding supporting a scalar distance or directional { top, right, bottom, left } distances
  • expose fanoutBoundaryPadding on both <breakout> and <autoroutingphase>
  • normalize distance strings to millimeters and reject negative padding
  • export the shared type and schema from @tscircuit/props

Motivation

The fanout solver needs a shared boundary around only the source footprint pads. Existing breakout padding controls the group/layout bounds around every child, so nearby destination footprints such as decoupling capacitors enlarge that boundary. This prop lets core/solver integration terminate fanout before those surrounding parts while leaving ordinary breakout layout padding unchanged.

Directional fields allow asymmetric escape room. Omitted directional values are defined as zero. When the prop is absent, downstream implementations can retain automatic pitch-based boundary inference.

Proposed integration semantics

A subsequent fanout-solver/core change will resolve this padding against the union of source-pad bounds and pass the resulting shared boundary to the solver. When both are supplied, phase-level padding should override the breakout-level value.

Validation

  • bun test — 393 passed
  • bun run typecheck
  • bun run build
  • bun run check-circular-deps
  • git diff --check

@seveibar
seveibar marked this pull request as ready for review July 28, 2026 19:16
@seveibar
seveibar merged commit d77e5b5 into main Jul 28, 2026
4 checks passed
Comment on lines +45 to +71
test("autorouting phase accepts scalar fanout boundary padding", () => {
const raw = {
autorouter: "fanout",
fanoutBoundaryPadding: "0.6mm",
} satisfies AutoroutingPhaseProps

expect(autoroutingPhaseProps.parse(raw).fanoutBoundaryPadding).toBe(0.6)
})

test("autorouting phase accepts directional fanout boundary padding", () => {
const raw = {
autorouter: "fanout",
fanoutBoundaryPadding: {
top: "0.4mm",
right: 0.8,
bottom: "1.2mm",
left: 0.5,
},
} satisfies AutoroutingPhaseProps

expect(autoroutingPhaseProps.parse(raw).fanoutBoundaryPadding).toEqual({
top: 0.4,
right: 0.8,
bottom: 1.2,
left: 0.5,
})
})

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.

This file now contains more than one test(...) call. The rule states that a *.test.ts file may have AT MOST one test(...). The two new tests ('autorouting phase accepts scalar fanout boundary padding' and 'autorouting phase accepts directional fanout boundary padding') should be split into separate numbered files, e.g. autoroutingphase1.test.ts, autoroutingphase2.test.ts, etc., leaving at most one test per file.

Spotted by Graphite (based on custom rule: Custom rule)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

@tscircuitbot

Copy link
Copy Markdown
Contributor

Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


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.

2 participants