Reference
Build a mesh and a drawing
import { … } from "@johnmorrisdotca/uchusen-rockets/build";
Exports
| Name | Kind | What it is |
|---|---|---|
build | function | A rocket from a description. |
buildPart | function | One part on its own, by its id. |
Built | type | A rocket built from a description: the fit report, its parts, and the ways to ask for its size, where each part stands, its lit engines, a .glb file and a drawing. |
BuiltPart | type | One part of a built rocket: its slot, its record, the pieces it is made of, its mesh and its bounds in metres. |
CompareId | type | The name of a comparison shape that can stand in a lineup: person or building. |
COMPARES | constant | Comparison shapes: plain round sizes, for scale, not facts about anything. |
drawnPieces | function | What a drawing draws of a part: in a stack, what nests inside the part below is out of sight. |
FitError | class | Raised by build when a description does not fit. |
Glb | type | A binary glTF file: its bytes and how many triangles it holds. |
HEAVY_PIECES | constant | A part with more pieces than this is not meshed until its triangles are asked for, and the mesh is not kept: a fleet ship's parts hold hundreds of thousands of triangles, and keeping them all as arrays of numbers took a gigabyte. |
LineupItem | type | One thing standing in a lineup: its key (starship:v3 or a comparison's name), its label and its height in metres. |
LineupOptions | type | 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. |
lineupSvg | function | The whole picture as SVG text. |
REAL_CRAFT | constant | The real craft that lie in the fleet band for scale: Starship with Super Heavy, Saturn V, SLS and the International Space Station. |
SvgOptions | type | What a drawing is asked for: the look, the view, what to show and whether the engines are lit. |
toGlb | function | Writes parts into one small binary glTF file, in Node or a browser, with no dependency: one node for each part and one primitive for each material. |