本文へ移動

Uchusen Rockets宇宙船

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

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

目次

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

LineupOptions型

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

What a lineup is asked for: the items by key, how many pixels make a metre, and optionally the look, the view, what to show, a ruler and labels.

インポート

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

定義

interface LineupOptions {
    items: readonly string[];
    unit: number;
    look?: LookName;
    view?: ViewName;
    show?: string;
    ruler?: boolean;
    labels?: boolean;
    real?: boolean;
    filter?: "all" | "rockets" | "fleet";
    fit?: {
        width?: number;
        height?: number;
    };
    pose?: "stand";
}

メンバー

名前型説明
itemsreadonly string[]

"starship:v1,starship:v3,person,building".

unitnumber

Pixels a metre.

look (省略可)"line" | "thick" | "painted" | undefined
view (省略可)"three-quarter" | "front" | "back" | "side" | "below" | undefined
show (省略可)string | undefined
ruler (省略可)boolean | undefined
labels (省略可)boolean | undefined
real (省略可)boolean | undefined

Real craft for scale: Starship with Super Heavy, Saturn V, SLS and the ISS lie sideways in the fleet band, at the same scale as the fleet ships, nose right, each labelled with its name and length. Left out: not drawn. Only where the fleet band is.

filter (省略可)"all" | "rockets" | "fleet" | undefined

rockets or fleet leaves out the other kind; all (the default) draws both. A fleet ship (a rocket whose id starts with fleet-) lies lengthwise in its own band below the rockets, unless pose is stand.

fit (省略可){ width?: number; height?: number; } | undefined

Shrinks the scale, never grows it, until the whole drawing fits this many pixels across and down (either may be left out). Without it the scale is unit, as it always was.

pose (省略可)"stand" | undefined

stand draws each fleet ship upright in the row, beside the others, at the same scale, and view turns it. Left out, a fleet ship lies in its own band, as it always has.

例

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

const options: LineupOptions = { items: ["starship:v2", "starship:v3", "building"], unit: 3, ruler: true, labels: true };
console.log(lineupSvg(options).width);
342

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

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

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