|
TraceMaker
C++ API of the engine
|
compiled custom-rule condition More...
#include <drc/rule_engine.hpp>
Public Member Functions | |
| RuleEngine (const model::Board &b, const model::DesignRules &r) | |
| ~RuleEngine () | |
| Coord | clearance (const CopperItem &a, const CopperItem &b, int layer) const |
| Required copper-to-copper clearance between two items on a copper layer. | |
| Coord | hole_clearance (const CopperItem *hole_owner, const CopperItem &other, int layer) const |
| Required clearance between a hole and a copper item. | |
| Coord | hole_to_hole (const CopperItem *a, const CopperItem *b) const |
| Coord | edge_clearance (const CopperItem &a, int layer) const |
| std::pair< Coord, Coord > | track_width (const CopperItem &t, int layer) const |
| Minimum and maximum track width (max = 0: none). | |
| Coord | via_diameter_min (const CopperItem &v) const |
| Coord | annular_width_min (const CopperItem &v) const |
| Coord | hole_size_min (const CopperItem *owner) const |
| Coord | max_clearance () const |
| Largest clearance any pair could need (for spatial-index inflation). | |
| void | use_zone_clearance_overrides () |
| KiCad applies a copper zone's own clearance to its fill (ZONE::GetLocalClearance): the larger of it and the net-class clearance, unless a pad override or custom rule decides. | |
| const model::NetClass & | netclass (const CopperItem &it) const |
| bool | coupled_diff_pair (model::NetId a, model::NetId b) const |
| True if the two nets are the P/N (or +/-) halves of one differential pair. | |
| std::pair< std::optional< Coord >, std::optional< Coord > > | length_constraint (model::NetId net) const |
| Length constraint (min, max) of the last custom rule whose condition matches a track of net, if any. | |
| std::optional< Coord > | skew_constraint (model::NetId net) const |
| Maximum skew of the last custom rule with a skew constraint matching a track of net, if any. | |
| std::optional< model::Constraint > | net_constraint (model::NetId net, const std::string &type) const |
| Last custom constraint of type (e.g. diff_pair_gap, diff_pair_uncoupled) whose rule matches a track of net. | |
| std::optional< std::string > | disallowed (const CopperItem &it, int layer) const |
| Name of the last rule disallowing it on layer, if any (KiCad: items_not_allowed). | |
| bool | track_allowed (model::NetId net, int layer) const |
| Router fast paths for a new track or via of net, from rules whose conditions do not depend on the item's position, size or footprint (per-net layer and via-type masks). | |
| bool | via_allowed (model::NetId net, model::ViaType type=model::ViaType::Through) const |
| Blind router probes have no span yet, so either blind/buried keyword conservatively forbids them. | |
| bool | positional_disallow () const |
| A disallow rule on tracks or vias depends on position, size or footprint: the router asks probe_disallowed. | |
| bool | probe_disallowed (const CopperItem &it, model::ViaType type=model::ViaType::Through) const |
| A new track or via (index -1, actual shape, width and layers; a via's layers are its span, which tells blind from buried) is disallowed on one of its layers, every custom rule applied in order as in disallowed(). | |
| Coord | physical_hole_clearance (const CopperItem *hole_owner, const CopperItem &other, int layer) const |
| Hole-to-copper clearance on layer, any net; -1 when no rule matches (KiCad: hole_clearance). | |
| bool | any_physical_hole_clearance () const |
| bool | via_hole_rule_hits_own_tracks (model::NetId net) const |
| True when a physical_hole_clearance rule holds between a via of net and a track of the same net: the tracks that end in a via touch its hole, so every via of that net would break the rule. | |
| Coord | max_physical_hole_clearance () const |
| bool | needs_exact_routing () const |
| Custom rules that the per-class obstacle cache cannot represent require exact per-point checks. | |
| const std::vector< std::string > & | warnings () const |
Friends | |
| class | Condition |
compiled custom-rule condition
Definition at line 22 of file rule_engine.hpp.
| tmk::drc::RuleEngine::RuleEngine | ( | const model::Board & | b, |
| const model::DesignRules & | r ) |
| tmk::drc::RuleEngine::~RuleEngine | ( | ) |
| Coord tmk::drc::RuleEngine::annular_width_min | ( | const CopperItem & | v | ) | const |
|
inline |
Definition at line 70 of file rule_engine.hpp.
| Coord tmk::drc::RuleEngine::clearance | ( | const CopperItem & | a, |
| const CopperItem & | b, | ||
| int | layer ) const |
Required copper-to-copper clearance between two items on a copper layer.
| bool tmk::drc::RuleEngine::coupled_diff_pair | ( | model::NetId | a, |
| model::NetId | b ) const |
True if the two nets are the P/N (or +/-) halves of one differential pair.
| std::optional< std::string > tmk::drc::RuleEngine::disallowed | ( | const CopperItem & | it, |
| int | layer ) const |
Name of the last rule disallowing it on layer, if any (KiCad: items_not_allowed).
| Coord tmk::drc::RuleEngine::edge_clearance | ( | const CopperItem & | a, |
| int | layer ) const |
| Coord tmk::drc::RuleEngine::hole_clearance | ( | const CopperItem * | hole_owner, |
| const CopperItem & | other, | ||
| int | layer ) const |
Required clearance between a hole and a copper item.
| Coord tmk::drc::RuleEngine::hole_size_min | ( | const CopperItem * | owner | ) | const |
| Coord tmk::drc::RuleEngine::hole_to_hole | ( | const CopperItem * | a, |
| const CopperItem * | b ) const |
| std::pair< std::optional< Coord >, std::optional< Coord > > tmk::drc::RuleEngine::length_constraint | ( | model::NetId | net | ) | const |
Length constraint (min, max) of the last custom rule whose condition matches a track of net, if any.
|
inline |
Largest clearance any pair could need (for spatial-index inflation).
Definition at line 39 of file rule_engine.hpp.
|
inline |
Definition at line 74 of file rule_engine.hpp.
|
inline |
Custom rules that the per-class obstacle cache cannot represent require exact per-point checks.
Definition at line 76 of file rule_engine.hpp.
| std::optional< model::Constraint > tmk::drc::RuleEngine::net_constraint | ( | model::NetId | net, |
| const std::string & | type ) const |
Last custom constraint of type (e.g. diff_pair_gap, diff_pair_uncoupled) whose rule matches a track of net.
| const model::NetClass & tmk::drc::RuleEngine::netclass | ( | const CopperItem & | it | ) | const |
| Coord tmk::drc::RuleEngine::physical_hole_clearance | ( | const CopperItem * | hole_owner, |
| const CopperItem & | other, | ||
| int | layer ) const |
Hole-to-copper clearance on layer, any net; -1 when no rule matches (KiCad: hole_clearance).
|
inline |
A disallow rule on tracks or vias depends on position, size or footprint: the router asks probe_disallowed.
Definition at line 64 of file rule_engine.hpp.
| bool tmk::drc::RuleEngine::probe_disallowed | ( | const CopperItem & | it, |
| model::ViaType | type = model::ViaType::Through ) const |
A new track or via (index -1, actual shape, width and layers; a via's layers are its span, which tells blind from buried) is disallowed on one of its layers, every custom rule applied in order as in disallowed().
| std::optional< Coord > tmk::drc::RuleEngine::skew_constraint | ( | model::NetId | net | ) | const |
Maximum skew of the last custom rule with a skew constraint matching a track of net, if any.
| bool tmk::drc::RuleEngine::track_allowed | ( | model::NetId | net, |
| int | layer ) const |
Router fast paths for a new track or via of net, from rules whose conditions do not depend on the item's position, size or footprint (per-net layer and via-type masks).
| std::pair< Coord, Coord > tmk::drc::RuleEngine::track_width | ( | const CopperItem & | t, |
| int | layer ) const |
Minimum and maximum track width (max = 0: none).
| void tmk::drc::RuleEngine::use_zone_clearance_overrides | ( | ) |
KiCad applies a copper zone's own clearance to its fill (ZONE::GetLocalClearance): the larger of it and the net-class clearance, unless a pad override or custom rule decides.
The DRC enables it; the router does not yet (D51: changing it needs a routing benchmark run).
| bool tmk::drc::RuleEngine::via_allowed | ( | model::NetId | net, |
| model::ViaType | type = model::ViaType::Through ) const |
Blind router probes have no span yet, so either blind/buried keyword conservatively forbids them.
Board items are distinguished exactly by whether their span touches an outer copper layer.
| Coord tmk::drc::RuleEngine::via_diameter_min | ( | const CopperItem & | v | ) | const |
| bool tmk::drc::RuleEngine::via_hole_rule_hits_own_tracks | ( | model::NetId | net | ) | const |
True when a physical_hole_clearance rule holds between a via of net and a track of the same net: the tracks that end in a via touch its hole, so every via of that net would break the rule.
|
inline |
Definition at line 77 of file rule_engine.hpp.
|
friend |
Definition at line 117 of file rule_engine.hpp.