本文へ移動

Uchusen Rockets宇宙船

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

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

目次

リファレンス · ロケット・型式・部品・適合チェック

shipLevels関数

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

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

定義

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

引数

名前型説明
shipShipList

The ship's list.

options (省略可)ModuleOptions

What to draw, for every module.

order (省略可)readonly number[] | undefined

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

戻り値

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

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

例

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

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

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

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

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