kicad2ems.core.importers.kicad.shapes

Geometry helpers for KiCad items: rotation, arcs and curves as polylines,
graphic shapes (gr_* / fp_*) and pad outlines (KiCad mm, y down).
kicad2ems.core.importers.kicad.shapes.arc_node_points(node)[source]
Points of a gr_arc / fp_arc: start-mid-end (KiCad 6+), or centre (start),
end point (end) and angle in degrees (KiCad 5).
kicad2ems.core.importers.kicad.shapes.arc_points(p0, pm, p1, seg=0.1)[source]
Points along the circular arc start-mid-end (KiCad mm); the first and
last points are p0 and p1 exactly, so arcs join the lines next to them.
kicad2ems.core.importers.kicad.shapes.bezier_points(pts, n=24)[source]
Cubic Bezier (4 control points) as a polyline.
kicad2ems.core.importers.kicad.shapes.graphic(node, filled_default=True)[source]
Shapely geometry of a graphic item (gr_* / fp_* / pad primitive): line,
arc, rect, circle, poly or curve, in the item's own coordinates. Strokes are
buffered by half their width; closed shapes are filled unless their fill
flag says otherwise (then only the stroke remains). None when it has no area
(a zero-width line, an unfilled shape without a stroke).
kicad2ems.core.importers.kicad.shapes.outline_ring(node)[source]
The edge a graphic item draws (Edge.Cuts): a LineString / closed ring,
whatever its width.
kicad2ems.core.importers.kicad.shapes.oval(w, h)[source]
A w x h oval (a stadium: its short sides round), centred on the
origin.
kicad2ems.core.importers.kicad.shapes.pad_shape(pad)[source]
Pad outline in pad-local mm coordinates (before rotation/translation).
kicad2ems.core.importers.kicad.shapes.place(geom, origin, deg)[source]
Rotate a local KiCad-mm geometry by a KiCad angle and translate to
origin.
kicad2ems.core.importers.kicad.shapes.rot(v, deg)[source]
Rotate a KiCad-coordinate vector by a KiCad angle (CCW on screen, y
down).
kicad2ems.core.importers.kicad.shapes.text_hidden(node)[source]
KiCad's hidden text: (hide yes) (KiCad 8+), or a bare hide token on the
text or in its effects.
kicad2ems.core.importers.kicad.shapes.text_shape(node, text, origin=(0.0, 0.0), deg=0.0, absolute_angle=True)[source]
The copper of a text (gr_text, fp_text, a footprint property), KiCad mm,
y down, and whether it is exact. A text KiCad has outlined (its
render_cache: TrueType faces) is those polygons, exact; one in the stroke
font is drawn from a stand-in font (_glyphs) in the text's size, thickness,
justification and angle. A knockout text is its box less the glyphs. origin,
deg: a footprint's (the text's at is then its own frame).