Skip to content

feat: linear horizontal layout for decoupling caps#38

Open
li224242 wants to merge 3 commits intotscircuit:mainfrom
li224242:fix-decoupling-caps-layout
Open

feat: linear horizontal layout for decoupling caps#38
li224242 wants to merge 3 commits intotscircuit:mainfrom
li224242:fix-decoupling-caps-layout

Conversation

@li224242
Copy link
Copy Markdown

@li224242 li224242 commented Mar 1, 2026

Fixes #15

Description

Implemented a dedicated horizontal linear layout for decoupling capacitors to ensure they are neatly aligned in the schematic, bypassing the iterative packing solver.

Key Changes

  • Intercepted decoupling_caps partition type in SingleInnerPartitionPackingSolver.ts.
  • Implemented _layoutDecouplingCapsLinear() for direct, center-based horizontal alignment.
  • Added deterministic sorting using chipId.localeCompare to ensure consistent CI results across environments.
  • Fallback logic for gap spacing (decouplingCapsGap -> chipGap -> 0.2).
  • Added comprehensive unit tests in LinearDecouplingLayout.test.ts.
  • Passed all type checks, linting, and formatting.

Visual Proof

Decoupling.Caps.Layout.Preview.-.Google.Chrome.2026-03-02.02-47-18.mp4

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 1, 2026

@li224242 is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

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.

Specialized Layout for Decoupling Capacitors

1 participant