# Cactus

A potted columnar collector: the ribbed column and both arms are one continuum solver at different settings, the areoles and spine fans sit on the solved crests, and a rigid corolla opens at the crown.

> 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-cactus.json
```

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

## Notes

- The column and both arms are the same solver. A column is `emergence 0` with a wide spread, so it leans progressively; an arm is `emergence 88°` with a narrow one, so it leaves the trunk flat, turns hard at one place and runs up parallel to it. `sweep === emergence` ends a limb vertical whatever the elbow, which is the whole of lift and curl in one number.
- The ribs are a modulation of the section radius, so a crest is a line on the solved surface rather than a stripe drawn on a silhouette — and the areoles sit on those crests with the skin’s own normal, taper included, which is what leans the crown’s spines up and out.
- The lean is not a pose: the pointer and the idle wander add into one bearing and one magnitude handed to the column, and the arms and the flower are carried by that bend rather than aimed separately. The rib pattern is anchored to the world, or it would spin every time the machine changed its mind.
- Solved: the centreline and its exact length at every bend, the frame at every station, the ribbed sections, the crests, the areole lattice and its stagger, the skin normals, the spine fans, the petal length at every pitch, the arms’ seats on the column, the silhouette, the projection and the facing culls.
- The corolla opens into a funnel rather than a disc. The front camera sits ten degrees above horizontal, so rigid blades opened flat would project to a line and the machine’s own native view would lose the one event it has; stopping at 32 degrees keeps a bowl with real height, and the silhouette flips from a tall narrow bud to a wide shallow cup.
- Illustrated: the pot, the soil, the stamen speckle, the status lamp and the lean line the blueprint variant draws. There is no botany — nothing grows and `bloom` is a shaped number, not a phenology.
- A generic potted machine and a generic flower. No species, grower or product artwork anywhere.

## Usage

```tsx
import { RobotCactus } from "@/components/ui/robot-cactus"

<RobotCactus behavior="flower" ribs={15} arms={2} />
<RobotCactus bloom={0.7} interactive onBloomChange={setBloom} />
```

## 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. |
| `bloom` | `number` | — | Controlled flowering, 0 shut and low to 1 wide and lifted. Supplying it stops the loop. |
| `behavior` | `"breathe" | "flower" | "reach" | "static"` | `"breathe"` | Breathe leaves it shut and idling, so the wander is the motion; flower runs the whole flowering and shuts again; reach works the arms with the corolla never more than ajar. |
| `speed` | `number` | `0.12` | One whole flowering per second at 1. It also scales the idle wander. |
| `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 up and down to work the flowering; arrows step 5 percent, shift 15, Home shut and End wide. |
| `onBloomChange` | `(bloom: number) => void` | — | Fires on every drag and key press, in controlled mode too. |
| `track` | `boolean` | `true` | Lean toward the pointer while it is over the drawing. Suppressed while a drag is in progress. |
| `look` | `Vec2 | null` | `null` | Controlled attention in −1..1; overrides pointer tracking. |
| `ribs` | `number` | `13` | Rib crests round the column, clamped to 5..28. The areoles are placed on them. |
| `ribDepth` | `number` | `0.2` | How deep the furrows cut, as a fraction of the radius; 0 leaves the column round. |
| `areoles` | `number` | `4` | Areoles on each crest, clamped to 0..12. The column takes two more than the arms. |
| `spines` | `number` | `6` | Needles in each areole’s fan, clamped to 0..10. Above three it also grows one straight out of the pad. |
| `arms` | `number` | `2` | Arms grown off the column, clamped to 0..4. Each leaves at its own station and bearing. |
| `petals` | `number` | `16` | Petals in the outer rank of the corolla, clamped to 0..36. The inner rank takes about six in ten of them. |
| `sway` | `number` | `1` | How much of the idle wander it runs, 0 rigid to 1 full. |
| `showPot` | `boolean` | `true` | The pot, its lip and the soil. |
| `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-cactus.tsx`
