1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
# Connector tab tool (connector_tab.py)
`tools/connector_tab.py` puts a board's edge connectors onto a board tab. Where a connector sits at an edge, the PCB runs out as a tab (default 2.0 mm) into the housing's wall notch. The tab is as wide as the connector bodies, and the mating face or wire entry ends flush with the tab edge ([DIN-rail board format](../topics/din-rail-format.md)).
## Two uses
- **From a board generator script** (new boards):
1. Draw the plain rectangular outline.
2. Place the connector so its face ends `TAB` past the block edge: pin row = edge − pin-to-face distance + `TAB`.
3. Call `add_tabs(board, ["J1", ...], TAB)` before saving.
The block (pours, group bboxes, the router's `area = "pours"`) keeps the old edge; only Edge.Cuts grows.
- **On a routed board** (keeps the routing):
``` sh
. tools/kicad_env.sh
$KPY tools/connector_tab.py board.kicad_pcb J1 J2 --dy 2.0 [--tab 2.0] [--merge 3.0]
```
The second use does this:
- moves the footprints by `--dy` (positive = outward);
- gives every track that ended on one of their pads a straight stub along the move (same layer and width);
- splits the straight edge into the tab;
- refills the zones and restores the `.kicad_pro`.
Close the board in KiCad first and checkpoint it. Afterwards, run DRC with parity.
`add_tabs(..., side="top")` splits the top edge instead, with the tab going up.
## How the tab is sized
- **Width:** the union of the connector bodies, taken from their F.Fab outline (the bounding box minus half the line width, i.e. the body edge itself). Bodies closer than `--merge` (3 mm) share one tab, so the printed shell gets one notch instead of thin wall webs.
- **Which edge:** only the lowest straight Edge.Cuts segment under the bodies is split. Rounded corners stay.
## What DRC catches afterwards
Tracks that ran between the old pin row and the edge end up under the moved pads. Reroute them by hand on the tab, under the connector body. A connector that already sticks out (e.g. an RJ45 jack) can keep its position with `--dy 0 --tab 2.5`.
Related: [Thermal vias](thermal-vias.md) (another post-route board edit), [Placer](placer.md).
|