Graphics

class edea.kicad.pcb.graphics.GraphicalText(locked: bool = False, text: str = '', at: ~edea.kicad.pcb.common.Position = <factory>, layer: ~edea.kicad.pcb.common.LayerKnockout | None = None, effects: ~edea.kicad.common.Effects = <factory>, render_cache: ~edea.kicad.pcb.common.RenderCache | None = None, tstamp: ~uuid.UUID | None = None, uuid: ~uuid.UUID | None = None)

Bases: KicadPcbExpr

A graphical text element.

KiCad graphical text

Parameters:
  • locked – Whether the text can move or not.

  • text – The content of the text.

  • at – The X-Y coordinates of the graphical text element.

  • layer – The canonical layer the text resides on.

  • effects – The style of the text.

  • render_cache – Instance of RenderCache object.

  • tstamp – The unique identifier of the text object.

  • uuid – The unique identifier of the text object.

Variables:

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

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
text: str = ''
at: Position
layer: LayerKnockout | None = None
effects: Effects
render_cache: RenderCache | None = None
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['gr_text']] = 'gr_text'
class edea.kicad.pcb.graphics.GraphicalTextBox(locked: bool = False, text: str = '', start: tuple[float, float] | None = None, end: tuple[float, float] | None = None, pts: ~edea.kicad.common.Pts | None = None, 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', effects: ~edea.kicad.common.Effects = <factory>, render_cache: ~edea.kicad.pcb.common.RenderCache | None = None, angle: float | None = None, stroke: ~edea.kicad.common.Stroke | None = None, hide: bool = False, border: bool | None = None, tstamp: ~uuid.UUID | None = None, uuid: ~uuid.UUID | None = None)

Bases: BaseTextBox

A graphical text box in KiCad.

KiCad graphical textbox

Variables:

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

kicad_expr_tag_name: ClassVar[Literal['base_textbox', 'fp_text_box', 'gr_text_box']] = 'gr_text_box'
class edea.kicad.pcb.graphics.GraphicalLine(locked: bool = False, start: tuple[float, float] = (0, 0), end: tuple[float, float] = (0, 0), width: float | None = None, stroke: Stroke | None = None, 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'] | None = None, angle: float | None = None, tstamp: UUID | None = None, uuid: UUID | None = None)

Bases: KicadPcbExpr

A graphical line element.

KiCad graphical line

Parameters:
  • locked – Whether the line can move or not.

  • start – The starting X-Y coordinates of the line.

  • end – The ending X-Y coordinates of the line.

  • width – The width of the line.

  • stroke – Instance of Stroke object defining the line style.

  • layer – The canonical layer the line resides on.

  • angle – The rotational angle of the line.

  • tstamp – The unique identifier of the line object.

  • uuid – The unique identifier of the line object.

Variables:

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

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
start: tuple[float, float] = (0, 0)
end: tuple[float, float] = (0, 0)
width: float | None = None
stroke: Stroke | None = None
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'] | None = None
angle: float | None = None
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['gr_line']] = 'gr_line'
envelope(min_x: float, max_x: float, min_y: float, max_y: float) tuple[float, float, float, float]

Envelopes the line in a bounding box.

Parameters:
  • min_x – Initial minimum X coordinate.

  • max_x – Initial maximum X coordinate.

  • min_y – Initial minimum Y coordinate.

  • max_y – Initial maximum Y coordinate.

Returns:

A tuple of the bounding box verticies with after enveloping the line.

class edea.kicad.pcb.graphics.GraphicalRectangle(locked: bool = False, start: tuple[float, float] = (0, 0), end: tuple[float, float] = (0, 0), width: float | None = None, stroke: Stroke | None = None, fill: Literal['solid', 'yes', 'none'] | None = None, 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'] | None = None, net: int | None = None, tstamp: UUID | None = None, uuid: UUID | None = None)

Bases: KicadPcbExpr

A graphical rectangle.

KiCad graphical rectangle

Parameters:
  • locked – Whether the rectangle can move or not.

  • start – The X-Y coordinates of the upper left corner of the rectangle.

  • width – The line width of the rectangle.

  • end – The X-Y coordinates of the low right corner of the rectangle.

  • stroke – Instance of Stroke object the line style of the rectangle’s edge.

  • fill – How the rectangle is filled.

  • layer – The canonical layer the rectangle resides on.

Variables:

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

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
start: tuple[float, float] = (0, 0)
end: tuple[float, float] = (0, 0)
width: float | None = None
stroke: Stroke | None = None
fill: Literal['solid', 'yes', 'none'] | None = None
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'] | None = None
net: int | None = None
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['gr_rect']] = 'gr_rect'
envelope(min_x: float, max_x: float, min_y: float, max_y: float) tuple[float, float, float, float]

Envelopes the rectangle in a bounding box.

Parameters:
  • min_x – Initial minimum X coordinate.

  • max_x – Initial maximum X coordinate.

  • min_y – Initial minimum Y coordinate.

  • max_y – Initial maximum Y coordinate.

Returns:

A tuple of the bounding box verticies with after enveloping the rectangle.

class edea.kicad.pcb.graphics.GraphicalCircle(locked: bool = False, center: tuple[float, float] = (0, 0), end: tuple[float, float] = (0, 0), stroke: Stroke | None = None, width: float | None = None, fill: Literal['solid', 'yes', 'none'] | None = None, 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'] | None = None, tstamp: UUID | None = None, uuid: UUID | None = None)

Bases: KicadPcbExpr

A graphical circle element.

KiCad graphical circle

Parameters:
  • locked – Whether the circle can move or not.

  • center – The X-Y coordinates of the center of the circle.

  • end – The coordinates of the end of the radius of the circle.

  • stroke – Instance of Stroke object defining the line style of the circle’s edge.

  • width – The line width of the circle.

  • fill – How the circle is filled

  • layer – The canonical layer the circle resides on.

  • tstamp – The unique identifier of the circle object.

  • uuid – The unique identifier of the circle object.

Variables:

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

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
center: tuple[float, float] = (0, 0)
end: tuple[float, float] = (0, 0)
stroke: Stroke | None = None
width: float | None = None
fill: Literal['solid', 'yes', 'none'] | None = None
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'] | None = None
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['gr_circle']] = 'gr_circle'
envelope(min_x: float, max_x: float, min_y: float, max_y: float) tuple[float, float, float, float]

Envelopes the circle in a bounding box.

Parameters:
  • min_x – Initial minimum X coordinate.

  • max_x – Initial maximum X coordinate.

  • min_y – Initial minimum Y coordinate.

  • max_y – Initial maximum Y coordinate.

Returns:

A tuple of the bounding box verticies with after enveloping the circle.

class edea.kicad.pcb.graphics.GraphicalArc(locked: bool = False, start: tuple[float, float] = (0, 0), mid: tuple[float, float] = (0, 0), end: tuple[float, float] = (0, 0), width: float | None = None, stroke: Stroke | None = None, 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'] | None = None, net: int | None = None, tstamp: UUID | None = None, uuid: UUID | None = None)

Bases: KicadPcbExpr

A graphical arc element.

KiCad graphical arc

Parameters:
  • locked – Whether the arc can move or not.

  • start – The X-Y coordinates of the start position of the arc radius.

  • mid – The X-Y coordinates of the midpoint along the arc.

  • end – The X-Y coordinates of the end position of the arc radius.

  • width – The line width of the arc.

  • stroke – Instance of Stroke object defining the line style of the arc’s edge.

  • layer – The canonical layer the arc resides on.

  • net – The net number of the arc.

  • tstamp – The unique identifier of the arc object.

  • uuid – The unique identifier of the arc object.

Variables:

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

Note

The net field got added in 20240108 (KiCad 8).

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
start: tuple[float, float] = (0, 0)
mid: tuple[float, float] = (0, 0)
end: tuple[float, float] = (0, 0)
width: float | None = None
stroke: Stroke | None = None
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'] | None = None
net: int | None = None
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['gr_arc']] = 'gr_arc'
center() tuple[float, float]

Algebraic solution to find the center of an arc given three points on its circumference.

Returns:

(x, y) coordinates of the center of the arc.

angles_rad()

Calculates the angles of the arc in radians.

Returns:

Set of angles in radians.

envelope(min_x: float, max_x: float, min_y: float, max_y: float) tuple[float, float, float, float]

Envelopes the arc in a bounding box.

Parameters:
  • min_x – Initial minimum X coordinate.

  • max_x – Initial maximum X coordinate.

  • min_y – Initial minimum Y coordinate.

  • max_y – Initial maximum Y coordinate.

Returns:

A tuple of the bounding box verticies with after enveloping the arc.

class edea.kicad.pcb.graphics.GraphicalPolygon(locked: bool = False, pts: ~edea.kicad.common.Pts = <factory>, stroke: ~edea.kicad.common.Stroke | None = None, width: float | None = None, fill: ~typing.Literal['solid', 'yes', 'none'] | None = None, 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'] | None = None, net: int | None = None, tstamp: ~uuid.UUID | None = None, uuid: ~uuid.UUID | None = None)

Bases: KicadPcbExpr

A graphical polygon element.

KiCad graphical polygon

Parameters:
  • locked – Whether the polygon can move or not.

  • pts – The list of X-Y coordinates of the polygon outline.

  • stroke – Instance of Stroke object defining the line style of the polygon’s edge.

  • width – The line width of the polygon.

  • fill – How the polygon is filled.

  • layer – The canonical layer the polygon resides on.

  • net – The net number of the polygon.

  • tstamp – The unique identifier of the polygon object.

  • uuid – The unique identifier of the polygon object.

Variables:

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

Note

The net field got added in 20240108 (KiCad 8).

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
pts: Pts
stroke: Stroke | None = None
width: float | None = None
fill: Literal['solid', 'yes', 'none'] | None = None
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'] | None = None
net: int | None = None
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['gr_poly']] = 'gr_poly'
envelope(min_x: float, max_x: float, min_y: float, max_y: float) tuple[float, float, float, float]

Envelopes the polygon in a bounding box.

Parameters:
  • min_x – Initial minimum X coordinate.

  • max_x – Initial maximum X coordinate.

  • min_y – Initial minimum Y coordinate.

  • max_y – Initial maximum Y coordinate.

Returns:

A tuple of the bounding box verticies with after enveloping the polygon.

class edea.kicad.pcb.graphics.GraphicalBezier(locked: bool = False, pts: ~edea.kicad.common.Pts = <factory>, stroke: ~edea.kicad.common.Stroke = <factory>, 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'] | None = None, tstamp: ~uuid.UUID | None = None, uuid: ~uuid.UUID | None = None)

Bases: KicadPcbExpr

A graphical bezier curve element.

KiCad graphical bezier

Parameters:
  • locked – Whether the bezier curve can move or not.

  • pts – A list of X-Y coordinates of the bezier curve.

  • stroke – Instance of Stroke object defining the line style of the bezier curve’s edge.

  • layer – The canonical layer the curve resides on.

  • tstamp – The unique identifier of the curve object.

  • uuid – The unique identifier of the curve object.

Variables:

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

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
pts: Pts
stroke: Stroke
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'] | None = None
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['bezier', 'gr_curve']] = 'bezier'
envelope(min_x: float, max_x: float, min_y: float, max_y: float) tuple[float, float, float, float]

Envelopes the curve in a bounding box.

Parameters:
  • min_x – Initial minimum X coordinate.

  • max_x – Initial maximum X coordinate.

  • min_y – Initial minimum Y coordinate.

  • max_y – Initial maximum Y coordinate.

Returns:

A tuple of the bounding box verticies with after enveloping the curve.

class edea.kicad.pcb.graphics.GraphicalCurve(locked: bool = False, pts: ~edea.kicad.common.Pts = <factory>, stroke: ~edea.kicad.common.Stroke = <factory>, 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'] | None = None, tstamp: ~uuid.UUID | None = None, uuid: ~uuid.UUID | None = None)

Bases: GraphicalBezier

A graphical curve element.

Warning

This isn’t documented in the Kicad docs, but it is in some files. This is what bezier was called before KiCad 7.

Variables:

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

kicad_expr_tag_name: ClassVar[Literal['bezier', 'gr_curve']] = 'gr_curve'
class edea.kicad.pcb.graphics.GraphicalBoundingBox(locked: bool = False, start: tuple[float, float] = (0, 0), end: tuple[float, float] = (0, 0))

Bases: KicadPcbExpr

A graphical bounding box element.

KiCad graphical bounding box

Parameters:
  • locked – Whether the bounding box can move or not.

  • start – The X-Y coordinates of the upper left corner of the rectangle.

  • end – The X-Y coordinates of the low right corner of the rectangle.

Variables:

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

locked: bool = False
start: tuple[float, float] = (0, 0)
end: tuple[float, float] = (0, 0)
kicad_expr_tag_name: ClassVar[Literal['gr_bbox']] = 'gr_bbox'
class edea.kicad.pcb.graphics.DimensionFormatUnits(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The different unit options for dimension text formatting within KiCad.

KiCad dimension format

Inches = '0'
Mils = '1'
Millimeters = '2'
Automatic = '3'
class edea.kicad.pcb.graphics.DimensionFormatUnitsFormat(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The different formatting styles for unit suffixes in dimension text.

KiCad dimension format

NoSuffix = '0'

No unit suffix is appended to the dimension value.

BareSuffix = '1'

The unit suffix is appended directly to the dimension value.

WrapSuffix = '2'

The unit suffix is wrapped in parentheses after the dimension value.

class edea.kicad.pcb.graphics.DimensionFormat(prefix: str | None = None, suffix: str | None = None, units: DimensionFormatUnits = '2', units_format: DimensionFormatUnitsFormat = '2', precision: int = 4, override_value: str | None = None, suppress_zeroes: bool = False)

Bases: KicadPcbExpr

The formatting options for dimension text displayed in KiCad.

KiCad dimension format

Parameters:
  • prefix – the string to add to the beginning of the dimension text.

  • suffix – the string to add to the end of the dimension text.

  • units – The dimension units.

  • units_format – How the unit’s suffix is formatted.

  • precision – The number of significant digits.

  • override_value – The text to substitute for the actual physical dimension.

  • suppress_zeroes – Whether to removes all trailing zeros from the dimension text or not.

Variables:

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

prefix: str | None = None
suffix: str | None = None
units: DimensionFormatUnits = '2'
units_format: DimensionFormatUnitsFormat = '2'
precision: int = 4
override_value: str | None = None
suppress_zeroes: bool = False
kicad_expr_tag_name: ClassVar[Literal['format']] = 'format'
class edea.kicad.pcb.graphics.DimensionStyleTextPositionMode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The different positioning options for dimension text in KiCad.

KiCad dimension style

Outside = '0'
InLine = '1'
Manual = '2'
class edea.kicad.pcb.graphics.DimensionStyleTextFrame(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

The various frame styles for dimension text in KiCad.

KiCad dimension style

NoFrame = '0'
Rectangle = '1'
Circle = '2'
RoundedRectangle = '3'
class edea.kicad.pcb.graphics.DimensionStyle(thickness: float = 0.0, arrow_length: float = 0.0, text_position_mode: DimensionStyleTextPositionMode = '0', extension_height: float | None = None, extension_offset: float | None = None, text_frame: DimensionStyleTextFrame | None = None, keep_text_aligned: bool = False)

Bases: KicadPcbExpr

The visual style options for dimensions displayed in KiCad.

KiCad dimension style

Parameters:
  • thickness – The line thickness of the dimension.

  • arrow_length – The length of the dimension arrows.

  • text_position_mode – The position mode of the dimension text.

  • extension_height – The length of the extension lines past the dimension crossbar.

  • extension_offset – The distance from feature points to extension line start.

  • text_frame – The style of the frame around the dimension text.

  • keep_text_aligned – Whether the dimension text should be kept in line with the dimension crossbar or not.

Variables:

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

thickness: float = 0.0
arrow_length: float = 0.0
text_position_mode: DimensionStyleTextPositionMode = '0'
extension_height: float | None = None
extension_offset: float | None = None
text_frame: DimensionStyleTextFrame | None = None
keep_text_aligned: bool = False
kicad_expr_tag_name: ClassVar[Literal['style']] = 'style'
class edea.kicad.pcb.graphics.GraphicalDimension(locked: bool = False, type: ~typing.Literal['aligned', 'leader', 'center', 'orthogonal', 'radial'] = 'aligned', 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', pts: ~edea.kicad.common.Pts = <factory>, height: float | None = None, orientation: float | None = None, leader_length: float | None = None, gr_text: ~edea.kicad.pcb.graphics.GraphicalText | None = None, format: ~edea.kicad.pcb.graphics.DimensionFormat | None = None, style: ~edea.kicad.pcb.graphics.DimensionStyle = <factory>, tstamp: ~uuid.UUID | None = None, uuid: ~uuid.UUID | None = None)

Bases: KicadPcbExpr

A graphical dimension element.

KiCad graphical dimension

Parameters:
  • locked – Whether the dimension can move or not.

  • type – The type of dimension (aligned, leader, center, orthogonal, and radial).

  • layer – The canonical layer the dimension resides on.

  • pts – A list of X-Y coordinates of the dimension.

  • height – The height of aligned dimensions.

  • orientation – The rotation angle for orthogonal dimensions.

  • leader_length – The distance from the marked radius to the knee for radial dimensions.

  • gr_text – The dimension text formatting for all dimension types except center dimensions.

  • format – The dimension formatting for all dimension types except center dimensions.

  • style – The dimension style information.

  • tstamp – The unique identifier of the dimension object.

  • uuid – The unique identifier of the dimension object.

Variables:

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

Note

The tstamp field got renamed to uuid in 20240108 (KiCad 8).

locked: bool = False
type: Literal['aligned', 'leader', 'center', 'orthogonal', 'radial'] = 'aligned'
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'
pts: Pts
height: float | None = None
orientation: float | None = None
leader_length: float | None = None
gr_text: GraphicalText | None = None
format: DimensionFormat | None = None
style: DimensionStyle
tstamp: UUID | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['dimension']] = 'dimension'