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 · Rockets, variants, parts and the fit check

shipLevelsfunction

A ship in two passes: the coarse pieces of every module at once, for a first picture, and the fine pass as one batch of pieces for each module, nearest first if order says so. Adding the batches one after another gives the same ship as shipPieces at the fine level; a viewer adds one a frame, so the picture never waits for the detail.

Import it

import { shipLevels } from "@johnmorrisdotca/uchusen-rockets";

Definition

function shipLevels(ship: ShipList, options?: ModuleOptions, order?: readonly number[]): { coarse: Piece[]; fine: () => Generator<{ place: number; pieces: Piece[]; }>; }

Parameters

NameTypeDescription
shipShipList

The ship's list.

options (optional)ModuleOptions

What to draw, for every module.

order (optional)readonly number[] | undefined

The places in the order the fine pass should take them. Left out: the order of the list.

Returns

{ coarse: Piece[]; fine: () => Generator<{ place: number; pieces: Piece[]; }>; }

The coarse pieces, and a function that yields the fine batches.

Examples

import { SAMPLE_SHIPS, shipLevels } from "@johnmorrisdotca/uchusen-rockets";

const { coarse, fine } = shipLevels(SAMPLE_SHIPS.scout);
console.log(coarse.length, [...fine()].length);
43 11

What it prints (run when this page was built)

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