Height check
tools/height_check.py checks every top-side part of a DIN-rail board against the height limits of the printed housing (DIN-rail board format).
tools/.venv/bin/python tools/height_check.py myboard/myboard.kicad_pcb
- Housing footprint: the board must carry
HW:DIN_Housing_<k>TE(fromtools/din_template.py). Its position is the housing centre, andkselects the dimensions. The limits come fromdims()intools/din_template.py, so the check, the footprint notes and the templates share one source. - Limits:
- inside the front-cap box:
h_tall(45.8 mm); - elsewhere:
h_low(31.8 mm, the bottom of the front-cap lip); - outside the step lines (|y| > 33): the 45° shoulder slope applies, 19 mm at the line, 1 mm less per mm outward, 9.5 mm at the PCB edge.
- inside the front-cap box:
- Method: each 3D-model vertex is checked against the limit at its place, using the same model transform as Model check plus the footprint's position and rotation.
- Edge connectors: parts that reach past the PCB edge are listed with "needs a notch through the slope" and not judged; their notch is cut up through the slope.
- Assembly STEP files: these cannot be placed without their transforms. The F.CrtYd outline at the model's top height is used instead, flagged "approx".
- Not checked: parts without a STEP model are listed as not checked, and bottom-side parts are not checked yet.
- Exit code 1 when a part is too tall.
The model paths resolve ${HW_LIB} to libraries/ in the repo and the KiCad stock models through kicad_paths.py.
For the openings and the spacer frame: Housing inputs.
