8#include <unordered_map>
68 std::vector<Point>
pts;
88 std::vector<Point>
pts;
181 std::vector<std::pair<int, std::vector<Point>>>
fills;
211 const std::string&
copper_name(
int idx)
const {
return layers[
static_cast<std::size_t
>(
copper[
static_cast<std::size_t
>(idx)])].name; }
ZoneConnect
How a pad joins a zone of its net (KiCad's ZONE_CONNECTION; the file stores these numbers).
constexpr LayerMask layer_bit(int copper_index)
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::int64_t Coord
Engine coordinate: signed 64-bit nanometres.
Integer-nanometre points and KiCad-compatible rotation.
Lossless s-expression documents for KiCad files (design doc 08 §3).
The board's physical stackup as KiCad stores it in (setup (stackup ...)) (design doc 15 §5....
std::unordered_map< std::string, NetId > net_index
const std::string & copper_file_name(int idx) const
bool infer_graphic_nets
Board-level copper graphics (polygons on a copper layer) take the net of the one net whose pads,...
std::vector< Graphic > graphics
std::vector< int > copper
indices into layers, in stack order
bool named_nets
true for KiCad 10 "(net "name")" syntax
std::vector< Track > tracks
std::vector< ArcTrack > arcs
Stackup stackup
(setup (stackup ...)); present == false when the file has none
bool vias_tented
(setup (tenting front back)); old boards: untented
Box edge_bbox() const
Bounding box of everything on Edge.Cuts (graphics stroke widths excluded).
std::vector< std::string > warnings
std::vector< Zone > zones
NetId net_by_name(std::string_view name) const
0 if unknown
const std::string & copper_name(int idx) const
int copper_index(std::string_view name) const
-1 if not copper (canonical or file name)
std::vector< Net > nets
nets[0] is the unnamed net
std::vector< LayerDef > layers
std::vector< Text > texts
std::vector< Footprint > footprints
Coord pad_to_mask_clearance
board solder-mask expansion for pads (setup)
NetId net
KiCad 8+ copper graphics can belong to a net.
int footprint
owning footprint, -1 for board graphics
std::vector< Point > pts
poly / curve control points
enum tmk::model::Graphic::Kind kind
Point c
line: a→b; arc: start a, mid c, end b; circle: centre a, point b; rect: a,b corners
int ordinal
KiCad layer id as written in the file.
std::string user_name
optional user-visible name
int copper_index
stack index for copper layers, -1 otherwise
std::string file_name
name as written in this file's layer table (old boards may use "Front")
std::string type
signal, power, mixed, jumper, user
std::string name
canonical name, e.g. "F.Cu", "In1.Cu", "Edge.Cuts"
int file_number
number in a KiCad <= 9 net table, -1 for KiCad 10 files
Custom-pad primitives in the pad frame, each already grown by half its stroke width (KiCad draws them...
enum tmk::model::Pad::CustomPrim::Kind kind
std::string pinfunction
Schematic pin name and electrical type (KiCad 6+ boards; empty in older files).
std::vector< std::string > layers
all layer names as written (incl. mask/paste, wildcards expanded)
Coord thermal_bridge_width
local overrides, -1 = none
double thermal_bridge_angle
degrees; -1 = KiCad's default (45 for round pads, 90 otherwise)
LayerMask copper
copper layers the pad has copper on
Coord clearance
local override, -1 = none
Point drill_offset
copper shape offset from the hole (pad position), in the pad's own frame
Coord trapezoid_dy
rect_delta
std::vector< CustomPrim > custom_prims
std::uint8_t chamfer_corners
bit 0 TL, 1 TR, 2 BL, 3 BR
ZoneConnect zone_connect
(zone_connect n)
Coord mask_margin
local solder-mask expansion (unset = INT64_MIN)
double angle
absolute orientation, degrees
int justify_v
-1 top, 0 centre, 1 bottom
std::string layer
< copper text is an obstacle; only position, layer and rough extent are kept
int justify_h
-1 left, 0 centre, 1 right
bool free
(free yes): a stitching via whose net KiCad's connectivity never changes
int layer_bottom
copper indices, top <= bottom
std::vector< std::vector< Point > > outline
main outline + holes (arcs flattened)
std::string uuid
breaks priority ties between zones of different nets (ZONE::HigherPriority)
ZoneConnect connect
Fill settings (doc 05 §36); defaults are KiCad's.
Coord thermal_bridge_width
double island_area_min
nm²
bool teardrop
(attr (teardrop ...)): copper KiCad adds where a track meets a pad or via, not a plane
Coord clearance
(connect_pads (clearance x)): the zone's local clearance override, -1 = none
bool hatched
(fill (mode hatch))
std::vector< std::string > layers
int island_removal
0 always remove islands, 1 never, 2 below island_area_min
std::vector< std::pair< int, std::vector< Point > > > fills
(copper index, filled polygon)