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

Builttype

A rocket built from a description: the fit report, its parts, and the ways to ask for its size, where each part stands, its lit engines, a .glb file and a drawing.

Import it

import type { Built } from "@johnmorrisdotca/uchusen-rockets/build";

Definition

interface Built {
    report: FitReport;
    parts: readonly BuiltPart[];
    beside: readonly BuiltPart[];
    names: readonly string[];
    shows: readonly string[];
    boundsOf(show?: string, lit?: boolean): Bounds;
    placesOf(show?: string): {
        slot: string;
        at: Vec3;
        shown: boolean;
    }[];
    flamesOf(show?: string): LitBell[];
    glb(): Glb;
    svg(options?: SvgOptions): string;
}

Members

NameTypeDescription
reportFitReport
partsreadonly BuiltPart[]
besidereadonly BuiltPart[]

The parts of the rocket standing beside it, when it was built beside; empty otherwise. They are not in parts; placesOf, boundsOf, glb and svg take them in. Their slots start beside-.

namesreadonly string[]

The words that name each craft in a picture of several, in the order they stand from the left: the rocket first, then each beside it. Empty unless it was built to name them.

showsreadonly string[]

What can be shown: together, apart and each part.

boundsOf(show?: string, lit?: boolean): Bounds

The bounds of a choice of what to show, in metres, and with lit the flames of its engines at full thrust.

placesOf(show?: string): { slot: string; at: Vec3; shown: boolean; }[]

Where each part stands for a choice of what to show.

flamesOf(show?: string): LitBell[]

The engines alight at full thrust for a choice of what to show: those the drawing has, of the parts whose engines a source tells of.

glb(): Glb

The .glb file's bytes: every part stacked, each its own node to move.

svg(options?: SvgOptions): string

The drawing, in a look, from an angle.

Examples

import { build, type Built } from "@johnmorrisdotca/uchusen-rockets/build";

const rocket: Built = build({ rocket: "starship", variant: "v3" });
console.log(rocket.shows.join(", "));
console.log(rocket.boundsOf("together").max);
together, apart, booster, ship
[ 9.149999999999999, 124.4, 9.149999999999999 ]

What it prints (run when this page was built)

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