# Bore geometry

Excavation mechanics: the penetration an energy balance at the face allows, the cavity that rate cuts in a slab, the volume conserved into a spoil heap at its own angle of repose, and ballistic spall off the kerf.

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

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

## Notes

- Pure functions over plain objects: no React, no three.js, no dependencies.
- The rated torque is a scale constant, stated as one in the source: the set draws in picture units, so it is chosen to make a nominal head advance a few units a second. Nothing here is a real machine’s numbers.
- Solved: the duty, the cavity, the conserved volume and heap, the spall trajectories, the cage ratio. Illustrated: the fracture pattern.

## API

| name | type | default | description |
| --- | --- | --- | --- |
| `boreDuty(spec?)` | `(spec?: Partial<BoreSpec>) => BoreDuty` | — | The energy balance: rate = η·P/(A·Es), where P is 2π·rev·torque and Es is the material’s specific energy. Advance per revolution, chip per cutter and muck flow fall out of it. Below the stall torque nothing advances. |
| `specificEnergy(hardness)` | `(hardness: number) => number` | — | Work per unit volume the material costs, convex in hardness. |
| `stallTorque(hardness)` | `(hardness: number) => number` | — | The torque a face demands before it will turn at all, as a fraction of the drive’s rating. |
| `boreCavity(depth, spec?, wall?)` | `(depth: number, spec?: Partial<BoreSpec>, wall?: Partial<BoreWall>) => BoreCavity` | — | The hole: the real intersection of the bit’s swept envelope with the slab, clipped at both faces, as an outline plus a hole subpath for fill-rule="evenodd". Carries the excavated volume, the exit radius and the breakthrough. |
| `boreEnvelope(depth, spec?, wall?)` | `(...) => (x: number) => number` | — | Half-width of the swept envelope at a drawing x — what the cavity is clipped from, so anything drawn inside the wall can be interrupted exactly where the bore has eaten it. |
| `spoilHeap(volume, repose?, at?)` | `(volume: number, repose?: number, at?: Vec2) => SpoilHeap` | — | Inverts the cone volume, so the heap at the collar is the volume that came out of the wall, at the material’s own angle of repose. It grows as a cube root, which is what conservation looks like. |
| `boreSpall(clock, flow, spec?, options?)` | `(...) => Spall[]` | — | Rubble off the kerf, integrated as p₀ + vt + ½gt² from a deterministic launch on the rim. Nothing is thrown by a stalled head. |
| `boreFractures(cavity, spec?, wall?, count?)` | `(...) => Fracture[]` | — | The crack pattern round the bore. Deterministic and grows with depth and hardness, but it is a drawing — there is no stress field here. |
| `cageRatio(rollerDiameter, pitchDiameter)` | `(d: number, D: number) => number` | — | (1 − d/D)/2: how fast a rolling-element bearing’s cage turns, as a fraction of the shaft. |
| `defaultBoreSpec / defaultBoreWall / BORE_TAPER` | `BoreSpec | BoreWall | number` | — | The head, the slab and the nose-cone ratio everything is clipped with. |

## Source

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