How can I rotate a component to a specific angle on my PCB in KiCad using Python?
Rotating a component to a specific angle on a PCB in KiCad can be done using Python scripting. The provided script includes an example of rotating a component ('R1') by 90 degrees:

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

board = pcbnew.GetBoard()
r1 = board.FindFootprintByReference('R1')
assert(r1)

r1.SetPosition(wxPointMM(20, 20))    # Set position of R1
r1.SetOrientation(90 * 10)           # Rotate R1 by 90 degrees

pcbnew.Refresh()
```

This script is useful for adjusting the orientation of components, an important aspect in PCB design to ensure proper fit and function.