meta data for this page
  •  

This is an old revision of the document!


Cuboid

A three dimensional shape created from six retangular faces, each at right angles to another, and opposite faces are equal. The cube is a special case of the a cuboid in which all six faces are squares.


Learn about cuboids at MathIsFun.com

The 'size' specifies the size of each face. Cuboids with different radius for X, Y and Z axis can be specified by supplying an array of values. Cuboids can be created at a requested 'center'.

Defaults:

  • size : [2, 2, 2]
  • center : [0, 0, 0]
cuboid({size: [1, 2, 3]})
cuboid({size: [1, 2, 3], center: [4, 5, 6]})

Also, the CSG library functions can be used directly. NOTE Deprecated in the V2 API

CSG.cube({
    center: [0, 0, 0],
    radius: [1, 1, 1]
})
 
CSG.cube({ // define two opposite corners
    corner1: [4, 4, 4],
    corner2: [5, 4, 2]
})

Rounded cubes are created by specifying a rounded radius for the corners and the sides.

CSG.roundedCube({ // rounded cube
    center: [0, 0, 0],
    radius: 1,
    roundradius: 0.9,
    resolution: 8,
});