kicad2ems.core.lines.strips

Copper drawn as shapes (rectangles, polygons, zones) turned into line strips for
the line model, so resonators drawn as polygons (hairpins, interdigital fingers,
tapped feeds) become sections.

Only rectilinear shapes (every edge along x or y) are converted; others (a
taper, a teardrop, a rounded pad) keep widening the tracks they overlap
(tlines.NetCopper). A shape is cut on the grid of its vertex coordinates; each
cell belongs to the direction in which the copper runs further through it (its
horizontal or vertical run), and connected cells of one direction form a strip:
a centreline through the middle of the strip (a jog where its middle moves), its
width the narrowest place, its own cells for the width along it. Where a strip
ends on another, its centreline runs on to the other's centreline, so lengths
are counted to the middle of corners and tees (the convention of centreline
lengths); where both end there it is a corner.

    tracks = shape_strips(poly, 'F.Cu', 'RF')  # model coordinates; dicts like
                                               # board.tracks
kicad2ems.core.lines.strips.fan_strip(poly, layer, net, tracks, reach=2.0)[source]
A shape that is not rectilinear but sits across a track as a stub (a
radial stub, a fan): one strip from the track's centreline straight out
through the shape, its region the shape, so the line model slices it into
sections that widen with the copper. Only when the shape reaches `reach`
track widths beyond the track's centreline, mostly on one side: tapers and
teardrops along a track keep widening it. Returns [strip dict] or [].
kicad2ems.core.lines.strips.radial_sector(poly, mid, n, w, tol=0.05)[source]
A fan across a track (centreline point mid, normal n towards the fan,
width w) as a circular sector, the radial stub of qucsator's MRSTUB:
dict(ri, ro (mm, from the sector's apex: where it leaves the track's edge,
its arc), alpha (deg), wf (its width at the track's edge)), or None when the
shape is not one. The apex is a vertex inside the track's copper, or for a
fan cut off at the track's edge, where its two sides meet.
kicad2ems.core.lines.strips.shape_strips(poly, layer, net, aspect=1.0)[source]
Strips (track dicts with 'region' and 'strip': True) of one rectilinear
polygon (model mm).