17 explicit UnionFind(std::size_t n) :
p(n) { std::iota(
p.begin(),
p.end(), 0); }
19 while (
p[
static_cast<std::size_t
>(x)] != x) x =
p[
static_cast<std::size_t
>(x)] =
p[
static_cast<std::size_t
>(
p[
static_cast<std::size_t
>(x)])];
25 if (a != b)
p[
static_cast<std::size_t
>(std::max(a, b))] = std::min(a, b);
52 std::vector<std::vector<int>>
adj;
60 std::vector<geom::PolygonIndex>
index;
The board model (design doc 02 §3): every object TraceMaker reads from a .kicad_pcb,...
Copper items with exact shapes, built from the board model, for DRC and routing obstacles.
std::vector< model::NetId > propagate_nets(const CopperModel &cm, const ItemGraph &g, const ZoneFills &zf, index::UniformGrid &grid)
The nets KiCad's DRC sees after loading a board (CN_CONNECTIVITY_ALGO::PropagateNets,...
bool can_change_net(const CopperItem &it)
ItemGraph item_graph(const model::Board &b, const CopperModel &cm, index::UniformGrid &grid)
bool in_item_graph(const CopperItem &it)
std::vector< int > zones_touching(const CopperModel &cm, const ZoneFills &zf, index::UniformGrid &grid, const geom::Shape &s, model::LayerMask layers, Coord clearance=0)
Zone-fill items on layers whose copper is closer than clearance to s (0, the default: overlap only,...
Connectivity compute_connectivity(const model::Board &b, const CopperModel &cm, index::UniformGrid &grid, bool overlap_links=false, const ZoneFills *fills=nullptr)
std::uint64_t LayerMask
bit i = copper layer i in stack order (0 = F.Cu, last = B.Cu)
std::int64_t Coord
Engine coordinate: signed 64-bit nanometres.
Bucketed edges of one large closed polygon (a zone fill), so "does this disk touch the polygon?...
std::vector< std::uint8_t > end_hit
per track/arc item: [2i] start connected, [2i+1] end connected
std::vector< model::LayerMask > via_layers
per via item: layers with a connection
std::vector< int > root
cluster root per copper item
KiCad 10's item graph (pcbnew/connectivity, CN_VISITOR): items of any nets are linked when their copp...
std::vector< std::vector< int > > adj
neighbours of each copper item, ascending (empty for items outside the graph)
Edge buckets of every zone fill (geom::PolygonIndex), so the zone questions below cost the nearby edg...
ZoneFills(const CopperModel &cm)
std::vector< int > slot
per copper item: index into index, -1 if the item is not a zone fill
std::vector< geom::PolygonIndex > index