Reference · Build a mesh and a drawing
LineupOptionstype
What a lineup is asked for: the items by key, how many pixels make a metre, and optionally the look, the view, what to show, a ruler and labels.
Import it
import type { LineupOptions } from "@johnmorrisdotca/uchusen-rockets/build";
Definition
interface LineupOptions {
items: readonly string[];
unit: number;
look?: LookName;
view?: ViewName;
show?: string;
ruler?: boolean;
labels?: boolean;
real?: boolean;
filter?: "all" | "rockets" | "fleet";
fit?: {
width?: number;
height?: number;
};
pose?: "stand";
}
Members
| Name | Type | Description |
|---|---|---|
items | readonly string[] | "starship:v1,starship:v3,person,building". |
unit | number | Pixels a metre. |
look (optional) | "line" | "thick" | "painted" | undefined | |
view (optional) | "three-quarter" | "front" | "back" | "side" | "below" | undefined | |
show (optional) | string | undefined | |
ruler (optional) | boolean | undefined | |
labels (optional) | boolean | undefined | |
real (optional) | boolean | undefined | Real craft for scale: Starship with Super Heavy, Saturn V, SLS and the ISS lie sideways in the fleet band, at the same scale as the fleet ships, nose right, each labelled with its name and length. Left out: not drawn. Only where the fleet band is. |
filter (optional) | "all" | "rockets" | "fleet" | undefined |
|
fit (optional) | { width?: number; height?: number; } | undefined | Shrinks the scale, never grows it, until the whole drawing fits this many pixels across and down (either may be left out). Without it the scale is |
pose (optional) | "stand" | undefined |
|
Examples
import { lineupSvg, type LineupOptions } from "@johnmorrisdotca/uchusen-rockets/build";
const options: LineupOptions = { items: ["starship:v2", "starship:v3", "building"], unit: 3, ruler: true, labels: true };
console.log(lineupSvg(options).width);342What it prints (run when this page was built)