Skip to the content

Uchusen Rockets宇宙船

Rockets drawn from sourced sizes: line drawings and painted 3D views you drop into a page, take apart and turn round, and a typed model that checks whether a rocket really goes together.

Uchusen is the Japanese word 宇宙船 for spaceship. About the name

Contents

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

NameTypeDescription
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: { booster: { "grid-fins": 12 } }. A flight asks for them.

only (optional)readonly string[] | undefined

Only these slots, closed up into one stack, centred in frame when it is given: a rocket after its first stages have gone. Left out, show decides.

frame (optional)Bounds | undefined

The bounds the picture is fitted to, from another build's boundsOf: parts drawn with it keep the scale of the whole rocket they came from.

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"));
true

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/uchusen-rockets 0.14.0.