# Sunflower

A heliotropic collector mast: a golden-angle floret lattice on a dished head aimed at the light by a two-axis tracker, on a stem that leans toward it while the gimbal collar takes up exactly what the stem did not.

> 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/robot-sunflower.json
```

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

## Notes

- The collar angle is a remainder, not an input: the stem leans toward the light on its own and the gimbal takes up exactly what it did not, so the head's normal never comes off the sun however far the mast bends.
- The spiral arms are found rather than placed. `parastichyOffsets` reports which index step has the closest neighbours, and drawing that step is what makes the arms appear — their count is a Fibonacci number because the angle is the golden angle.
- Solved: the lattice and its spacing, the dish surface and its normals, the aim and its frame, the stem — every link exactly the same length at every lean — the collar remainder, the leaf panels' corners, the ray length at every pitch, the projection, and the facing cull on florets, rays and leaves.
- Illustrated: the hub speckle, the anchor feet, and the incidence ray the blueprint variant draws. There is no photometry, no ephemeris and no plant model: `daylight` is a shaped number, not a solar position for a date and a latitude, and the disc collects nothing.
- A generic field machine and a generic flower. No cultivar, grower or product artwork anywhere.

## Usage

```tsx
import { RobotSunflower } from "@/components/ui/robot-sunflower"

<RobotSunflower behavior="sweep" florets={160} arms={8} />
<RobotSunflower daylight={0.62} interactive onDaylightChange={setDay} />
```

## Props

| name | type | default | description |
| --- | --- | --- | --- |
| `view` | `"plan" | "front" | "profile" | "iso"` | `"front"` | Where the camera stands. One machine, four projections: straight down, straight on, side elevation, or three-quarter from above. |
| `daylight` | `number` | — | Controlled time of day, 0 and 1 midnight and 0.5 noon. Supplying it stops the loop. |
| `sun` | `{ azimuth: number; elevation: number }` | — | Where the light actually is. Overrides the day arc and the pointer entirely. |
| `behavior` | `"sweep" | "day" | "nod" | "static"` | `"sweep"` | Sweep runs the working arc — the part of the day a collector collects in, which a two-axis mount's azimuth range is sized for; day runs the whole twenty-four hours, so the head turns away and the rays furl at night; nod is the hunting a tracker does once it has arrived. |
| `speed` | `number` | `0.14` | Passes of the arc 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. |
| `interactive` | `boolean` | `false` | Drag across it to scrub the day; arrows step 3 percent, shift 10, Home dawn and End dusk. |
| `onDaylightChange` | `(daylight: number) => void` | — | Fires on every drag and key press, in controlled mode too. |
| `track` | `boolean` | `true` | Hand the light to the pointer while it is over the drawing. Suppressed while a drag is in progress. |
| `look` | `Vec2 | null` | `null` | Controlled gaze in −1..1; overrides pointer tracking. |
| `florets` | `number` | `120` | Collector cells on the face, clamped to 12..320. They are placed by the golden angle over equal area. |
| `rays` | `number` | `21` | Ray petals hinged on the rim, clamped to 0..48. |
| `arms` | `number` | `8` | Spiral arms drawn over the lattice, clamped to 0..24. The step they follow is whichever parastichy the solver reports. |
| `bloom` | `number` | — | How open the rays are, 0 furled to 1 wide. Omit and the light opens them: shut below the horizon, full by 40 degrees. |
| `lean` | `number` | `1` | How much of the aim the stem takes up itself, 0 rigid to 1 full lean. The collar always takes the rest. |
| `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. |
| `showGround` | `boolean` | `true` | Draw the contact line or shadow beneath the droid. |
| `signal` | `"idle" | "ready" | "warning"` | — | Status-lamp state using neutral, accent, or shell colour; each component documents its visual default in the demo. |
| `label` | `string` | — | Optional technical caption under the drawing. |
| `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/robot-sunflower.tsx`
