contactSheet()
Tile renders into one captioned image, left to right then top to bottom, each cell as large as the largest render. Comparing variants side by side is the main output of a preview run.
function contactSheet(cells: SheetCell[], opts?: SheetOptions): RenderResult;Defined in: preview/sheet.ts:48
Parameters
| Parameter | Type | Description |
|---|---|---|
cells | SheetCell[] | At least one; throws on an empty list. |
opts? | SheetOptions | Columns, spacing, colours and an optional title. |
Returns
The sheet as one image.
Example
const cells = [1, 2, 3].map((seed) => ({
render: renderEntity(generateRock(PRESETS.boulder, seededRandom(seed)).entity, { width: 240 }),
label: `seed ${seed}`,
}));
const sheet = contactSheet(cells, { cols: 3, title: "boulder" });
await Bun.write("rocks.png", encodePng(sheet.width, sheet.height, sheet.rgb));@voxolith/gen-kit/preview
@voxolith/gen-kit/preview: headless CPU rendering for generator work.
cutAway()
A copy of a dense model with everything on one side of an axis plane removed, to show its inside. Voxels exactly at at are kept. Sparse models (finer scales) are not supported: they have no dense data.