M-File Help: mkcube View code for mkcube

mkcube

Create cube

p = mkcube(s, options) is a set of points (3x8) that define the vertices of a cube of side length s and centred at the origin.

[x,y,z] = mkcube(s, options) as above but return the rows of p as three vectors.

[x,y,z] = mkcube(s, 'edge', options) is a mesh that defines the edges of a cube.

Options

'facepoint' Add an extra point in the middle of each face, in this case the returned value is 3x14 (8 vertices + 6 face centres).
'centre', C The cube is centred at C (3x1) not the origin
'T', T The cube is arbitrarily transformed by the homogeneous transform T
'edge' Return a set of cube edges in MATLAB mesh format rather than points.

See also

cylinder, sphere


 

© 1990-2012 Peter Corke.