# Cable station

Selectorised weight stack reeved through pulleys: the pin picks what rises, and the reeving sets both the handle force and how far the stack travels.

> For the complete index, see [llms.txt](https://robocn.dev/llms.txt). A Markdown version of any page is available by appending `.md` to its URL or by sending an `Accept: text/markdown` header.

## Install

```bash
bunx --bun shadcn@latest add https://robocn.dev/r/cable-station.json
```

Registry item: `cable-station` · [`https://robocn.dev/r/cable-station.json`](https://robocn.dev/r/cable-station.json)

## Notes

- Solved: the reeving. The rope is one length, so the stack rises by the handle's travel over the number of falling lines and the handle holds the selected weight over the same number. Both come out of `reeveStack` in gym-geometry, over the block-and-tackle travel constraint in linkage-geometry.
- Solved: the split at the pin. Which plates rise is the pin position, and every plate is drawn at the height the solver puts it at.
- Illustrated: the rope is inextensible and the sheaves are frictionless, so the advantage is the ideal one. Nothing models rope stretch, sheave efficiency or the weight of the riser itself.
- The mechanical advantage is never a prop. Change `lines` and read it back off the accessible label.
- Design note: docs/gym-machines.md.

## Usage

```tsx
import { CableStation } from "@/components/ui/cable-station"

// Runs its own set.
<CableStation behavior="press" />

// Move the pin and the reeving; the advantage is reported, never set.
<CableStation pin={7} lines={4} />

// Or drive the handle, which stops the loop.
<CableStation draw={0.6} onDrawChange={setDraw} interactive />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `draw` | `number` | — | Handle travel, 0 racked to 1 at the bottom of the pull. Supplying it stops the loop. |
| `onDrawChange` | `(draw: number) => void` | — | Fires while it is dragged or keyed, so interaction works in controlled mode too. |
| `behavior` | `"press" | "pyramid" | "hold" | "static"` | `"press"` | What it does with nobody driving it. |
| `pin` | `number` | `5` | Which plate the selector pin is in, counted from the top: 0 pins the top plate alone. That plate and everything above it ride the riser. |
| `plates` | `number` | `10` | Plates in the stack. |
| `lines` | `number` | `2` | Falling lines under the load. This — and only this — sets the mechanical advantage. |
| `plateWeight` | `number` | `5` | What one plate weighs, for the readout in the accessible label. |
| `interactive` | `boolean` | `false` | Hand it to a person: drag down it, or focus it and use the arrow keys. It eases back into the behaviour on release. |
| `showGround` | `boolean` | `true` | Draw the contact shadow and the ground line beneath it. |
| `label` | `string` | — | Optional technical caption under the drawing. |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"profile"` | Where the camera stands. One machine, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `speed` | `number` | `0.35` | Reps per second. |
| `animate` | `boolean` | `true` | Off parks the machine at phase and stops rendering. A reduced-motion preference does the same. |
| `paused` | `boolean` | `false` | Freeze where it stands. |
| `phase` | `number` | `0` | Seconds of offset, so a row of machines breaks step. |
| `variant` | `"solid" | "outline" | "blueprint" | "wire"` | `"solid"` | How the machine is painted. Geometry never changes between variants. |
| `size` | `"xs" | "sm" | "md" | "lg" | "xl" | number` | `"md"` | Rendered width in pixels, or a step on the scale. |
| `color` | `string` | `var(--robot-shell)` | Body panels — the colour the machine reads as. |
| `accent` | `string` | `var(--robot-accent)` | Status colour: tip light, live tool, readouts. |
| `metal` | `string` | `var(--robot-metal)` | Bare machined parts: collars, bolts, tool bodies. |
| `dark` | `string` | `var(--robot-dark)` | Cast joints, base, shadow side. |
| `palette` | `Partial<RobotPalette>` | — | Override any subset of roles at once, including glow and grid. |

## Source

- `src/components/ui/cable-station.tsx`
