Skip to content

feat: add PowerNetVerticalBiasSolver to improve schematic layout#71

Open
selenaalpha77-sketch wants to merge 3 commits intotscircuit:mainfrom
selenaalpha77-sketch:fix/power-vertical-bias-v2
Open

feat: add PowerNetVerticalBiasSolver to improve schematic layout#71
selenaalpha77-sketch wants to merge 3 commits intotscircuit:mainfrom
selenaalpha77-sketch:fix/power-vertical-bias-v2

Conversation

@selenaalpha77-sketch
Copy link
Copy Markdown

@selenaalpha77-sketch selenaalpha77-sketch commented Apr 25, 2026

Fixes #12
/claim #12

Adds PowerNetVerticalBiasSolver as a post-packing phase in LayoutPipelineSolver:

  • Components on positive-voltage nets (VCC, VDD, VBUS, V3_3, V5, etc.) are biased upward
  • Components on ground nets (GND, VSS, AGND, DGND, etc.) are biased downward
  • Neutral components remain in place

This follows the conventional schematic layout principle where power flows downward, making schematics more readable and matching industry standards.

Changes

  • lib/solvers/PowerNetVerticalBiasSolver/PowerNetVerticalBiasSolver.ts — new solver
  • lib/solvers/LayoutPipelineSolver/LayoutPipelineSolver.ts — integrates new solver
  • tests/LayoutPipelineSolver/PowerNetVerticalBias.test.ts — test coverage
  • package.json — update deps to fix test suite (circuit-to-svg missing export)

…ircuit#12)

Adds a new post-pack pipeline phase (PowerNetVerticalBiasSolver) that
improves schematic layout readability by applying a vertical bias based
on power/ground net connectivity:

- Chips connected to positive-voltage nets (VCC, VDD, V+) are shifted
  upward, following conventional schematic layout where power is at the
  top.
- Chips connected to ground nets (GND, VSS) are shifted downward.
- Chips with no power/ground affiliation or balanced connections remain
  at their packed positions.

The solver runs as the final phase in LayoutPipelineSolver after
PartitionPackingSolver. getOutputLayout() and visualize() both return
the biased layout when available.

Fixes tscircuit#12
…sing export

convertCircuitJsonToSchematicSimulationSvg was not exported in the old version
of circuit-to-svg, causing test failures. Update to latest compatible versions.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

@selenaalpha77-sketch 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Propose/implement a solution to bad layout

1 participant