How can I use Python to create custom board outlines in KiCad?
Creating custom board outlines in KiCad can be done using Python scripting. The script provided demonstrates this by adding lines to the Edge_Cuts layer to form a custom shape around specific components:

```python
import pcbnew
from pcbnew import wxPoint, wxPointMM

def add_line(start, end, layer=pcbnew.Edge_Cuts):
    board = pcbnew.GetBoard()
    segment = pcbnew.PCB_SHAPE(board)
    segment.SetShape(pcbnew.SHAPE_T_SEGMENT)
    segment.SetStart(start)
    segment.SetEnd(end)
    segment.SetLayer(layer)
    segment.SetWidth(int(0.1 * pcbnew.IU_PER_MM))
    board.Add(segment)

# Script to define start and end points for custom board outline
# ... (rest of the script)
add_line(start, end)

pcbnew.Refresh()
```

This script is useful for designing PCBs with non-standard shapes or specific mechanical constraints.