Skip to content

wholeboard.kicad.schematic

Write a KiCad 10 schematic (.kicad_sch) from a design spec.

Every component gets its library symbol (or a generated box symbol when the spec names none). Pins connect through net labels, so the schematic is electrically identical to the board's netlist.

To make it readable: - Each building block (or group named by a component's "sheet") gets a sheet of its own in a hierarchical schematic, with hierarchical labels for the nets it shares with the rest; the main sheet holds the other parts and a sheet symbol per block. - On each sheet the parts are gathered round the IC or connector they share nets with, and the groups run in signal order: connectors, protection, regulators, the main parts, then indicators and controls. - Supply nets use global labels; nets that stay on one sheet use local labels.

symbol_uuid(project, ref)

Stable UUID shared by a schematic symbol and its footprint's path.

load_symbol(lib_id)

The symbol node, with any extends resolved, named 'Lib:Name'.

symbol_pins(node)

Pins per unit (unit 0 = shared by all units).

generic_symbol(lib_id, pads, value)

A rectangle with one pin per pad, pins split between the left and right sides.

stage(c)

Where a part sits in the signal order: connector, protection, regulator, load.

sheets(spec)

The schematic's sheets: the main one, then one per building block (or per component "sheet" name).

ref -> (footprint path, sheet name, sheet file), linking each footprint to its schematic symbol.

build(spec, out_dir)

Write the schematic: .kicad_sch, plus one sheet per building block when the design uses blocks.

crop_svg(svg, extent, margin=6.0)

Crop an exported schematic SVG (units: mm) to the drawn area.