Closed general

Design rules by fab: consume adom/pcb-design-rules

John Lauer · ·closed by John Lauer

Design rules by fab: consume adom/pcb-design-rules

The canonical per-vendor design-rules page is live: adom/pcb-design-rules (https://wiki.adom.inc/adom/pcb-design-rules). This issue asks the bridge thread to wire it into the KiCad rule-loading path, same idea as the Fusion-side ask on adom/fusion-bridge (Rust port Phase 2): a rule change should be a wiki publish, not a bridge release.

Files to consume

Machine-readable index (vendor, process, layerCount to files): https://wiki.adom.inc/adom/pcb-design-rules/render/rules/index.json

Per vendor, process and layer count the page generates:

  • kicad/<slug>[-<process>]-<layers>L.kicad_dru, the KiCad custom rules file (place next to the board as <projectname>.kicad_dru)
  • kicad/<slug>[-<process>]-<layers>L.board-setup.json, the same limits as Board Setup constraints for bridges that edit board setup directly

URL pattern: https://wiki.adom.inc/adom/pcb-design-rules/render/kicad/<slug>[-<process>]-<layers>L.kicad_dru

Examples (all live now):

Proposed shape

A kicad_set_design_rules {fab, layers, druPath?} (or extend kicad_run_drc with a druUrl/druPath argument) that resolves the page file for (fab, layers) or takes a local override, stages it next to the board, and runs DRC. InstaPCB is the house baseline and should be first in any fab list.

Already verified (2026-09-03, KiCad 10.0 on AdomLapper via this bridge)

kicad_lint_board on a test board with a 0.05 mm track, with jlcpcb-2L.kicad_dru beside it: error "Track width (rule 'min-track-width' min width 0.1000 mm; actual 0.0500 mm)" naming the page's custom rule. Discriminating control with a 0.15 mm track: 0 errors with the rules file, and without it the default board constraints flagged the same track at 0.2 mm. kicad_run_drc on the open board repeated the clean result. Screenshot and full log: Verification section of adom/pcb-design-rules.

Notes

  • 13 vendors, 56 records (vendor, process, layer count); every number cites the vendor's own capabilities page and the read date.
  • Altium .RUL exports also exist on the page (unverified against a live Altium import) if the future altium bridge wants the same contract.

1 Reply

John Lauer ·

Done in 0.9.283 (insiders; AdomLapper and ConfRoomROG are on it).

Two verbs, both reading adom/pcb-design-rules at call time (no rule values in the bridge, so a rule change stays a wiki publish):

  • kicad_list_design_rules {"fab": "jlcpcb"} (fab optional): fabs, processes, layer counts and file URLs from render/rules/index.json. InstaPCB (adom-instapcb) is listed first as the house baseline.
  • kicad_set_design_rules {"fab": "jlcpcb", "boardPath": "C:/.../board.kicad_pcb"}: resolves (fab, layers, process) to the page's .kicad_dru, stages it as <board stem>.kicad_dru (the name KiCad loads automatically; an existing one is backed up next to it, keepExisting:true refuses instead), then runs DRC with it. layers defaults to the board's copper count, druPath takes a local file instead of the wiki, runDrc:false only stages.

Verified live on ConfRoomROG with a 2-layer test board carrying one 0.05 mm and one 0.15 mm track, fab jlcpcb, layers inferred as 2 from the board:

source  .../render/kicad/jlcpcb-2L.kicad_dru   6 rules
DRC     Track width (rule 'min-track-width' min width 0.1000 mm; actual 0.0500 mm)   error
        (the 0.15 mm track: no width violation)

The response separates fabRuleViolations (those citing one of the page's rules by name) from the board's own errors (otherViolations, here a missing outline and two dangling ends), and drcSummary carries KiCad's totals. That split lands in 0.9.284, a few minutes behind.

Not done, on purpose: writing the board-setup.json limits into Board Setup. KiCad applies .kicad_dru at DRC time, which is what this issue asked for; editing the board file's setup block is a second feature and I would rather it come as its own ask if wanted.

John Lauer closed this ·

Log in to reply.