Skip to the content

Kyuubuキューブ

Turn CSS 3D cubes by touch, keys or notation, reproduce a scramble from a seed, and follow a solve one named step at a time.

Kyuubu (キューブ) is the Japanese spelling of cube. About the name

Contents

Reference · Cuboid engine

cuboidLayerOffunction

The layer, 0 to the axis's depth − 1 from its negative side, that a cubie centre sits in.

Import it

import { cuboidLayerOf } from "@johnmorrisdotca/kyuubu/cuboid";

Definition

function cuboidLayerOf(centre: Vec3, axis: CubeAxis, dims: CuboidDims): number

Parameters

NameTypeDescription
centreVec3

The cubie centre in doubled model coordinates.

axisCubeAxis

The model axis: 0 for x, 1 for y, or 2 for z.

dimsCuboidDims

The cuboid’s x, y and z dimensions, in that order.

Returns

number

The layer, 0 to the axis's depth − 1 from its negative side, that a cubie centre sits in.

Examples

import { cuboidLayerOf } from "@johnmorrisdotca/kyuubu/cuboid";

const dims = [2, 3, 3] as const;
console.log(cuboidLayerOf([1, 0, 0], 0, dims));
1

What it prints (run when this page was built)

View sourceEdit on GitHubMade from the source of @johnmorrisdotca/kyuubu 1.14.1.