netclass.track_width

the track width a net class declares its nets should route at (metres, shown in mm)

What it is

netclass.track_width(class, mm) yields one row per net class that DECLARES a track width for its nets. The width is held in metres and shown in mm. A class that states no track width yields no row, which is a meaningful fact rather than a gap, because that field then cascades to a lower-priority class.

This is the DECLARED side. board.track_width(net, mm) is the ACTUAL side, in the same units, so the two join without conversion.

For hardware engineers

This is the number you typed into Board Setup for that class, read back. Query it to confirm the engine sees the constraints you set, and to check the project against itself. The declared width records what you intended and the routed width records what happened. A review that compares them contains no number the tool invented.

For software engineers

Keyed by CLASS, not by net, and it is NOT what a rule should compare against. A net can be in several classes, so joining net.netclass to this relation fans out and compares the net’s copper against EVERY class it belongs to. A net correctly routed at its winning class’s width will then “fail” against a losing class’s. Join net.declared_track_width(net, mm) instead, which resolves the cascade first. This relation exists for introspection and for authoring, not for comparison.

Go projector

netClassDefFacts in stdlib/relations/facts.go walks Model.NetClassDefs(), the ir.Constraint nodes of kind netclass, and parses the track_width param. Populated in the I/O layer by kicad.AnnotateNetClassDefs from the sibling .kicad_pro net_settings.classes[] (WS3-111).

Absence is not a pass

Only a KiCad project read populates this. An EDIF netlist, an IPC-2581 board, a bare .kicad_sch, and a KiCad project that defines no classes all leave it empty, and a rule scoped by it would find nothing and read clean. design.has_netclass_defs separates those cases. It is deliberately distinct from design.has_netclass, because membership and definitions are independent blocks of net_settings, so a project can assign nets to a class without defining it.

Datalog

Every class and its declared width:

netclass.track_width(?class, ?mm) => ?class, ?mm