Reference · Build a mesh and a drawing
SvgOptionstype
What a drawing is asked for: the look, the view, what to show and whether the engines are lit. Anything left out takes its default.
Import it
import type { SvgOptions } from "@johnmorrisdotca/uchusen-rockets/build";
Definition
interface SvgOptions {
look?: LookName;
view?: ViewName | Angle;
show?: string;
engines?: boolean | Readonly<Record<string, number>>;
moves?: Readonly<Record<string, Readonly<Record<string, number>>>>;
only?: readonly string[];
frame?: Bounds;
}
Members
| Name | Type | Description |
|---|---|---|
look (optional) | "line" | "thick" | "painted" | undefined | |
view (optional) | "three-quarter" | "front" | "back" | "side" | "below" | Angle | undefined | |
show (optional) | string | undefined | |
engines (optional) | boolean | Readonly<Record<string, number>> | undefined | A flame at each engine that is showing, or as many as a count names for each part. The length is a picture, not a measured flame. Left out, the drawing is unchanged. |
moves (optional) | Readonly<Record<string, Readonly<Record<string, number>>>> | undefined | Degrees each moving group of each part is turned from where it is drawn at rest, by slot and then by name: |
only (optional) | readonly string[] | undefined | Only these slots, closed up into one stack, centred in |
frame (optional) | Bounds | undefined | The bounds the picture is fitted to, from another build's |
Examples
import { build, type SvgOptions } from "@johnmorrisdotca/uchusen-rockets/build";
const options: SvgOptions = { look: "thick", view: "below", show: "booster" };
console.log(build({ rocket: "starship", variant: "v3" }).svg(options).startsWith("<svg"));trueWhat it prints (run when this page was built)