本文へ移動

Uchusen Rockets宇宙船

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

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

目次

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

SvgOptions型

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

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

定義

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

メンバー

名前型説明
look (省略可)"line" | "thick" | "painted" | undefined
view (省略可)"three-quarter" | "front" | "back" | "side" | "below" | Angle | undefined
show (省略可)string | undefined
engines (省略可)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 (省略可)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 (省略可)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 (省略可)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.

例

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

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

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

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