Skip to main content
PCBFreeNewv1.0.0

双层网格自动布线核心

2 mil 网格双层 A* 布线(过孔代价 30、方形间距 DRC)、Prim MST 多引脚拆分、rip-up & reroute 重试;输出 Specctra SES 与 SVG 预览,布局后快速验证可布通性。

Installs: 0Rating: –Updated:
Claude CodeCursorCodexGemini CLI+2

Badges only claim the demo-run passed on that host; cross-host installation is handled by the adapter layer.

Preview gallery

You say
Run grid autorouting on this two-layer board JSON: emit SES and an SVG preview, and explain which nets routed, which failed and why.

Content matches the files inside the package; extracted by the publish pipeline.

LCEDA grid autoroute core

Offline re-implementation of the routing algorithm of the Apache-2.0 LCEDA extension pcb-autorouter-rbr (see references/PROVENANCE.md). External router integrations (FreeRouting, KiCadRoutingTools) are documented as procedures in references/procedures.md; they need local binaries and are never simulated here.

What the script computes

scripts/demo.mjs (Node >= 20, no dependencies):

  • 2-mil grid, two copper layers, Int16 occupancy (0 free / -1 obstacle / net id), 2-cell border.
  • A* over 8 directions: straight cost 1, diagonal 1.414, layer change (via) cost 30; Chebyshev heuristic; expansion cap min(colsrows2, 500000).
  • Square clearance neighborhood r = max(1, ceil(spacingMil/2)) checked against other nets and obstacles at every step.
  • Pads marked as discs radius max(15 mil, pad radius); traces as Bresenham strokes widened by ceil(width/2 / 2) cells; vias as discs on both layers.
  • Net order: non-power first, then fewer pins; power names GND/+5V/3V3/ VCC/VDD or containing VDD. Multi-pin nets split by Prim MST into 2-pin edges sorted by squared length.
  • Rip-up & reroute: on a failed edge, scan the straight corridor (r = clearanceR+1) for blocking nets, uncommit them, push them to the back of the queue; max 10 rounds, max 3 rip-ups per net. Obstacle-only blockage fails immediately (nothing to rip).
  • Collinear point simplification (cross product), Specctra SES export (mil x 1000 resolution, F.Cu/B.Cu wires, via padstacks) and an SVG preview (top solid, bottom 50% opacity).
  • Verdict: any ROUTE_FAILED error -> fail; RIP_UP / NOT_ATTEMPTED warnings -> pass_with_warnings; else pass.

Run

node scripts/demo.mjs --out-dir <dir> [--input <board.json>]

Default input: scripts/fixtures/input.json (contains one deliberately unroutable net behind an obstacle wall). stdout is an edaskills.report.v1 report; <dir> receives routes.ses, routes.svg.

Input shape: { "name"?, "widthMil", "heightMil", "spacingMil"?, "traceWidthMil"?, "viaOuterMil"?, "obstacles"?: [{x,y,w,h}], "nets": [{ "name", "widthMil"?, "pins": [{ "ref", "x", "y", "layer"?: "top"|"bottom", "radiusMil"? }] }] } (all mil, origin bottom-left).

When to use

  • Quick feasibility check: can this placement be routed at all with the given spacing/width, before spending time in the editor.
  • Produce a SES starting point for small 2-layer boards, or a routing preview SVG for review.
  • Study rip-up behavior on congested corridors.

Not for: production autorouting of dense boards (no turn cost, no differential pairs, no BGA fanout, 2 layers only), DSN input parsing, or replacing the editor's interactive router. Final DRC always runs in the EDA tool.

What you get

  • Per-net routing results: trace runs, via locations, failure reasons
  • Specctra SES export (mil x 1000) and a two-layer SVG preview
  • A record of rip-up retries and clearance rule decisions

Good fit for

  • Quickly answering "can this placement route at the current spacing" after placement
  • A SES starting point or review preview for small two-layer boards
  • Studying rip-up behavior on congested corridors

Not for

  • Production autorouting of dense boards (no turn cost, differential pairs or BGA fanout; two layers only)
  • DSN input parsing or replacing the interactive editor router; final DRC belongs to the EDA tool
Before you start

You provide

  • Board outline, spacing / trace width / via outer diameter (mil)
  • Nets and pin coordinates (mil, bottom-left origin)
  • Optional: keepout rectangle list

Environment

  • node ≥ 20

Last tested

v1.0.0 · Claude Code, Cursor, Codex, Gemini CLI · Ran 2026/11/19

Dependencies

No dependencies
This skill works standalone.

Demo run

Failed verification1 errors · 1 warnings

node v24.19.0 · 2026/11/19

  • [warning] RIP_UP (BLOCKED): round 1: ripped CROSS to retry BLOCKED
  • [error] ROUTE_FAILED (BLOCKED): net BLOCKED blocked by obstacles, no rip-up target
  • [info] ROUTED (SIG_A): SIG_A: 1 trace runs, 0 vias
  • [info] ROUTED (SIG_B): SIG_B: 1 trace runs, 0 vias
  • [info] ROUTED (CROSS): CROSS: 2 trace runs, 2 vias

Some artifacts are listed by name only (extension not in the preview whitelist).

FAQ

Ratings & reviews

Not rated0 ratings

5 star0
4 star0
3 star0
2 star0
1 star0

Sign in to rate this skill.

Sign in

Versions

  • v1.0.0Latest508.6 KB

    首发种子版本。

    License: MITSourceSHA-256: 6354a2f8e1176849…

Related skills