Reference · Build a mesh and a drawing
buildPartfunction
One part on its own, by its id.
Import it
import { buildPart } from "@johnmorrisdotca/uchusen-rockets/build";
Definition
function buildPart(id: string): { record: PartRecord; bounds: Bounds; glb: () => Glb; svg: (options?: SvgOptions) => string; }
Parameters
| Name | Type | Description |
|---|---|---|
id | string | A part's id, as |
Returns
{ record: PartRecord; bounds: Bounds; glb: () => Glb; svg: (options?: SvgOptions) => string; }
The part's record and bounds, a function for its .glb and one for its drawing. It throws for an id that is not a part.
Examples
import { buildPart } from "@johnmorrisdotca/uchusen-rockets/build";
const raptor = buildPart("raptor-vacuum");
console.log(raptor.record.name, raptor.bounds.max);Raptor, vacuum [ 1.132528915964039, 4.4, 1.15 ]What it prints (run when this page was built)