primitives-3d_cube.js

import {Cuboid} from "./index";
import {Plane, Vector} from "../math";

/**
 * Creates a cube based on the specified parameters.
 * @memberof primitives-3D
 * @alias Cube
 * @param {Object} parameters - The parameters for the cube.
 * @param {Plane} [parameters.plane=Plane.XY] - The plane in which the cube is constructed.
 * @param {Vector} [parameters.center=Vector.ZERO] - The center of the cube.
 * @param {number} parameters.size - The size of the cube.
 * @returns {Solid} A `Solid` object representing the constructed cube.
 */
const Cube = ({plane = Plane.XY, center = Vector.ZERO, size}) => {
  return Cuboid({
    plane: plane,
    center: center,
    width: size,
    height: size,
    depth: size,
  });
};

export {Cube};