# Household geometry

The closures in the building you live in and the machines inside it: hinged leaves, sectional panels, a tumbling drum, a resonant suspension, a roped hoist, tracking slats, and flow through a packed bed.

> 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/household-geometry.json
```

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

## Notes

- Pure functions over plain objects. No React, no dependencies, and no thermodynamics: nothing here computes a heat flow, a pressure drop in a pipe, a wind load, a temperature or an occupancy.
- The tumble is the piece that earns the file. One dimensionless number decides the whole regime, which is why a washing machine's wash and its spin are the same solver rather than two animations, and why `tumbleCycle` returns null rather than a fiction when there is no release.
- Every closure here is checked against the thing a drawing would get wrong: a leaf that keeps its width, a panel that keeps its length round a bend, a rope that keeps its length, a projectile that rejoins the drum, and a tracker that says when it has run out of travel.

## Usage

```tsx
import { swingPose, sectionalPanels, tumblePose, suspensionPose, hoistPose } from "@/lib/robocn/household"

swingPose(0.5, { width: 80, maxAngle: 110 })     // the free edge stays 80 from the hinge
sectionalPanels(0.4, { panels: 4, opening: 28 }) // every panel still 7 long

tumblePose(48, { radius: 0.25 }).regime           // "cataracting"
tumblePose(1200, { radius: 0.25 }).release        // null — it never leaves the wall
suspensionPose(320, { critical: 320 }).resonant   // true
hoistPose(0.8, { travel: 180, sheave: 220 }).length // the same at every position
```

## API

| name | type | default | description |
| --- | --- | --- | --- |
| `swingPose` | `(open, options) => SwingPose` | — | A leaf hinged on a vertical edge. The free edge lies on a circle about the hinge, so it keeps its width at every angle, and `facing` is how much of it a front camera still sees. |
| `sectionalPanels` | `(travel, options) => SectionalPanel[]` | — | Rigid panels on a track that runs up an opening, round a quarter bend and back under the head. Placed by arc length, with each panel the chord between its two rollers, so no panel stretches at any travel. |
| `sectionalTrack` | `(options, steps?) => Vec2[]` | — | The track itself, as a polyline: what the rollers actually run in. |
| `tumblePose` | `(rpm, options?) => TumblePose` | — | What a drum at this speed does to what is in it: the Froude number, the release angle where gravity can no longer hold the load to the wall, and the regime either side of one. |
| `tumbleCycle` | `(rpm, options?) => TumbleCycle | null` | — | One item's trip: up the wall to release, through the air, and back onto the wall. The landing is the root of the quadratic that puts the projectile back on the drum circle. Null when the drum is stopped or centrifuging. |
| `tumbleItems` | `(clock, rpm, count, options?) => TumbleItem[]` | — | Where the load is at a moment, spread evenly round that one cycle. |
| `suspensionPose` | `(speed, options?) => SuspensionPose` | — | A tub hung on springs with an out-of-balance load: the textbook rotor response, small below the critical speed, large at it, and settling to the imbalance itself above it. |
| `hoistPose` | `(position, options) => HoistPose` | — | A car roped to a counterweight over one sheave. The weight falls exactly as far as the car rises, and the total rope length is reported so that can be checked. |
| `slatPose` | `(sun, options?) => SlatPose` | — | Blades that turn to face the sun over one day, the shade that follows from how far they turned, and a `clamped` flag when they wanted to turn further than their stops allow. |
| `extractionFlow` | `(pressure, options?) => number` | — | Darcy's law through a packed bed, and nothing at all below the threshold rather than a negative trickle. |
| `springPressure` | `(compression, options?) => number` | — | The pressure a compressed spring puts behind a piston — the whole of a lever machine's declining shot. |

## Source

- `src/lib/robocn/household.ts`
