本文へ移動

Uchusen Rockets宇宙船

出典つきの寸法から描いたロケットです。ページに置いて、分解して、回して見られる線画と彩色した3Dビューに加え、ロケットが本当に組み合わさるかを確かめる、型付きのデータモデルを備えています。

Uchusen は、宇宙を飛ぶ乗り物を意味する日本語「宇宙船」(うちゅうせん)から取った名前です。 名前について(英語)

目次

リファレンス · メッシュと図面を作る

Built型

リファレンスの説明と例は英語です。見出しと目次は日本語です。

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 type { Built } from "@johnmorrisdotca/uchusen-rockets/build";

定義

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;
}

メンバー

名前型説明
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.

例

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 ]

出力(このページを作ったときに実行した結果)

ソースを見るGitHub で編集@johnmorrisdotca/uchusen-rockets 0.14.0 のソースから作成しました。

この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。