kicad2ems.core.lines.reference¶
The reference copper of a line: which planes lie above and below a trace and
what copper runs beside it (RefCopper, NetCopper: ray casts against the planes,
cut into TILE mm squares), the cross-section that gives (classify: microstrip,
stripline, offset stripline, grounded CPW, embedded microstrip), and a trace cut
into sections where its reference, gap or width changes (_split_by_reference).
- class kicad2ems.core.lines.reference.NetCopper(model, nets, tracks, reach=5.0, strips_=())[source]¶
The line nets' tracks plus their zones and drawn copper (gr_* / fp_* shapes) per layer, in model coordinates: where a shape of the trace's own net overlaps it (a taper, a teardrop, copper drawn in a footprint) the conductor is wider than the track. Pads and vias are not included: they are sections of their own.
- class kicad2ems.core.lines.reference.RefCopper(model, signal_nets)[source]¶
The copper that can be a reference (planes, coplanar ground) for the line sections: every modelled net except the signal nets themselves (so a trace never references itself, a via pad of its own net or the other leg of its differential pair), per layer, in model coordinates; a `ground` layer is the whole outline.
- kicad2ems.core.lines.reference.classify(model, ref, e, pt, d)[source]¶
Set e.xs / z0 / eeff / er / h / s / tand for a trace or pad section on e.layer of width e.w, sampled at pt with direction d (unit vectors, model coordinates); ref: the RefCopper.
- kicad2ems.core.lines.reference.cut(ref, pt, n, R)[source]¶
The reference copper on a line across a strip, R mm either side of its centre pt (n: across it): {layer: [(u0, u1)]}, the pieces along n from pt, sorted; -inf / inf where copper reaches an end of the cut.
- kicad2ems.core.lines.reference.field_mode(v=None)[source]¶
'auto', 'all' or 'off': FIELD (or v: a setting, a flag) as one of its three values.
- kicad2ems.core.lines.reference.group_beyond(args, xs, hs)[source]¶
What a coupled group's cut holds that ideal planes leave out (None: nothing that matters), as _beyond_formula says it of a single section: the group as one strip between its outer edges. Copper between two of its lines always matters.
- kicad2ems.core.lines.reference.group_cut(model, ref, layer, legs, pt, n, hs, up)[source]¶
_strips_section's arguments for a coupled group, cut across its middle: its legs as the strips, and the copper the cut finds on every layer, out to FIELD_REACH reference heights beyond its outer edges, as a single section's cut has it (_cut_args). legs: [(centre along n from pt, width)], in order, pt on the middle between the group's outer edges; hs: its reference heights; up: the copper's thickness grows upward. Widths and gaps are snapped as the groups over ideal planes are (xsection.SIMILAR), and the other copper's distances from the group's outer edges as a single strip's from its own (_snap_distance): similar groups are one solve. Copper of its own layer between two of its lines (a guard trace) is in the cut too, at its place in the gap.
- kicad2ems.core.lines.reference.group_keys(args)[source]¶
(_solve_group's arguments for a group's cut with its copper's thickness and as sheets, flipped): a cut and its mirror image are one solve, and flipped says the lines' order in it is the reverse of the group's.
- kicad2ems.core.lines.reference.mix(diel)[source]¶
(er, tan d) of layers (thickness, er, tand, ...) across a field in series: _dielectric's averages.
- kicad2ems.core.lines.reference.solve_deferred(jobs, workers=None)[source]¶
Solve the sections classify left in DEFER, in the order it met them, their cross-sections in worker processes first where there are many (_in_parallel): a real board's hundreds of cuts take a few seconds instead of half a minute. Where worker processes cannot start, they are solved one after another, as before.