kicad2ems.core.region

Regions and ports beyond port footprints (KiCad coordinates, mm, y down):

- region_polygon(board, region): the area to simulate from a rectangle (x0, y0,
  x1, y1), a list of points, or a drawing layer ('User.1', 'Dwgs.User', ...)
  whose closed shapes outline it.
- auto_nets(board, points, outline): the nets under the port positions plus the
  ground nets.
- ground_nets(items, shapes, outline): the nets that look like ground (any
  coordinates, consistently).
- extra_port_fps(board, specs): ports given in the settings - 'P3=J1.1' (on pad
  1 of J1) or 'P3@x,y[,layer[,rot]]' (at a point) - as footprint-like dicts for
  Board._port.
- cut_port_fps(board, region, nets, layers): a port wherever a track of the
  signal nets crosses the region edge, pointing into the region (the cut line
  ends there, terminated in the port impedance).
kicad2ems.core.region.auto_nets(board, points, outline=None)[source]
nets = 'auto': the nets under the ports [(layer, x, y)] plus the ground
nets.
kicad2ems.core.region.cut_port_fps(board, region, nets, layers, first=1)[source]
Ports where tracks of `nets` cross the edge of `region` (KiCad polygon),
each just inside the edge and pointing into the region. Returns ({port
number: footprint-like dict}, notes).
kicad2ems.core.region.extra_port_fps(board, specs)[source]
{port number: footprint-like dict} for port specs (see
parse_port_spec).
kicad2ems.core.region.ground_nets(items, shapes, outline=None)[source]
Nets that look like ground: named so (GND, AGND, VSS, ...) among the
copper items [(layer, net, geometry)], or whose shapes (zones, drawn copper)
cover at least a fifth of the outline on some layer. A part to such a net is
a shunt to ground; with nets = auto they are always modelled.
kicad2ems.core.region.net_at(board, layer, x, y)[source]
Net of the copper on `layer` at KiCad point (x, y), or None.
kicad2ems.core.region.parse_port_spec(spec)[source]
'P3=J1.1' -> ('P3', 'pad', ('J1', '1')); 'P3@x,y[,layer[,rot]]' -> ('P3',
'at', (x, y, layer, rot)).
kicad2ems.core.region.region_polygon(board, region)[source]
Polygon (KiCad coordinates) of a region setting, or None for no
region.