# Rack and pinion

> Connection kind `rack-pinion` (category `mech`, DSL name `rackPinion`, API v1)

Couples a spur gear (pinion) to a rack. Converts rotational motion into linear translation along the rack local X axis.

## Accepted ports

- `spur-gear.axis` → `rack.motion`
- `rack.motion` → `spur-gear.axis`

## Parameters

- **`side`** — Where the rack sits relative to the pinion. One of: above (default), below, right, left, or { angleDeg: N }.

## Parameters schema

| Parameter | Type | Default | Constraints |
| --- | --- | --- | --- |
| `side` | any | above | allowed: above, below, right, left |

## Kinematics

velocity_rack = -omega_pinion × pinion.pitchRadius. Module must match on both sides for the teeth to mesh.

## Layout

This connection computes the driven component position from the anchor.

## Example

```
connect P1.axis -> R1.motion with mech.rackPinion {
  side: "above"
}
```
