Interface: LayoutOptions
Properties
cornerRadius?
optional cornerRadius?: number;Round every tile corner with this radius, in region units. Corners too small for the full radius get the largest radius that fits. Defaults to 0 (sharp). Rounding is applied when rendering; Cell.polygon, area and centroid describe the sharp-cornered shape.
edges?
optional edges?: EdgeMode;Defaults to "clip".
features?
optional features?: Feature[];Featured tiles: groups of neighboring tiles merged into one bigger cell, e.g. for a hero image. Merging happens before the gap and edge handling, so a featured cell gets the same gap all round as any other. See Feature.
gap?
optional gap?: number;Space between neighboring tiles. Defaults to 0.
holes?
optional holes?: (Rect | Polygon)[];Areas inside the region to leave empty: windows, doors, sockets. Rectangles or simple polygons; they may overlap each other or the region's edge. Tiles are cut around them (or skipped, with edges: "inside"), and margin applies around them too.
margin?
optional margin?: number;Empty border kept between the region outline (and any holes) and the tiles. Defaults to 0.
maxTiles?
optional maxTiles?: number;Safety cap on generated tiles. Defaults to 20000.
minFill?
optional minFill?: number;Drop edge tiles that end up smaller than this fraction (0–1) of a full tile, so you don't get slivers. Applies to "clip", "overflow" and "window". Defaults to 0.
origin?
optional origin?: Vec;Shifts the pattern (ignored by the random patterns). For penrose this is where the ten-fold star at the pattern's center sits. Defaults to the top-left of the region.
region
region: Rect | Polygon;The area to tile: a rectangle or any simple polygon (convex or not; it mustn't cross itself), in your own units (cm, px, in…).
rotation?
optional rotation?: number;Pattern rotation in degrees (ignored by the random patterns: mondrian, voronoi, delaunay, ashlar, jigsaw). Defaults to 0.
sizeAt?
optional sizeAt?: (point) => number;Vary the tile size across the region: the size wanted at each point, as a factor of the tiling's own size (1 as given, 0.5 half as big, 2 twice). Voronoi and Delaunay change size smoothly; other tilings are generated at the largest size wanted and, where tiles should be smaller, replaced by the same tiling at half the scale (again and again, down to the smallest), cut to fit. Grids and other tilings that halve exactly nest without cuts. See radialSize, edgeSize and imageSize.
Parameters
| Parameter | Type |
|---|---|
point | Vec |
Returns
number
tileScale?
optional tileScale?: number;Scale the whole pattern (every tile size in the tiling spec) by this factor, about the pattern origin. Handy for fitting a tile count without knowing which size parameters a pattern has; see fitCount. Defaults to 1.
tiling
tiling: TilingSpec;