aboutsummaryrefslogtreecommitdiff

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.

tools/.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, 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.