'use strict';

/* Polyhedron
	- Vertices: list of vertices
        - Edges: list of tuples where each tuple is of the form (vertex index1, vertex index2)
        - Faces: list of faces where each face is a list edge indices for that face
        - Face adjacency matrix or list
*/
function Polyhedron(vertices, edges, faces) {
    this.vertices = vertices;
    this.edges = edges;
    this.faces = faces;
    return Object.freeze(this);
}

// Create a tetrahedron with corners at (0, 0, 0), (0, 1, 0), (1, 0, 0), (0, 0, 1).
/*function Tetrahedron() {
    var vertices = [(0, 0, 0), (0, 1, 0), (1, 0, 0), (0, 0, 1)],
        edges = [...], // #edges = 6
        faces = [...]; // #faces = 4
    return new Polyhedron(vertices, edges, faces);
}*/

// Create a cube with one corner at the origin and another at (1, 1, 1)
function Cube() {
    var vertices = [(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1),
                    (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)],
        edges = [(0, 1), (0, 2), (0, 4), // edges 0-2
                 (1, 3), (1, 5),         // edges 3-4
                 (2, 3), (2, 6),         // edges 5-6
                 (3, 7),                 // edges 7
                 (4, 5), (4, 6),         // edges 8-9
                 (5, 7),                 // edges 10
                 (6, 7)],                // edges 11
        faces = [[0, 2, 3, 8], // bottom face (y = 0)
                 [5, 11, 6, 7], // top face (y = 1)
                 [0, 2, 3, 5], // left face (x = 0)
                 [8, 9, 10, 11], // right face (x = 1)
                 [3, 4, 7, 10], // front face (z = 1)
                 [1, 2, 6, 9]]; // back face (z = 0);
    return new Polyhedron(vertices, edges, faces);
}

@@ -517,18 +517,16 @@
  0, 1).%0A
-/*
 function
@@ -538,24 +538,24 @@
 ahedron() %7B%0A
+
     var vert
@@ -628,64 +628,363 @@
  = %5B
-...
+(0, 2), (0, 3), (2, 3), // edges (0-2) for bottom face (y = 0)%0A                 (0, 1), (1, 3), // edges (3- 4) (x = 0)%0A                 (1, 2)
 %5D, // 
-#
 edge
-s = 6%0A        faces = %5B...%5D; // #faces = 4
+ 5 (z = 0)%0A        faces = %5B%5B0, 1, 2%5D, // bottom face (y = 0)%0A                 %5B1, 3, 4%5D, // left face (x = 0)%0A                 %5B0, 3, 5%5D, // back face (z = 0)%0A                 %5B2, 4, 5%5D%5D; // front face
 %0A   
@@ -1035,11 +1035,9 @@
 s);%0A
+
 %7D
-*/
 %0A%0A//

Add tetrahedron constructor