Shapes

Dataclasses describing the graphic items found in .kicad_sch files.

class edea.kicad.schematic.shapes.FillType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: StrEnum

Different types of fills.

NONE = 'none'

No fill.

OUTLINE = 'outline'

Fill the outline of the object.

BACKGROUND = 'background'

Fill the background of the object.

class edea.kicad.schematic.shapes.FillSimple(type: FillType = 'background')

Bases: KicadSchExpr

A simple fill style.

KiCad fill

Parameters:

type – How the object is filled.

Variables:

kicad_expr_tag_name – The tag name for KiCad expression.

type: FillType = 'background'
kicad_expr_tag_name: ClassVar[Literal['fill']] = 'fill'
class edea.kicad.schematic.shapes.FillColor(color: tuple[int, int, int, float] = (0, 0, 0, 0))

Bases: KicadSchExpr

A fill style with a specific color.

KiCad fill

Parameters:

color – The RGBA color value for the fill.

Variables:

kicad_expr_tag_name – The tag name for KiCad expression.

color: tuple[int, int, int, float] = (0, 0, 0, 0)
kicad_expr_tag_name: ClassVar[Literal['fill']] = 'fill'
class edea.kicad.schematic.shapes.FillTypeColor(type: Literal['color'] = 'color', color: tuple[int, int, int, float] = (0, 0, 0, 0))

Bases: KicadSchExpr

A color fill style with a specific color.

KiCad fill

Parameters:
  • type – The type of fill.

  • color – The RGBA color value for the fill.

Variables:

kicad_expr_tag_name – The tag name for KiCad expression.

type: Literal['color'] = 'color'
color: tuple[int, int, int, float] = (0, 0, 0, 0)
kicad_expr_tag_name: ClassVar[Literal['fill']] = 'fill'
class edea.kicad.schematic.shapes.Polyline(pts: ~edea.kicad.common.Pts = <factory>, stroke: ~edea.kicad.common.Stroke = <factory>, fill: ~edea.kicad.schematic.shapes.FillSimple | ~edea.kicad.schematic.shapes.FillColor | ~edea.kicad.schematic.shapes.FillTypeColor | None = None, uuid: ~uuid.UUID | None = None)

Bases: KicadSchExpr

A polyline that defines one or more graphical lines that may or may not define a polygon.

KiCad polyline

Parameters:
  • pts – The list of X-Y coordinates of the line(s).

  • stroke – The stroke style of the polygon formed by the lines.

  • fill – How the polygon is filled.

  • uuid – The unique identifier of the polyline.

Note

The uuid field was added in 20231120 (KiCad 8).

Note

The fill field became optional in 20231120 (KiCad 8).

pts: Pts
stroke: Stroke
fill: FillSimple | FillColor | FillTypeColor | None = None
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['polyline']] = 'polyline'
class edea.kicad.schematic.shapes.Bezier(pts: ~edea.kicad.common.Pts = <factory>, stroke: ~edea.kicad.common.Stroke = <factory>, fill: ~edea.kicad.schematic.shapes.FillSimple | ~edea.kicad.schematic.shapes.FillColor | ~edea.kicad.schematic.shapes.FillTypeColor = <factory>)

Bases: KicadSchExpr

A graphic cubic bezier curve.

KiCad bezier

Parameters:
  • pts – The list of X-Y coordinates of each point of the curve.

  • stroke – The stroke style of the curve outline.

  • fill – How the curve is filled.

pts: Pts
stroke: Stroke
fill: FillSimple | FillColor | FillTypeColor
kicad_expr_tag_name: ClassVar[Literal['bezier']] = 'bezier'
class edea.kicad.schematic.shapes.Rectangle(start: tuple[float, float], end: tuple[float, float], stroke: ~edea.kicad.common.Stroke = <factory>, fill: ~edea.kicad.schematic.shapes.FillSimple | ~edea.kicad.schematic.shapes.FillColor | ~edea.kicad.schematic.shapes.FillTypeColor = <factory>, uuid: ~uuid.UUID | None = None)

Bases: KicadSchExpr

A rectangle.

KiCad rectangle

Parameters:
  • 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.

  • stroke – The line width and style of the rectangle.

  • fill – How the rectangle is filled.

  • uuid – The unique identifier of the rectangle.

Note

The uuid field was added in 20231120 (KiCad 8).

start: tuple[float, float]
end: tuple[float, float]
stroke: Stroke
fill: FillSimple | FillColor | FillTypeColor
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['rectangle']] = 'rectangle'
class edea.kicad.schematic.shapes.Circle(center: tuple[float, float], radius: float, stroke: ~edea.kicad.common.Stroke = <factory>, fill: ~edea.kicad.schematic.shapes.FillSimple | ~edea.kicad.schematic.shapes.FillColor | ~edea.kicad.schematic.shapes.FillTypeColor = <factory>, uuid: ~uuid.UUID | None = None)

Bases: KicadSchExpr

A circle.

KiCad circle

Parameters:
  • center – The coordinates of the center of the circle.

  • radius – The radius of the circle.

  • stroke – The line width and style of the circle.

  • fill – How the circle is filled.

  • uuid – The unique identifier of the rectangle.

Note

The uuid field was added in 20231120 (KiCad 8).

center: tuple[float, float]
radius: float
stroke: Stroke
fill: FillSimple | FillColor | FillTypeColor
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['circle']] = 'circle'
class edea.kicad.schematic.shapes.Radius(at: tuple[float, float], length: float, angles: tuple[float, float])

Bases: KicadSchExpr

A radius.

Parameters:
  • at – The X-Y coordinates of the radius.

  • length – The length of the radius.

  • angles – The rotation angle of the radius.

at: tuple[float, float]
length: float
angles: tuple[float, float]
kicad_expr_tag_name: ClassVar[Literal['radius']] = 'radius'
class edea.kicad.schematic.shapes.Arc(start: tuple[float, float], mid: tuple[float, float], end: tuple[float, float], radius: ~edea.kicad.schematic.shapes.Radius | None = None, stroke: ~edea.kicad.common.Stroke = <factory>, fill: ~edea.kicad.schematic.shapes.FillSimple | ~edea.kicad.schematic.shapes.FillColor | ~edea.kicad.schematic.shapes.FillTypeColor = <factory>, uuid: ~uuid.UUID | None = None)

Bases: KicadSchExpr

An arc.

KiCad arc

Parameters:
  • 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.

  • radius – The radius of the arc.

  • stroke – The stroke style of the arc.

  • fill – How the arc is filled.

  • uuid – The unique identifier of the rectangle.

Note

The uuid field was added in 20231120 (KiCad 8).

start: tuple[float, float]
mid: tuple[float, float]
end: tuple[float, float]
radius: Radius | None = None
stroke: Stroke
fill: FillSimple | FillColor | FillTypeColor
uuid: UUID | None = None
kicad_expr_tag_name: ClassVar[Literal['arc']] = 'arc'