TraceMaker
C++ API of the engine
Loading...
Searching...
No Matches
connectivity.hpp File Reference

Copper connectivity with KiCad's semantics, shared by the DRC (unconnected/dangling checks) and the router (which pads are already joined). More...

#include <numeric>
#include <vector>
#include "drc/copper.hpp"
#include "geom/poly_index.hpp"
#include "index/uniform_grid.hpp"
#include "model/board.hpp"

Go to the source code of this file.

Classes

struct  tmk::drc::UnionFind
struct  tmk::drc::Connectivity
struct  tmk::drc::ItemGraph
 KiCad 10's item graph (pcbnew/connectivity, CN_VISITOR): items of any nets are linked when their copper touches on a common layer, except two items that cannot change net (pads, zone fills, free vias) on different nets. More...
struct  tmk::drc::ZoneFills
 Edge buckets of every zone fill (geom::PolygonIndex), so the zone questions below cost the nearby edges only. More...

Namespaces

namespace  tmk
namespace  tmk::drc

Functions

Connectivity tmk::drc::compute_connectivity (const model::Board &b, const CopperModel &cm, index::UniformGrid &grid, bool overlap_links=false, const ZoneFills *fills=nullptr)
bool tmk::drc::in_item_graph (const CopperItem &it)
bool tmk::drc::can_change_net (const CopperItem &it)
ItemGraph tmk::drc::item_graph (const model::Board &b, const CopperModel &cm, index::UniformGrid &grid)
std::vector< int > tmk::drc::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, as KiCad's SHAPE::Collide; 1: touching counts), ascending item indices.
std::vector< model::NetId > tmk::drc::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, run by every connectivity build): a via touching only zone fills takes a zone's net (its own if one of the zones has it, else the lowest); then in every cluster of the graph without zones whose pads carry one net only, tracks, arcs, vias and board graphics take that net (a stray via on a track joins the track's net; a track bridging two nets keeps its own).

Detailed Description

Copper connectivity with KiCad's semantics, shared by the DRC (unconnected/dangling checks) and the router (which pads are already joined).

Definition in file connectivity.hpp.