@dioramajs/model/box
Exports of @dioramajs/model/box.
On this page
import { build, default, depthOf } from '@dioramajs/model/box'Functions
build | The box of a `width` × 1 front and `depth`, its faces in `faces`, bare board in `inside`. flap: the top on a hinge at its back edge; lift: a lid over the top `LID` of the box; drawer: a sleeve with a tray that slides out to the right. |
depthOf | Depth of the box in front heights for a front `aspect` (width over height): `depth` times the width when a number (0 is a flat card), else from the aspect of a side picture (its width is the depth), else of a top one (its height is the depth), else a third of the width. |
edgeColor | The average colour of a thin strip along one edge of a picture. |
Constants
default | A product box from pictures of its faces: the front image becomes a 3D package with real proportions that turns under a drag, leans toward the pointer and can open its lid. |
Interfaces
Built | A built box: the front face at z = 0, centred in x and y, one unit tall. |