66 const std::vector<model::ArcTrack>& arcs,
const std::vector<model::Via>& vias);
94 const std::vector<std::uint8_t>& net_routed,
const BusGroup& g);
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
std::uint64_t LayerMask
bit i = copper layer i in stack order (0 = F.Cu, last = B.Cu)
std::optional< Coord > bus_rule_skew(const drc::RuleEngine &re, const BusGroup &g)
The skew limit the board's custom rules give a group: every member must match a rule with a skew cons...
BusStats measure_bus(const model::Board &b, const ViaHeights &vh, const std::vector< model::Track > &tracks, const std::vector< model::ArcTrack > &arcs, const std::vector< model::Via > &vias, const std::vector< std::uint8_t > &net_routed, const BusGroup &g)
net_routed[net]: nets_joined() of the board the copper belongs to; b gives the pads,...
BusGroup bus_from_option(const model::Board &b, const std::string &spec)
"NAME=PATTERN" as given to –bus.
std::vector< BusGroup > detect_buses(const model::Board &b, int min_members=4)
Automatic detection (–buses), conservative: nets whose names differ only in a trailing decimal index ...
bool bus_pattern_match(const std::string &pattern, const std::string &net_name)
Bus patterns select nets by their full name (KiCad's, with the sheet path: "/D0", "/MEM/DQ3").
std::vector< std::uint8_t > nets_joined(const model::Board &b, const model::DesignRules &rules)
Per net: 1 when all its pads are joined by copper (the router's own connectivity; nets without pads c...
bool natural_less(std::string_view a, std::string_view b)
Natural order of two names: runs of digits compare as numbers, everything else byte by byte.
double net_via_length(const model::Board &b, const ViaHeights &vh, model::NetId net, const std::vector< model::Track > &tracks, const std::vector< model::ArcTrack > &arcs, const std::vector< model::Via > &vias)
The via length of one net on the given copper, as KiCad sums it: each via counts between the outermos...
ViaHeights via_heights(const model::Board &b, const model::DesignRules &rules)
std::int64_t Coord
Engine coordinate: signed 64-bit nanometres.
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 ....
Coord skew_limit
largest allowed difference in length between members; 0 = none
std::string source
"option" (–bus) or "detected" (–buses)
std::string skew_source
"rule" (a custom skew rule of the board), "option" (–bus-skew-mm) or empty
std::vector< model::NetId > members
in bus order: natural sort of the net names (D2 before D10)
A group as routed, measured on copper.
model::LayerMask layers
copper layers carrying tracks of the net
bool routed
every pad of the net is joined
double via_length
nm, the vias' part of length
bool followed
routed with the group's reference via count and layers
double length
nm, tracks and vias
int followed
The reference is the via count and layer set most members share (ties: the first member's in group or...
int vias_max
over routed members
model::LayerMask ref_layers
std::vector< BusMember > members
group order
The length a via adds to its net in KiCad's length calculation, which its skew check uses (KiCad 10,...
Coord between(int a, int b) const
copper indices, either order; 0 for a == b
std::vector< Coord > from
std::vector< Coord > to
per copper layer: where a via starting / ending on it begins / ends, nm from the top