layers module#
Mapping between JITX conductor indices and Gerber file functions.
LayerModel is the single source of truth for what layer a piece of copper belongs to and which file function names it. It owns no filenames: those are the naming layer’s, and nothing outside format/naming.py builds one.
- normalize_layer(layer, conductors)[source]#
Resolve a JITX layer index to an absolute one with 0 at the top.
Negative indices count from the bottom, as everywhere else in jitx.
- class LayerModel(conductors)[source]#
Bases:
objectConductor indices, sides and the file functions that describe them.
- Parameters:
conductors (
int) – number of conductor layers in the stackup.
- normalize(layer)[source]#
Absolute conductor index, 0 at the top.
- Raises:
IndexError – the index is outside the stackup.
- Return type:
- Parameters:
layer (int)
- copper(layer)[source]#
The Copper,L<n>,<side> function for a conductor.
The index in the attribute is 1-based, counted from the top, while every index this class takes is 0-based; the conversion happens here and nowhere else.