aboutsummaryrefslogtreecommitdiff
path: root/knowledge/tooling/housing-inputs.md
blob: a0e38ae8a739a7f5898add2541316dd018157d63 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Housing inputs

`tools/housing_inputs.py` prints the numbers a board's DIN-rail housing needs: where each PCB tab is, what kind of opening each edge connector gets, and where the spacer frame must clear through-hole pins.

``` sh
tools/router/.venv/bin/python tools/housing_inputs.py myboard/myboard.kicad_pcb
```

- **Housing coordinates:** origin at the `HW:DIN_Housing_<k>TE` footprint, X = board x − centre, Y = centre − board y (Y up), so the numbers go straight into CAD box features.
- **Tabs:** the Edge.Cuts segments at |y| = PCB edge + 2 mm, per side, with their X ranges. Notch X = tab ± `notch_clr`. Frame tongue X = tab ± (`notch_clr` − `fit`).
- **Edge connectors:** the parts whose 3D model reaches past the PCB edge, as in [Height check](height-check.md), with the back of the body (|y|) and the height. The kind of opening:
  - `TerminalBlock` footprints: screw terminal, notch from 0.5 mm behind the body;
  - a body that fits under the slope with 1 mm to spare (≤ 8 mm tall): side-entry window in the end wall only;
  - anything else: notch from the riser, with the back wall above the body if the body reaches under the riser.
- **Pin cutouts:** per footprint, the through-hole pads that lie under the frame, as a rectangle ± 1.5 mm. Cutouts closer than 1 mm are flagged for merging.
- **Bottom-side footprints** are listed; the frame does not account for them.
- **Constants:** the ones at the top (`FRAME_Y0`, `PIN_CLR`, …) copy the housing model's parameters. Change both together.