membrane function
The radius of the round profile over a signed distance field `dist` (CSS px, positive inside, `cols` by `rows` cells of `cell` px), written d below.
import { membrane } from '@dioramajs/text/inflate'. The letters are inflated like a membrane under pressure: u solves Poisson's equation, zero on the glyph edge, coarse to fine. Where a stroke of half-width a is straight, u = d (2a - d) / 2, so the radius u / d + d / 2 is a, and the height sqrt(d (2a - d)) is a round tube; a dot becomes a dome and a joint bulges. Cells outside get the radius of the edge next to them.
function membrane(
dist: Float32Array,
cols: number,
rows: number,
cell: number,
pause?: Pause,
): Promise<Float32Array<ArrayBufferLike>>Parameters
| Name | Type | Description |
|---|---|---|
dist | Float32Array | |
cols | number | |
rows | number | |
cell | number | |
pause? | Pause | Default |
Defined in packages/text/src/inflate.ts.