Diorama

Made for a big screen.

This site is one 3D scene, built for a computer: a wide window and a mouse. Open dioramajs.dev on a desktop or a laptop to see it.This site is one 3D scene, built for a wide window. Make this one wider, or open dioramajs.dev on a larger screen.

GitHub

DioramaDocs

Cut interface

A flat cut of the text block that folds on a hinge.

View as Markdown
import type { Cut } from '@dioramajs/text/unfold'
interface Cut

Members

NameTypeDescription
readonly cornersreadonly [number, number, number, number, number, number, number, number]

Corners in box px (y down): top left, top right, bottom left, bottom right; a triangle repeats its last.

readonly edgesreadonly [number, number, number, number]

Across each edge (top, bottom, left, right): the cut whose hinge it is, -1 for none.

readonly hingereadonly [number, number, number, number]

A point on the hinge and the unit direction across it into this cut, box px, y down.

readonly layernumber

Paper thicknesses it lies above its parent when folded: the cuts folded in under it.

readonly parentnumber

The cut it hangs from, always an earlier one; -1 hangs it from the page.

readonly unitnumber

The timing unit that opens it; -1 never moves.

Defined in packages/text/src/unfold.ts.