via module#
Via definitions#
This module provides classes for defining vias, including via types, backdrill specifications, and via properties.
- class Via[source]#
Bases:
PositionableVia definition that can be instantiated in the board. Layer indexes referenced in this definition are absolute in the board: 0 is always the top layer. They are not relative to any component / circuit. Flipping via instances in the UI will not flip those layers, contrary to landpattern pads.
>>> class StandardVia(Via): ... start = Side.Top ... stop = Side.Bottom ... diameter = 0.6 ... diameters = {0: 0.5, 1: ViaDiameter(0.5, nfp=0.2)} ... hole_diameter = 0.3 ... type = ViaType.MechanicalDrill
- type: ClassVar[ViaType]#
MechanicalDrill or LaserDrill.
- Type:
Type of via drilling method
- start_layer: ClassVar[int]#
Starting layer for the via. Setting this to a layer index other than the top layer allows for creating buried or blind vias.
- stop_layer: ClassVar[int]#
Ending layer for the via.
- diameter: ClassVar[float | ViaDiameter]#
Pad diameter of the via, in mm. Can be overridden on a per-layer basis by
diameters.
- diameters: dict[int | tuple[int, ...], float | ViaDiameter] = {}#
Pad diameters of the via for specific layers. Overrides
diameterfor the given layers.
- hole_diameter: ClassVar[float]#
Drilled or laser-cut hole diameter for the via, in mm.
- filled: ClassVar[bool] = False#
Whether the via is filled.
- tented: ClassVar[set[Side] | Side | None | bool] = True#
Whether the via is tented on Top, Bottom, or both sides. Untented sides will have a solder mask opening.
- via_in_pad: ClassVar[bool] = False#
Whether the via is allowed to be placed inside a component’s pads.
- backdrill: ClassVar[BackdrillSet | Backdrill | None] = None#
Backdrill specifications. If a
Backdrillis used, it will be assumed to be drilled from bottom.
- models: ClassVar[dict[tuple[int, int], PinModel]] = {}#
Specifies delay and loss models for the via.
- class ViaDiameter(pad, *, nfp=None)[source]#
Diameters of various features of a via.
-
nfp:
float|None= None# Pad diameter for the via when non-functional pads are removed, in mm. When provided, it overrides the pad diameter except on the start layer if there is no top backdrill, stop layer if there is no bottom backdrill and intermediate copper layers that have traces or pours connected to the via.
-
nfp:
- class ViaType(*values)[source]#
Bases:
EnumType of via drilling method.
- MechanicalDrill = 1#
- LaserDrill = 2#
- class Backdrill(diameter, startpad_diameter, solder_mask_opening, copper_clearance)[source]#
Backdrill specification for a via.
- Parameters: