pads module#
- class ShapeAdjustment[source]#
Base class to be used in a
PadConfigto specify how to adjust a template shape to generate the shape for a specific feature (cutout, soldermask, paste, etc.).
- class RelAdj(amount)[source]#
Bases:
ShapeAdjustmentRelative Adjustment Amount
This class indicates a relative (proportional) amount to adjust the template shape for a pad by to generate the shape for a specific feature (cutout, soldermask, paste, etc.). A value of 0.0 indicates no adjustment, 1.0 indicates a doubling in size, -0.5 indicates a halving in size.
- Parameters:
amount (float)
- make_feature_shape(template, config)[source]#
Make a feature shape from a template and a pad feature configuration
This function is used to create the shapes for the soldermask, paste, and cutout features of a pad.
- smaller_shape(a, b)[source]#
Return the shape with the smaller bounding box area
This function is used to determine the smaller of two shapes based on their bounding box area. If either shape is
None, the other shape is returned. If both shapes areNone,Noneis returned.
- copper_contains_cutout(copper, cutout)[source]#
Check if a copper shape contains a cutout shape
This function checks if a copper shape contains a cutout shape. If the cutout shape is
Noneor an empty shape, this function returnsTrue. If the copper shape isNoneor an empty shape, this function returnsFalse.
- class SMDPad(copper, *, soldermask=Ellipsis, paste=Ellipsis)[source]#
Bases:
PadSMD Pad
This class creates an SMD landpattern pad. By default, the soldermask shape is the copper shape expanded by the current design soldermask registration amount. The paste shape is the smaller of the copper and soldermask shapes.
- Parameters:
copper (Shape)
soldermask (PadFeatureConfig | EllipsisType)
paste (PadFeatureConfig | EllipsisType)
- soldermask: Soldermask | None = None#
The soldermask shape for the pad
- paste: Paste | None = None#
The paste shape for the pad
- class THPad(copper, cutout, *, soldermask=Ellipsis, paste=None)[source]#
Bases:
PadThrough-Hole Pad
This class creates a through-hole landpattern pad. By default, the soldermask shape is the copper shape expanded by the current design soldermask registration amount, and no paste is generated.
- Parameters:
- cutout: Cutout | None = None#
The cutout shape for the pad
- soldermask: Soldermask | None = None#
The soldermask shape for the top side of the pad
- soldermask_bottom: Soldermask | None = None#
The soldermask shape for the bottom side of the pad
- paste: Paste | None = None#
The paste shape for the pad
- class NPTHPad(cutout, *, soldermask=Ellipsis)[source]#
Bases:
CompositeNon-Plated Through-Hole “Pad”
This class creates a non-plated through-hole landpattern object. Since
Padimplies a possible connection with aPortand requires a copper shape, this class is not actually aPad, but rather a subclass ofCompositeinstead and will just generate a hole in the landpattern that can’t be connected.- Parameters:
cutout (Cutout)
soldermask (Soldermask | None)
- cutout: Cutout#
The cutout shape for the pad
- soldermask: Soldermask | None = None#
The soldermask shape for the top side of the pad
- soldermask_bottom: Soldermask | None = None#
The soldermask shape for the bottom side of the pad
- class PadConfig[source]#
Pad Configuration
This abstract class defines an interface for classes to specify how pads should be constructed from a template shape.
- class SMDPadConfig(copper=Ellipsis, soldermask=Ellipsis, paste=Ellipsis)[source]#
Bases:
PadConfigSMD Pad Configuration
This class specifies how the feature shapes for an SMD pad should be constructed from a template shape. The default behaviors are: - copper = match template - soldermask = expand template by the design soldermask registration amount - paste = smaller of copper or soldermask
- Parameters:
copper (PadFeatureConfig | EllipsisType)
soldermask (PadFeatureConfig | EllipsisType)
paste (PadFeatureConfig | EllipsisType)
-
copper:
TypeAliasType|EllipsisType= Ellipsis# The copper shape configuration
-
soldermask:
TypeAliasType|EllipsisType= Ellipsis# The soldermask shape configuration
-
paste:
TypeAliasType|EllipsisType= Ellipsis# The paste shape configuration
- class THPadConfig(copper=Ellipsis, cutout=Ellipsis, soldermask=Ellipsis, paste=Ellipsis)[source]#
Bases:
PadConfigThrough-Hole Pad Configuration
This class specifies how the feature shapes for a through-hole pad should be constructed from a template shape. The default behaviors are: - copper = match template - cutout = match template - soldermask = expand copper by the design soldermask registration amount - paste = do not generate
- Parameters:
copper (PadFeatureConfig | EllipsisType)
cutout (PadFeatureConfig | EllipsisType)
soldermask (PadFeatureConfig | EllipsisType)
paste (PadFeatureConfig | EllipsisType)
-
copper:
TypeAliasType|EllipsisType= Ellipsis# The copper shape configuration
-
cutout:
TypeAliasType|EllipsisType= Ellipsis# The cutout shape configuration
-
soldermask:
TypeAliasType|EllipsisType= Ellipsis# The soldermask shape configuration
-
paste:
TypeAliasType|EllipsisType= Ellipsis# The paste shape configuration
- class IPCTHPadConfig(copper=Ellipsis, cutout=Ellipsis, soldermask=Ellipsis, paste=Ellipsis, density_level=Ellipsis)[source]#
Bases:
PadConfigIPC Through-Hole Pad Configuration
This class uses the IPC-2222 standard for calculating through-hole pad and hole sizes based on the lead diameter. The default behaviors are: - copper = based on IPC-2222 - cutout = based on IPC-2222 - soldermask = expand copper by the design soldermask registration amount - paste = do not generate
- Parameters:
copper (PadFeatureConfig | EllipsisType)
cutout (PadFeatureConfig | EllipsisType)
soldermask (PadFeatureConfig | EllipsisType)
paste (PadFeatureConfig | EllipsisType)
density_level (DensityLevel | EllipsisType)
-
copper:
TypeAliasType|EllipsisType= Ellipsis# The copper shape configuration
-
cutout:
TypeAliasType|EllipsisType= Ellipsis# The cutout shape configuration
-
soldermask:
TypeAliasType|EllipsisType= Ellipsis# The soldermask shape configuration
-
paste:
TypeAliasType|EllipsisType= Ellipsis# The paste shape configuration
-
density_level:
DensityLevel|EllipsisType= Ellipsis# The density level to use for IPC calculations
- class ThroughHolePadConfigurationContext(min_outer_layer_pad_size=0.2032, max_hole_size_tolerance=0.0508, min_hole_size_tolerance=0.0508, hole_position_tolerance=0.0508, hole_to_lead_tolerance=<factory>)[source]#
Bases:
ContextConfiguration for through-hole pad generation. The default values can be overridden by declaring this context in your design hierarchy; the values will then be used for anything generated beneath that point.
>>> class MyCircuit(Circuit): ... th_settings = ThroughHolePadConfigurationContext( ... min_outer_layer_pad_size=0.4 ... )
- Parameters:
-
max_hole_size_tolerance:
float= 0.0508# The tolerance on the diameter of a hole of the largest size
-
min_hole_size_tolerance:
float= 0.0508# The tolerance on the diameter of a hole of the smallest size
- compute_hole_diameter(lead_diameter, density_level)[source]#
Compute the hole diameter for a through-hole pad based on IPC 2222 rules.
- Parameters:
lead_diameter (
Toleranced) – Size of the lead for this hole. This should be the overall diameter of the lead, ie, for a square lead this diameter is the diagonal measurement of the square.density_level (
DensityLevel) – IPC density level for board manufacturing
- Return type:
- Returns:
The hole diameter in mm.
- class THPadAdjustment[source]#
Bases:
ShapeAdjustmentAdjustment Amount for Through-Hole Pads given the hole shape as template, and can be used as a
THPadConfigcopper adjustment, in particular ifIPCTHPadConfigis not appropriate.>>> THPadConfig(copper=THPadAdjustment())
- compute_pad_diameter(hole_diameter)[source]#
Compute the pad diameter for a through-hole pad based on IPC 2222 rules.
- compute_hole_and_pad_diameters(lead_diameter, density_level)[source]#
Compute the hole and pad diameters for a through-hole pad based on IPC 2222 rules.
- Parameters:
lead_diameter (
Toleranced) – Size of the lead for this hole. This should be the overall diameter of the lead, ie, for a square lead this diameter is the diagonal measurement of the square.density_level (
DensityLevel) – IPC density level for board manufacturing
- Return type:
- Returns:
A tuple of (hole diameter, pad diameter) in mm.
- class GridPadShapeGenerator[source]#
- pad_shape(pos)[source]#
- Return type:
- Parameters:
pos (GridPosition)
- class FixedPadShapeGenerator(shape)[source]#
Bases:
GridPadShapeGenerator- Parameters:
shape (Shape)
- pad_shape(pos)[source]#
- Return type:
- Parameters:
pos (GridPosition)
- class PadShapeProvider[source]#
Sub-classes of this can be mixed in to provide a pad shape override for a specific grid position. It is not intended to be used for all pads, use a pad shape generator through
GridPadShapeGeneratorMixinfor that.
- class GridPadShapeGeneratorMixin[source]#
Bases:
PadConfigurationMixin,PadShapeProvider,GridLayoutInterface- pad_shape_generator(pad_shape_generator)[source]#
Use a generator to create pad shapes based on grid position
- Return type:
Self- Parameters:
pad_shape_generator (GridPadShapeGenerator)
- class ThermalPadGeneratorMixin[source]#
Bases:
PadConfigurationMixin,LandpatternProviderMixin to allow adding a separate thermal pad to the landpattern
-
thermal_pads:
list[Pad]# The generated thermal pad. It can be referenced in a
jitx.landpattern.PadMappingto map a port to it.
- thermal_pad(shape, config=None)[source]#
Set the thermal pad for the landpattern, with optional configuration to control the pad features.
- Parameters:
shape (
Shape) – The shape of the thermal padconfig (
SMDPadConfig|None) – Optional configuration to control the pad features. If not provided, the defaultSMDPadConfigwill be used.
- Return type:
Self
-
thermal_pads:
- class WindowSubdivide(padding=0.25, gridShape=(2, 2))[source]#
Bases:
ShapeAdjustmentThis class generates a windowed grid adjustment to a pad shape, ideal for paste applications. For example, you might use this for generating a large thermal pad for a QFN where you do not want the entire pad to be covered in paste.
-
padding:
float|tuple[float,float] = 0.25# Pad distance between copper and window edge
Sets the buffer distance between window openings and between the edge of copper to the window opening. If this is a tuple, the first element is the horizontal buffer distance and the second element is the vertical buffer distance. The default is 0.25.
-
gridShape:
tuple[int,int] = (2, 2)# Window grid dimensions
Dimensions of the grid of window openings. By default this uses a 2 x 2 grid.
-
padding: