kicad2ems.fdtd.faces

Drawn metal's own loss in the FDTD model (--sigma). core.solids' metal pieces
are solid PEC (model._solids); with a conductivity, the faces of them that the
field reaches are conducting sheets on the mesh, as thick copper's faces are
(thick.py): each face one side of a conductor, sigma / 4 and twice the
thickness in openEMS's sheet model, whose impedance is then k / (sigma tanh(k
t)), k = (1 + j) / delta: (1 + j) / (sigma delta) for t of many skin depths.

    fs = faces(ps, lines, zm, fine, box)   # [Face(axis, c, geom, two, t, magnet)]

Which faces. The drawn metal is cut at its heights into slabs; in each slab the
metal of one kind (a magnet's, of its own conductivity, or any other) is a
union of polygons in plan:
  - at each height, the metal below not under more metal faces up and the
    metal above not over more metal faces down (z faces, polygons in plan);
  - in each slab, its union's straight sides along x or y (an edge `fine` long
    or more and within fine / 10 of the axis, as the mesh's lines take them)
    not against the other kind's metal (x and y faces, rectangles);
  - none on the box's planes (an enclosure's outer faces: the mesh ends there
    and there is no field outside);
  - curved and oblique sides are left out: their staircase stays PEC (a post,
    a round can's wall), as vias are.

Each face is put on the mesh line of the body's outermost tangential edges (the
last line inside the metal, not the face's own where a merge moved it, as
openEMS and gfdtd take a body's edges by their midpoints) and is left out
where no line is inside. Two faces of opposite sides on one line (a wall or a
plate one cell thick or less) are one sheet between field on both sides (two:
openEMS's sheet of the conductor's thickness t, sigma in full).
class kicad2ems.fdtd.faces.Face(axis: int, c: float, geom: object, two: bool = False, t: float = 0.0, magnet: bool = False)[source]
A conducting sheet on a drawn metal's faces: normal to `axis` at c (a
mesh line, mm in the mesh's heights); geom (shapely) in plan (x, y) for a
z face, in (t, z) for an x face (t = y) or a y face (t = x); two: both
sides of a wall or plate on one line, t (mm) the metal's thickness there;
magnet: a magnet's (core.solids.MAGNET_SIGMA).
kicad2ems.fdtd.faces.add(CSX, fs, sigma, f_fit, priority, magnet_sigma)[source]
The faces as CSX conducting sheets: one property for the faces (one
side of a conductor FACE_DEPTHS skin depths thick at f_fit, sigma / 4
and twice that in openEMS's model) and one for the two-sided ones (the
conductor's own thickness, at most twice that), each for metal and for
magnets (magnet_sigma). Returns {name: sheet edges' area mm2} for the
log.
kicad2ems.fdtd.faces.body(p, zm, zl)[source]
Whether metal piece p is a body on the mesh (model._solids: a z line
across its heights), not a sheet on its nearest line.
kicad2ems.fdtd.faces.faces(ps, lines, zm=<function <lambda>>, fine=None, box=None)[source]
The drawn metal's faces the field reaches as [Face] (the module's
rules): ps core.solids pieces, lines the mesh's [x, y, z] (z in the
mesh's heights), zm a board height in the mesh's (the thick-copper plan),
fine the mesh's fine cell (sides straighter than fine / 10 and at least
that long), box (x0, y0, z0, x1, y1, z1) board heights: faces on its
planes left out (an enclosure's outer ones).
kicad2ems.fdtd.faces.rects(geom)[source]
A union of rectangles (an x or y face's geometry in (t, z)) as
[(t0, t1, z0, z1)], cut at its heights and the cuts' equal neighbours
joined.
kicad2ems.fdtd.faces.skin_depth(sigma, f)[source]
m: the skin depth at f Hz in a conductor of sigma S/m.