ipc module#

class DensityLevel(*values)[source]#

Bases: Enum

Density Level

This enum specifies the density level for footprints on a PCB. Higher density levels indicate less space between landpatterns. These are defined in IPC-7351.

A = 'A'#

Density Level A

Maximum land protrusion

B = 'B'#

Density Level B

Median (nominal) land protrusion

C = 'C'#

Density Level C

Minimum land protrusion

class IPCRequirements(Zmax, Gmin, Xmin)[source]#

Bases: object

IPC Formula Results from Section 3 of IPC 7351B

This class contains the results of the IPC formula for computing the pad size.

TODO: Add Diagram here

Parameters:
Zmax: float#

Maximum overall length

Gmin: float#

Minimum distance between pads

Xmin: float#

Minimum pad width

pad_size()[source]#

Compute the pad dimensions from this IPC result

Return type:

tuple[float, float]

Returns:

The pad dimensions as (y, x)

compute_ipc(leadSpan, leadLength, leadWidth, fillets)[source]#

Compute Pad Geometry According to IPC Rules

Parameters:
  • leadSpan (Toleranced) – edge-of-lead to edge-of-lead distance for an IC package.

  • leadLength (Toleranced) – length of the exposed contact in the same dimension as leadSpan

  • leadWidth (Toleranced) – width of the exposed contact in the dimension orthogonal to leadSpan

  • fillets (LeadFillets) – Specifications for the solder fillets created when soldering the lead to the land-pattern pad. These parameters define extra spacing around the lead dimension to form these fillets.

Return type:

IPCRequirements

Returns:

IPCResult containing the results of the IPC formula

Note

IPC-7351B section 3.1.5 states the formulas with two extra terms inside the root-sum-square – F (printed-board fabrication tolerance) and P (part placement accuracy):

Zmax = Lmin + 2*JT + sqrt(CL**2 + F**2 + P**2)
Gmin = Smax - 2*JH - sqrt(CS**2 + F**2 + P**2)
Xmax = Wmin + 2*JS + sqrt(CW**2 + F**2 + P**2)

This implementation is those formulas with F = P = 0. Rev B specifies no normative values for either – it defers them to the IPC-7351 land pattern libraries and tells users to set them for their own fabricator and placement equipment. It also explicitly recommends F = 0 when the fabricator already applies etch-factor compensation, so that term is well founded; P = 0 is a simplification. Rev B tables 3-25 (finished conductor width tolerances) and 3-26 (feature location accuracy) are the starting points if these are ever made configurable. Note that the A/B/C levels in those two tables are producibility levels, not the density levels used here.

class DensityLevelContext(density_level)[source]#

Bases: Context

Parameters:

density_level (DensityLevel)

density_level: DensityLevel#
classmethod get()[source]#

Get the current active context of this type.

Return type:

DensityLevelContext

Returns:

The current context instance, or None if not set.

class DensityLevelMixin(*args, **kwargs)[source]#

Bases: Structurable

density_level(density_level)[source]#
Return type:

Self

Parameters:

density_level (DensityLevel | 'A' | 'B' | 'C')