The board model (design doc 02 §3): every object TraceMaker reads from a .kicad_pcb,...
compiled custom-rule condition
std::int32_t NetId
0 = no net
PairStats measure_pair(const std::vector< model::Track > &tracks, const std::vector< model::Via > &vias, model::NetId a, model::NetId c, Coord coupled_gap)
geom::Point offset_point(geom::Point p, Dir2 v, double s)
p + s * v, rounded half away from zero (KiCad's KiROUND), so offsets are symmetric about the centreli...
PairRule pair_rule(const model::Board &b, const model::DesignRules &rules, const drc::RuleEngine &re, model::NetId a, model::NetId c, Coord via_mask=0)
via_mask: solder-mask expansion of untented vias (route::Obstacles::via_mask()); two vias then need t...
geom::Point miter_point(geom::Point c, int d1, int d2, double s)
Miter corner of a polyline offset by s (signed: + left) where the centreline turns from direction d1 ...
std::vector< std::pair< model::NetId, model::NetId > > named_pairs(const model::Board &b, const drc::RuleEngine &re)
Net pairs KiCad treats as differential pairs (names ending in P/N or +/-), in net order.
Coord coupled_threshold(const PairRule &r)
Edge gap up to which a sample counts as coupled: the pair's gap plus a quarter of it (at least 50 um)...
std::int64_t Coord
Engine coordinate: signed 64-bit nanometres.
Integer-nanometre points and KiCad-compatible rotation.
Resolves KiCad constraints for pairs of copper items (design doc 03 §6): net-class clearances,...
Design rules as KiCad defines them (design doc 08 §3–4): board minimums and net classes from the ....
Octilinear unit direction d (0..7, E, NE, N, NW, W, SW, S, SE with y down) and its left normal,...
What a pair is routed at.
Coord gap
edge-to-edge gap of the coupled section (target; >= required)
Coord via_offset
centreline to each via centre in a coupled via pair (>= offset)
Coord width
track width of each half
std::optional< Coord > max_uncoupled
per half, both ends together
Coord required_gap
smallest gap the rules allow between the halves
std::string source
"rule", "net class" or "clearance" (for the report)
Coord offset
centreline to each track centre: (width + gap) / 2, rounded up, plus a rounding margin
A routed pair, measured on its tracks: a sample of one half counts as coupled where a parallel track ...
double coupled_share() const
double gap_median
edge gap over coupled samples, nm (0 when nothing is coupled)
double length_b
track length, nm
double coupled_b
coupled track length, nm