layout_thermal_classes module#

Thermal relief sized per pad class, a direct connect for a power pad, and a pad that no relief rule matches.

A design rule’s condition is made of tags, so it cannot ask how big a pad is. To give small and large pads different reliefs, measure each landpattern’s pads in Python, put a class tag on each pad, and key one relief rule on each class tag. On a real board, also keep an IsPad relief rule at a priority below the class rules, as layout_default_rules does: without it, every pad you did not tag joins its pour solidly, and no design issue reports it. This design leaves that rule out to show the solid join. The pieces:

  • tag_pads_by_size visits a component’s pads, measures the narrow side of each pad’s shape, and assigns SmallPadRelief below 1.0 mm (SMALL_PAD_LIMIT) and LargePadRelief from there up.

  • SMALL_RELIEF (a 0.2 mm gap, two 0.2 mm spokes) and LARGE_RELIEF (a 0.3 mm gap, four 0.4 mm spokes) give each class its relief. A small pad gets two narrow spokes, so the relief does not swallow it; a large pad gets four wide ones, so it carries current.

  • DirectConnectTag on the power part’s exposed pad, with a rule at a higher priority, joins that pad to the pour solidly. The rule set has no direct-connect effect, so the rule is a relief whose spoke width is the pad’s diagonal: the spokes overlap until no gap is left. A pad that no relief rule matches also joins solidly, but the direct connect is still written as a rule, for two reasons: here tag_pads_by_size also gives the exposed pad LargePadRelief, and on a board with an IsPad default every pad is matched. Either way the solid join has to win by priority.

  • The untagged part is the same part as the large one, 1.6 mm pads, with no class tag, and the design has no IsPad rule, so no relief rule matches its pads. It shows what a pad gets with no rule: a solid join to the pour, with no void and no design issue. Do not copy that omission: the IsPad rule in layout_default_rules gives such a pad a relief.

Where the tag goes follows from which pads the rule is for. A relief rule keyed on a tag assigned to a net reaches every pad on that net. A pad-size class depends on the pad, not the net: the one GND net here has small, large and exposed pads, so the class tags go on the pads. A tag on a landpattern or a component also works, for a part whose pads all take one class. IsPad reaches every pad. When two relief rules match one pad, the higher priority wins. At equal priority the same rule won on repeated runs in testing, but the rule that decides the winner is not established, so give overlapping classes different priorities.

All parts are on GND inside one GND pour on the top layer. Measured on jitx 4.6 from the computed pour copper around each pad:

  • each small pad has a 0.2 mm gap and two 0.2 mm spokes;

  • each large pad has a 0.3 mm gap and four 0.4 mm spokes;

  • the exposed pad meets the pour on every side, with no void;

  • each pad of the untagged part meets the pour on every side, with no void.

SMALL_PAD_LIMIT = 1.0#

Pads whose narrow side is under this, in mm, take the small-pad relief.

SMALL_RELIEF = ThermalRelief(gap_distance=0.2, spoke_width=0.2, num_spokes=2)#

0.2 mm gap, two 0.2 mm spokes.

Type:

Relief for small pads

LARGE_RELIEF = ThermalRelief(gap_distance=0.3, spoke_width=0.4, num_spokes=4)#

0.3 mm gap, four 0.4 mm spokes.

Type:

Relief for large pads

DIRECT_CONNECT_GAP = 0.2#

Gap of the direct-connect relief, mm; the spokes close it.

class SmallPadRelief[source]#

Bases: Tag

Pads whose narrow side is under SMALL_PAD_LIMIT.

class LargePadRelief[source]#

Bases: Tag

Pads whose narrow side is SMALL_PAD_LIMIT or more.

class DirectConnectTag[source]#

Bases: Tag

Pads joined to their pour with no relief.

pad_size(pad)[source]#

Width and height of a pad’s copper shape, mm.

Return type:

tuple[float, float]

Parameters:

pad (Pad)

tag_pads_by_size(part)[source]#

Assign each pad of part the relief class its measured size calls for.

Return type:

None

Parameters:

part (Component)

class ChipPart(width, height, pitch)[source]#

Bases: Component

A fictional two-pad part with width by height mm pads.

Parameters:
reference_designator_prefix: str | None = 'C'#

Reference designator prefix for this component. This will be used to generate a unique reference designator for each component of the same type.

Note

This field is a required data point for matching components between builds. If this value changes (including changing from unset to set), it will be treated as a new component, even if nothing else changes.

mpn: str | None = 'EXAMPLE-CHIP'#

Manufacturer part number for this component.

manufacturer: str | None = 'Example'#

Manufacturer for this component.

class PowerPart[source]#

Bases: Component

A fictional power part: a 3 mm exposed pad and a 0.6 mm sense pad.

reference_designator_prefix: str | None = 'U'#

Reference designator prefix for this component. This will be used to generate a unique reference designator for each component of the same type.

Note

This field is a required data point for matching components between builds. If this value changes (including changing from unset to set), it will be treated as a new component, even if nothing else changes.

mpn: str | None = 'EXAMPLE-POWER'#

Manufacturer part number for this component.

manufacturer: str | None = 'Example'#

Manufacturer for this component.

class ThermalClasses[source]#

Bases: Circuit

A small-pad part, a large-pad part, an untagged copy of the large-pad part and a power part, all on GND in one GND pour, with a relief class per pad size, a direct connect and no default relief.

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

Bases: SampleDesign

The four parts and their pour on the sample board.

circuit: Circuit = ThermalClasses()#