netclass.clearance

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

What it is

A net class DECLARES the copper-to-copper spacing its nets should route at. netclass.clearance(class, mm) yields that spacing, held in metres and shown in mm, one row per class that states one. A class that states none yields no row. That absence is a meaningful fact rather than a gap, because the field then cascades to a lower-priority class.

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.

There is no conformance check on this one yet. Clearance IS checked today, by the copper-clearance rule against a universal fabrication floor (0.127mm). That is a different question. That rule asks whether the board is manufacturable, and this relation says what the project itself demanded.

For software engineers

Keyed by CLASS, not by net, and there is no cascaded per-net counterpart for this quantity. Only net.declared_track_width and net.declared_via_drill are derived, because only those two have a board-tier actual to be compared against (WS3-111 scope). Do not join this to net.netclass and treat the result as a per-net limit, because a net in several classes matches several rows. Resolving which one wins is the cascade, and this relation deliberately does not do it for you.

Go projector

netClassDefFacts in stdlib/relations/facts.go walks Model.NetClassDefs(), the ir.Constraint nodes of kind netclass, and parses the clearance 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. design.has_netclass_defs is the marker that 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 it never defined.

Datalog

Every class and its declared value:

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