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_sizevisits a component’s pads, measures the narrow side of each pad’s shape, and assignsSmallPadReliefbelow 1.0 mm (SMALL_PAD_LIMIT) andLargePadRelieffrom there up.SMALL_RELIEF(a 0.2 mm gap, two 0.2 mm spokes) andLARGE_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.DirectConnectTagon 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: heretag_pads_by_sizealso gives the exposed padLargePadRelief, and on a board with anIsPaddefault every pad is matched. Either way the solid join has to win by priority.The
untaggedpart is the same part as the large one, 1.6 mm pads, with no class tag, and the design has noIsPadrule, 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: theIsPadrule inlayout_default_rulesgives 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.
- tag_pads_by_size(part)[source]#
Assign each pad of
partthe relief class its measured size calls for.
- class ChipPart(width, height, pitch)[source]#
Bases:
ComponentA fictional two-pad part with
widthbyheightmm pads.- 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.
- class PowerPart[source]#
Bases:
ComponentA 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.
- class ThermalClasses[source]#
Bases:
CircuitA 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:
SampleDesignThe four parts and their pour on the sample board.