PCB

Dataclasses describing the contents of .kicad_pcb files.

class edea.kicad.pcb.__init__.General(thickness: float = 0)

Bases: KicadPcbExpr

General board config.

Parameters:

thickness – The overall board thickness.

thickness: float = 0
class edea.kicad.pcb.__init__.StackupLayerThickness(value: float, locked: bool = False)

Bases: KicadPcbExpr

A layer thickness within a stackup in KiCad PCB expressions.

Parameters:
  • value – The thickness value of the layer.

  • locked – Whether the layer thickness is locked or not.

Variables:

kicad_expr_tag_name – The KiCad expression tag name for this element (“thickness”).

value: float
locked: bool = False
kicad_expr_tag_name: ClassVar[Literal['thickness']] = 'thickness'
class edea.kicad.pcb.__init__.StackupLayer(name: str, type: str, color: str | None = None, thickness: StackupLayerThickness | None = None, material: str | None = None, epsilon_r: float | None = None, loss_tangent: float | None = None)

Bases: KicadPcbExpr

A layer within a stackup in KiCad PCB expressions.

KiCad layer

Parameters:
  • name – The name of the layer.

  • type – The type of the layer.

  • color – The layer color.

  • thickness – The thickness of the layer.

  • material – The material of the layer.

  • epsilon_r – The dielectric constant of the layer material.

  • loss_tangent – The loss tangent of the layer material.

Variables:

kicad_expr_tag_name – The KiCad expression tag name for this element (“layer”).

Note

The type field is an arbitrary string, not a CanonicalLayer.

name: str
type: str
color: str | None = None
thickness: StackupLayerThickness | None = None
material: str | None = None
epsilon_r: float | None = None
loss_tangent: float | None = None
kicad_expr_tag_name: ClassVar[Literal['layer']] = 'layer'
class edea.kicad.pcb.__init__.Stackup(layers: list[~edea.kicad.pcb.__init__.StackupLayer] = <factory>, copper_finish: str | None = None, dielectric_constraints: bool = False, edge_connector: ~typing.Literal['yes', 'bevelled', None] = None, castellated_pads: bool = False, edge_plating: bool = False)

Bases: KicadPcbExpr

A PCB stackup in KiCad PCB expressions.

KiCad stackup

Parameters:
  • layers – The individual layers in the stackup.

  • copper_finish – The copper finish type for the PCB (e.g., ENIG, OSP).

  • dielectric_constraints – Whether dielectric constraints are applied during design rule check (DRC) or not.

  • edge_connector – The type of edge connector for the PCB.

  • castellated_pads – Whether castellated pads are used on the PCB or not.

  • edge_plating – Whether edge plating is applied to the PCB or not.

