Reference · Surface maze rules and geometry
DrawSolidOptionstype
A MAZE OVER A SOLID AS SVG TEXT, a still picture of it from one side: the near side's cells shaded by how squarely they face the viewer, the walls
that stand, and, if asked, the line, the stones and the way through. Pure text with no page needed, so a server can make a picture, and the colours
are the drawing's custom properties (--mk-paper, --mk-wall, ...), so a board, a line colour and the page's light or dark change it as they change
a flat maze. The shade of a cell is a mix of the paper's colour and black (color-mix), so it follows the paper.
Import it
import type { DrawSolidOptions } from "@johnmorrisdotca/meikyuu/3d";
Definition
type DrawSolidOptions = MazeLook & {
turn?: Quat;
size?: number;
path?: readonly number[];
stones?: readonly number[];
solution?: boolean;
language?: MeikyuuLanguage;
label?: string;
standalone?: boolean;
};
Members
| Name | Type | Description |
|---|---|---|
board (optional) | MeikyuuBoardLook | "paper" | "wood" | "green" | "blue" | "red" | "black" | undefined | A board by name, or its colours. |
trail (optional) | "green" | "blue" | "red" | "violet" | "orange" | (string & {}) | undefined | The line's colour: one of the named ones, or any CSS colour. |
wall (optional) | number | undefined | The thickness of a wall, in cells. Default 0.12. |
line (optional) | number | undefined | The thickness of the line, in cells. Default 0.34. |
turn (optional) | Quat | undefined | How the solid is turned, as a quaternion |
size (optional) | number | undefined | The picture's width and height in pixels. Default 320. |
path (optional) | readonly number[] | undefined | The line drawn so far, as cells from the start. |
stones (optional) | readonly number[] | undefined | The cells with a stone on them. |
solution (optional) | boolean | undefined | Draw the one way from the start to the goal. |
language (optional) | MeikyuuLanguage | undefined | |
label (optional) | string | undefined | The drawing's own words for a screen reader. |
standalone (optional) | boolean | undefined | Put the style in the drawing, so it is a picture on its own. |
Examples
import type { DrawSolidOptions } from "@johnmorrisdotca/meikyuu/3d";
const value: DrawSolidOptions = {label:"Cube maze",size:300};
console.log(value);{ label: 'Cube maze', size: 300 }What it prints (run when this page was built)