% This script defines several simple polyhedra.
% A polyhedron with N faces is represented as a cellular array of size N. 
% Each element of the array represents one face.
% A face with K vertices is represented as a K x 3 array, where each
% columns of the array is contains the coordinates of the vertices.
% The columns are in counter-clockwise order, as viewed by someone
% outside the solid looking at the face.


cube = { [0,0,0,0; 0,0,1,1; 0,1,1,0],  [1,1,1,1; 0,1,1,0; 0,0,1,1], ...
         [0,1,1,0; 0,0,0,0; 0,0,1,1],  [0,0,1,1; 1,1,1,1; 0,1,1,0], ...
         [0,0,1,1; 0,1,1,0; 0,0,0,0],  [0,1,1,0; 0,0,1,1; 1,1,1,1] }

% 3*5*8 box
box  = { [0,0,0,0; 0,0,5,5; 0,3,3,0],  [8,8,8,8; 0,5,5,0; 0,0,3,3], ...
         [0,8,8,0; 0,0,0,0; 0,0,3,3],  [0,0,8,8; 5,5,5,5; 0,3,3,0], ...
         [0,0,8,8; 0,5,5,0; 0,0,0,0],  [0,8,8,0; 0,0,5,5; 3,3,3,3]}

octahedron = { [1,0,0; 0,1,0; 0,0,1], [0,1,0; -1,0,0; 0,0,1], ...
               [-1,0,0; 0,-1,0; 0,0,1], [0,-1,0; 1,0,0; 0,0,1], ...
               [0,1,0; 1,0,0; 0,0,-1], [1,0,0; 0,-1,0; 0,0,-1], ...
               [0,-1,0; -1,0,0; 0,0,-1], [-1,0,0; 0,1,0; 0,0,-1] }

% pyramid with square base (top half of octahedron) 
pyramid = { [1,0,0; 0,1,0; 0,0,1], [0,1,0; -1,0,0; 0,0,1], ...
            [-1,0,0; 0,-1,0; 0,0,1], [0,-1,0; 1,0,0; 0,0,1], ...
            [1,0,-1,0; 0,-1,0,1; 0,0,0,0]}

% frustum (bottom half of pyramid expanded by 2)

frustum = { [2,0,0,1; 0,2,1,0; 0,0,1,1], [0,-2,-1,0; 2,0,0,1; 0,0,1,1], ...
            [-2,0,0,-1; 0,-2,-1,0; 0,0,1,1], [0,2,1,0; -2,0,0,-1; 0,0,1,1] ...
            [2,0,-2,0; 0,-2,-0,2; 0,0,0,0], [1,0,-1,0; 0,1,0,-1; 1,1,1,1]}


