Reference · Build a mesh and a drawing
BuiltParttype
One part of a built rocket: its slot, its record, the pieces it is made of, its mesh and its bounds in metres.
Import it
import type { BuiltPart } from "@johnmorrisdotca/uchusen-rockets/build";
Definition
interface BuiltPart {
slot: string;
record: PartRecord;
pieces: readonly Piece[];
mesh: PartMesh;
bounds: Bounds;
flame: FlameKind;
craft?: number;
}
Members
| Name | Type | Description |
|---|---|---|
slot | string | |
record | PartRecord | |
pieces | readonly Piece[] | |
mesh | PartMesh | |
bounds | Bounds | |
flame | FlameKind | The colour of this part's flame, from what a page says its engine burns; |
craft (optional) | number | undefined | Which craft standing beside the rocket this part belongs to (0 is the first); left out for the rocket's own parts. |
Examples
import { build, type BuiltPart } from "@johnmorrisdotca/uchusen-rockets/build";
const first: BuiltPart | undefined = build({ rocket: "falcon-9", variant: "block-5" }).parts[0];
console.log(first?.slot, first?.record.name);first-stage First stage, Falcon 9 block-5What it prints (run when this page was built)