cube()

The Cube() primitive command will add a 6 sided figure with parallel sides.

In it’s basic form the cube(); command does not need any parameters.

You can create a cube with the unit measure of 1 by adding the above command, here is the result:

cube();
OpenSCAD – Default size cube.

If you add a single parameter you can add cubes of any uniform size

cube( 7 );
OpenSCAD – cube using one dimension

To change cube dimensions individually must use a vector of values. They are in the order of X, Y , Z and they must be non-zero. Zero values will not generate an error but nothing will be rendered.

cube( [7,9,1]);
OpenSCAD – Cube using 3 dimensions

The final parameter available in centering. This places the origin of the cube in the volumetric center of the cube.

cube([10,10,10],center=true);
OpenSCAD – Centered Cube

That’s really all there is to the cube. Not very complicated at all.

Leave a Reply