cuboidSlotsfunction
Every sticker slot of a cuboid, in the order its state is written, and the way back from a slot to its place. A slot's centre is in doubled coordinates, so a cubie's is a whole step from the middle along each axis.
Import it
import { cuboidSlots } from "@johnmorrisdotca/kyuubu/cuboid";
Definition
function cuboidSlots(dims: CuboidDims): { slots: readonly StickerSlot[]; index: ReadonlyMap<string, number>; }
Parameters
| Name | Type | Description |
|---|---|---|
dims | CuboidDims | The cuboid’s x, y and z dimensions, in that order. |
Returns
{ slots: readonly StickerSlot[]; index: ReadonlyMap<string, number>; }
Every sticker slot of a cuboid, in the order its state is written, and the way back from a slot to its place. A slot's centre is in doubled coordinates, so a cubie's is a whole step from the middle along each axis.
Examples
import { cuboidSlots } from "@johnmorrisdotca/kyuubu/cuboid";
const dims = [2, 3, 3] as const;
console.log(cuboidSlots(dims).slots.length);42What it prints (run when this page was built)