layers: list[StackupLayer]
copper_finish: str | None = None
dielectric_constraints: bool = False
edge_connector: Literal['yes', 'bevelled', None] = None
castellated_pads: bool = False
edge_plating: bool = False
class edea.kicad.pcb.__init__.PlotOutputFormat(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Defines the possible output formats for PCB plots generated in KiCad.

GERBER = '0'

Industry-standard format for PCB manufacturing.

POSTSCRIPT = '1'

Page description language for printing or generating vector graphics.

SVG = '2'

Scalable Vector Graphics format for web or vector editing.

DXF = '3'

Drawing Exchange Format for interoperability with CAD software.

HPGL = '4'

Hewlett-Packard Graphics Language for plotter output.

PDF = '5'

Portable Document Format for universal document sharing.

class edea.kicad.pcb.__init__.PlotSettings(layerselection: str = '0x00010fc_ffffffff', plot_on_all_layers_selection: str = '0x0000000_00000000', disableapertmacros: bool = False, usegerberextensions: bool = False, usegerberattributes: bool = True, usegerberadvancedattributes: bool = True, creategerberjobfile: bool = True, gerberprecision: int | None = None, dashed_line_dash_ratio: float | None = None, dashed_line_gap_ratio: float | None = None, svgprecision: int = 4, excludeedgelayer: bool = False, plotframeref: bool = False, viasonmask: bool = False, mode: Literal[1, 2] = 1, useauxorigin: bool = False, hpglpennumber: int = 1, hpglpenspeed: int = 20, hpglpendiameter: float = 15.0, dxfpolygonmode: bool = True, dxfimperialunits: bool = True, dxfusepcbnewfont: bool = True, psnegative: bool = False, psa4output: bool = False, plotreference: bool = True, plotvalue: bool = True, plotinvisibletext: bool = False, sketchpadsonfab: bool = False, subtractmaskfromsilk: bool = False, outputformat: PlotOutputFormat = '0', mirror: bool = False, drillshape: int = 0, scaleselection: int = 0, outputdirectory: str = '')

Bases: KicadPcbExpr

The settings used for generating PCB plots (fabrication outputs) in KiCad.

Parameters:
  • layerselection – A string representing the bitmask for selecting layers to be plotted.

  • plot_on_all_layers_selection – A string representing another layer selection bitmask.

  • disableapertmacros – Whether to disable aperture macros during plotting or not.

  • usegerberextensions – Whether to use Gerber extensions for advanced features or not.

  • usegerberattributes – Whether to use Gerber attributes for enhanced data embedding or not.

  • usegerberadvancedattributes – Whether to use advanced Gerber attributes or not.

  • creategerberjobfile – Whether to create a Gerber job file or not.

  • gerberprecision – The precision (number of decimal places) used for Gerber data.

  • dashed_line_dash_ratio – The dash-to-gap ratio for dashed lines.

  • dashed_line_gap_ratio – The gap-to-dash ratio for dashed lines.

  • svgprecision – The precision (number of decimal places) used for SVG output.

  • excludeedgelayer – Whether to exclude the edge layer from plotting.

  • plotframeref – Whether to plot frame references.

  • viasonmask – Whether to plot vias on the mask layer.

  • mode – The plot mode (1 or 2, interpretation depends on context).

  • useauxorigin – Whether to use the auxiliary origin for plotting or not.

  • hpglpennumber – The pen number used for HPGL plots.

  • hpglpenspeed – The pen speed used for HPGL plots.

  • hpglpendiameter – The pen diameter used for HPGL plots.

  • dxfpolygonmode – Whether to use polygon mode for DXF output or not.

  • dxfimperialunits – Whether to use imperial units for DXF output or not.

  • dxfusepcbnewfont – Whether to use the KiCad PCB font for DXF output or not.

  • psnegative – Whether to generate negative output for PostScript plots or not.

  • psa4output – Whether to generate PS4 output for PostScript plots or not.

  • plotreference – Whether to plot references (designators) or not.

  • plotvalue – Whether to plot values (component values) or not.

  • plotinvisibletext – Whether to plot invisible text or not.

  • sketchpadsonfab – Whether to include the sketch pad on fabrication output or not.

  • subtractmaskfromsilk – Whether to subtract the mask from the silkscreen during plotting or not.

  • outputformat – The desired output format for the plot files.

  • mirror – Whether to mirror the output or not.

  • drillshape – The drill shape for drill plots.

  • scaleselection – The scale selection for plots.

  • outputdirectory – The output directory for the generated plot files.

Variables:

kicad_expr_tag_name – The KiCad expression tag name for this element (“pcbplotparams”).

Warning

The dashed_line_dash_ratio, dashed_line_gap_ratio, and psa4output are undocumented in the KiCad file format documentation.

layerselection: str = '0x00010fc_ffffffff'
plot_on_all_layers_selection: str = '0x0000000_00000000'
disableapertmacros: bool = False
usegerberextensions: bool = False
usegerberattributes: bool = True
usegerberadvancedattributes: bool = True
creategerberjobfile: bool = True
gerberprecision: int | None = None
dashed_line_dash_ratio: float | None = None
dashed_line_gap_ratio: float | None = None
svgprecision: int = 4
excludeedgelayer: bool = False
plotframeref: bool = False
viasonmask: bool = False
mode: Literal[1, 2] = 1
useauxorigin: bool = False
hpglpennumber: int = 1
hpglpenspeed: int = 20
hpglpendiameter: float = 15.0
dxfpolygonmode: bool = True
dxfimperialunits: bool = True
dxfusepcbnewfont: bool = True
psnegative: bool = False
psa4output: bool = False
plotreference: bool = True
plotvalue: bool = True
plotinvisibletext: bool = False
sketchpadsonfab: bool = False
subtractmaskfromsilk: bool = False
outputformat: PlotOutputFormat = '0'
mirror: bool = False
drillshape: int = 0
scaleselection: int = 0
outputdirectory: str = ''
kicad_expr_tag_name: ClassVar[Literal['pcbplotparams']] = 'pcbplotparams'
class edea.kicad.pcb.__init__.Setup(stackup: ~edea.kicad.pcb.__init__.Stackup | None = None, pad_to_mask_clearance: float = 0.0, solder_mask_min_width: float = 0.0, pad_to_paste_clearance: float = 0.0, pad_to_paste_clearance_ratio: float = 100.0, allow_soldermask_bridges_in_footprints: bool = False, aux_axis_origin: tuple[float, float] = (0.0, 0.0), grid_origin: tuple[float, float] = (0.0, 0.0), pcbplotparams: ~edea.kicad.pcb.__init__.PlotSettings = <factory>)

Bases: KicadPcbExpr

The various settings and properties that govern the overall PCB design

Parameters:
  • stackup – A Stackup instance defining the layer stackup for the PCB.

  • pad_to_mask_clearance – The clearance between pads and the solder mask (in mm).

  • solder_mask_min_width – The minimum width of the solder mask (in mm).

  • pad_to_paste_clearance – The clearance between pads and the solder paste (in mm).

  • pad_to_paste_clearance_ratio – The ratio used to calculate solder paste clearance from pad size.

  • allow_soldermask_bridges_in_footprints – Whether to allow soldermask bridges within footprints or not.

  • aux_axis_origin – The coordinates of the auxiliary axis origin (in mm).

  • grid_origin – The coordinates of the grid origin (in mm).

  • pcbplotparams – A PlotSettings instance defining the PCB plot parameters for generating fabrication outputs.

stackup: Stackup | None = None
pad_to_mask_clearance: float = 0.0
solder_mask_min_width: float = 0.0
pad_to_paste_clearance: float = 0.0
pad_to_paste_clearance_ratio: float = 100.0
allow_soldermask_bridges_in_footprints: bool = False
aux_axis_origin: tuple[float, float] = (0.0, 0.0)
grid_origin: tuple[float, float] = (0.0, 0.0)
pcbplotparams: PlotSettings
class edea.kicad.pcb.__init__.Segment(locked: bool = False, start: tuple[float, float] = (0, 0), end: tuple[float, float] = (0, 0), width: float = 0.0, layer: ~typing.Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'] = 'F.Cu', net: int = 0, tstamp: ~uuid.UUID = <factory>)

Bases: KicadPcbExpr

A PCB trace segment (connection) in KiCad PCB expressions.

Parameters:
  • locked – Whether the line is locked, cannot be edited.

  • start – The starting x-Y coordinates the line (in mm).

  • end – The ending x-Y coordinates of the line (in mm).

  • width – the width of the trace line (in mm).

  • layer – The canonical layer the track segment resides on.

  • net – The net ordinal number which net in the net section that the segment is part of.

  • tstamp – The unique identifier (UUID) for the line object.

locked: bool = False
start: tuple[float, float] = (0, 0)
end: tuple[float, float] = (0, 0)
width: float = 0.0
layer: Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'] = 'F.Cu'
net: int = 0
tstamp: UUID
class edea.kicad.pcb.__init__.Via(type: ~typing.Literal['blind', 'micro', 'through'] = 'through', locked: bool = False, at: tuple[float, float] = (0, 0), size: float = 0, drill: float = 0, layers: list[str] = <factory>, remove_unused_layers: bool = False, keep_end_layers: bool = False, free: bool = False, zone_layer_connections: list[~typing.Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue']] = <factory>, net: int = 0, tstamp: ~uuid.UUID = <factory>)

Bases: KicadPcbExpr

A via (plated hole) in KiCad PCB expressions.

Parameters:
  • type – The type of via (through-hole, blind, or microvia).

  • locked – Whether the via is locked, cannot be edited.

  • at – The coordinates of the center of the via (in mm).

  • size – The diameter of the via annular ring (in mm).

  • drill – The drill diameter of the via (in mm).

  • layers – The canonical layer set the via connects.

  • remove_unused_layers – Whether to remove unused layers from the via or not.

  • keep_end_layers – Whether to keep only the end layers connected to the via or not

  • free – Whether the via is free to be moved outside it’s assigned net.

  • zone_layer_connections – A list of zone layers the via connects to.

  • net – The net ordinal number which net in the net section that the segment is part of.

  • tstamp – The unique identifier (UUID) for the line object.

type: Literal['blind', 'micro', 'through'] = 'through'
locked: bool = False
at: tuple[float, float] = (0, 0)
size: float = 0
drill: float = 0
layers: list[str]
remove_unused_layers: bool = False
keep_end_layers: bool = False
free: bool = False
zone_layer_connections: list[Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue']]
net: int = 0
tstamp: UUID
class edea.kicad.pcb.__init__.Arc(locked: bool = False, start: tuple[float, float] = (0, 0), mid: tuple[float, float] = (0, 0), end: tuple[float, float] = (0, 0), width: float = 0.0, layer: ~typing.Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'] = 'F.Cu', net: int = 0, tstamp: ~uuid.UUID = <factory>)

Bases: KicadPcbExpr

An arc (curved trace segment) in KiCad PCB expressions.

Parameters:
  • locked – Whether the line is locked, cannot be edited.

  • start – The starting X-Y coordinates of the arc (in mm).

  • mid – The midpoint X-Y coordinates of the radius of the arc (in mm).

  • end – The ending X-Y coordinates of the arc (in mm).

  • width – The line width (in mm).

  • layer – The canonical layer the track arc resides on.

  • net – The net ordinal number which net in the net section that the segment is part of.

  • tstamp – The unique identifier (UUID) of the line object.

locked: bool = False
start: tuple[float, float] = (0, 0)
mid: tuple[float, float] = (0, 0)
end: tuple[float, float] = (0, 0)
width: float = 0.0
layer: Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'] = 'F.Cu'
net: int = 0
tstamp: UUID
class edea.kicad.pcb.__init__.Target(type: str, at: ~edea.kicad.pcb.common.Position, size: float, width: float, layer: ~typing.Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'], tstamp: ~uuid.UUID = <factory>)

Bases: KicadPcbExpr

A target (component placement reference) in KiCad PCB expressions.

Parameters:
  • type – The type of target.

  • at – The X-Y coordinates of the target placement (in mm).

  • size – The size of the target (in mm).

  • width – The width of the target.

  • layer – The layer on which the target is placed.

  • tstamp – A unique identifier (UUID) for the target.

type: str
at: Position
size: float
width: float
layer: Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue']
tstamp: UUID
class edea.kicad.pcb.__init__.BoardSize(width_mm: float, height_mm: float)

Bases: object

The overall PCB size in KiCad PCB expressions.

Parameters:
  • width_mm – The width of the PCB board (in mm).

  • height_mm – The height of the PCB board (in mm).

width_mm: float
height_mm: float
class edea.kicad.pcb.__init__.Pcb(version: ~typing.Literal['20221018'] = '20221018', generator: str = 'edea', general: ~edea.kicad.pcb.__init__.General = <factory>, paper: ~edea.kicad.common.PaperUser | ~edea.kicad.common.PaperStandard = <factory>, title_block: ~edea.kicad.common.TitleBlock | None = None, layers: list[tuple[int, ~typing.Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'], ~typing.Literal['jumper', 'mixed', 'power', 'signal', 'user']] | tuple[int, ~typing.Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'], ~typing.Literal['jumper', 'mixed', 'power', 'signal', 'user'], str]] = <factory>, setup: ~edea.kicad.pcb.__init__.Setup = <factory>, properties: list[~edea.kicad.pcb.common.Property] = <factory>, nets: list[~edea.kicad.pcb.common.Net] = <factory>, footprints: list[~edea.kicad.pcb.footprint.Footprint] = <factory>, zones: list[~edea.kicad.pcb.common.Zone] = <factory>, images: list[~edea.kicad.pcb.common.Image] = <factory>, gr_lines: list[~edea.kicad.pcb.graphics.GraphicalLineTopLevel] = <factory>, gr_text_items: list[~edea.kicad.pcb.graphics.GraphicalText] = <factory>, gr_text_boxes: list[~edea.kicad.pcb.graphics.GraphicalTextBox] = <factory>, gr_rects: list[~edea.kicad.pcb.graphics.GraphicalRectangleTopLevel] = <factory>, gr_circles: list[~edea.kicad.pcb.graphics.GraphicalCircleTopLevel] = <factory>, gr_arcs: list[~edea.kicad.pcb.graphics.GraphicalArcTopLevel] = <factory>, gr_curves: list[~edea.kicad.pcb.graphics.GraphicalCurve] = <factory>, gr_polys: list[~edea.kicad.pcb.graphics.GraphicalPolygonTopLevel] = <factory>, beziers: list[~edea.kicad.pcb.graphics.GraphicalBezier] = <factory>, gr_bboxes: list[~edea.kicad.pcb.graphics.GraphicalBoundingBox] = <factory>, dimensions: list[~edea.kicad.pcb.graphics.GraphicalDimension] = <factory>, segments: list[~edea.kicad.pcb.__init__.Segment] = <factory>, vias: list[~edea.kicad.pcb.__init__.Via] = <factory>, arcs: list[~edea.kicad.pcb.__init__.Arc] = <factory>, groups: list[~edea.kicad.pcb.common.Group] = <factory>, targets: list[~edea.kicad.pcb.__init__.Target] = <factory>)

Bases: KicadPcbExpr

A KiCad PCB file.

Parameters:
  • version – The version of the PCB file format.

  • generator – The software generator of the PCB file.

  • general – The general settings of the PCB layout.

  • paper – The paper settings for printing the PCB layout.

  • title_block – The title block information for the PCB layout.

  • layers – A list of layers used in the PCB layout.

  • setup – The setup settings for the PCB layout.

  • properties – A list of properties associated with the PCB layout.

  • nets – A list of nets (connections) in the PCB layout.

  • footprints – A list of footprints used in the PCB layout.

  • zones – A list of copper zones in the PCB layout.

  • images – A list of images included in the PCB layout.

  • gr_lines – A list of graphical lines in the PCB layout.

  • gr_text_items – A list of graphical text items in the PCB layout.

  • gr_text_boxes – A list of graphical text boxes in the PCB layout.

  • gr_rects – A list of graphical rectangles in the PCB layout.

  • gr_circles – A list of graphical circles in the PCB layout.

  • gr_arcs – A list of graphical arcs in the PCB layout.

  • gr_curves – A list of graphical curves in the PCB layout.

  • gr_polys – A list of graphical polygons in the PCB layout.

  • beziers – A list of Bezier curves in the PCB layout.

  • gr_bboxes – A list of graphical bounding boxes in the PCB layout.

  • dimensions – A list of graphical dimensions in the PCB layout.

  • segments – A list of track segments in the PCB layout.

  • vias – A list of vias (connections between layers) in the PCB layout.

  • arcs – A list of arcs in the PCB layout.

  • groups – A list of groups in the PCB layout.

  • targets – A list of targets in the PCB layout.

Variables:

kicad_expr_tag_name – The KiCad expression tag name for this element (“kicad_pcb”).

version: Literal['20221018'] = '20221018'
classmethod check_version(v: Any) Literal['20221018']

Validator for the ‘version’ field, ensures that only the stable KiCad 7 PCB file format.

Parameters:

v – The version value to validate.

Returns:

The validated version value.

Raises:

VersionError – If an unsupported version is provided.

generator: str = 'edea'
general: General
paper: PaperUser | PaperStandard
title_block: TitleBlock | None = None
layers: list[tuple[int, Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'], Literal['jumper', 'mixed', 'power', 'signal', 'user']] | tuple[int, Literal['F.Cu', 'In1.Cu', 'In2.Cu', 'In3.Cu', 'In4.Cu', 'In5.Cu', 'In6.Cu', 'In7.Cu', 'In8.Cu', 'In9.Cu', 'In10.Cu', 'In11.Cu', 'In12.Cu', 'In13.Cu', 'In14.Cu', 'In15.Cu', 'In16.Cu', 'In17.Cu', 'In18.Cu', 'In19.Cu', 'In20.Cu', 'In21.Cu', 'In22.Cu', 'In23.Cu', 'In24.Cu', 'In25.Cu', 'In26.Cu', 'In27.Cu', 'In28.Cu', 'In29.Cu', 'In30.Cu', 'B.Cu', 'B.Adhes', 'F.Adhes', 'B.Paste', 'F.Paste', 'B.SilkS', 'F.SilkS', 'B.Mask', 'F.Mask', 'Dwgs.User', 'Cmts.User', 'Eco1.User', 'Eco2.User', 'Edge.Cuts', 'F.CrtYd', 'B.CrtYd', 'F.Fab', 'B.Fab', 'User.1', 'User.2', 'User.3', 'User.4', 'User.5', 'User.6', 'User.7', 'User.8', 'User.9', 'Margin', 'Rescue'], Literal['jumper', 'mixed', 'power', 'signal', 'user'], str]]
setup: Setup
properties: list[Property]
nets: list[Net]
footprints: list[Footprint]
zones: list[Zone]
images: list[Image]
gr_lines: list[GraphicalLineTopLevel]
gr_text_items: list[GraphicalText]
gr_text_boxes: list[GraphicalTextBox]
gr_rects: list[GraphicalRectangleTopLevel]
gr_circles: list[GraphicalCircleTopLevel]
gr_arcs: list[GraphicalArcTopLevel]
gr_curves: list[GraphicalCurve]
gr_polys: list[GraphicalPolygonTopLevel]
beziers: list[GraphicalBezier]
gr_bboxes: list[GraphicalBoundingBox]
dimensions: list[GraphicalDimension]
segments: list[Segment]
vias: list[Via]
arcs: list[Arc]
groups: list[Group]
targets: list[Target]
insert_layout(name: str, layout: Pcb, uuid_prefix: UUID | None = None) None

Inserts another PCB layout into this one.

Parameters:
  • name – The name of the layout being inserted.

  • layout – The layout object to be inserted.

  • uuid_prefix – UUID prefix.

size()

Calculates the size (width, height) of the board.

Returns:

The calculated board size.

Raises:
kicad_expr_tag_name: ClassVar[Literal['kicad_pcb']] = 'kicad_pcb'
exception edea.kicad.pcb.__init__.MissingBoardOutlineError

Bases: ValueError

This exception is raised when the PCB layout is missing the board outline information.

This error indicates a critical issue with the PCB data as the board outline defines the physical dimensions of the PCB.