figureone
    Preparing search index...

    Cube shape options object that extends OBJ_Generic3All and OBJ_FigurePrimitive

    By default, a cube will be constructed around the origin, with the xyz axes being normal to the cube faces.

    • side number — side length (1)
    • center TypeParsablePoint — center point ([0, 0]) points of cube
    • lines boolean — if true then points representing the 12 edges of the cube will be returned. If false, then points representing two triangles per face (12 triangles, 36 points) and an associated normal for each point will be returned. (false)

    To test examples, append them to the boilerplate

    figure.add({
    make: 'cube',
    side: 0.5,
    color: [1, 0, 0, 1],
    });
    // 3x3 grid of cubes
    figure.add({
    make: 'cube',
    side: 0.2,
    color: [1, 0, 0, 1],
    copy: [
    { along: 'x', num: 2, step: 0.22 },
    { along: 'y', num: 2, step: 0.22 },
    { along: 'z', num: 2, step: 0.22 },
    ],
    });
    // Wire mesh cube
    figure.add({
    make: 'cube',
    side: 0.5,
    lines: true,
    color: [1, 0, 0, 1],
    });
    @interface