arrangement関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The general-arrangement views of a ship at one scale: side (the spine up the sheet), front (looking down the spine) and top, in a frame width by height pixels, with one scale for all three and a ruler along the length.
インポート
import { arrangement } from "@johnmorrisdotca/uchusen-rockets";
定義
function arrangement(ship: ShipList, frame: { width: number; height: number; }): Arrangement
引数
| 名前 | 型 | 説明 |
|---|---|---|
ship | ShipList | The ship's list. |
frame | { width: number; height: number; } | The room each view has, in pixels. |
戻り値
Arrangement
The scale, the size of each view, a scale bar and the length ruler's ticks.
例
import { arrangement, SAMPLE_SHIPS } from "@johnmorrisdotca/uchusen-rockets";
const a = arrangement(SAMPLE_SHIPS.scout, { width: 400, height: 900 });
console.log(a.scale.toFixed(2), a.views.map((view) => view.id), a.lengthRuler.step);5.92 [ 'side', 'front', 'top' ] 20出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。