
public class Shape3DFactory {
    
    public static Shape3D makeCube() {
        Shape3D result = new Shape3D();
        
        XPoint3D[] point = {
             new XPoint3D(0, 0, 0),
             new XPoint3D(1, 0, 0),
             new XPoint3D(1, 1, 0),
             new XPoint3D(0, 1, 0),
             new XPoint3D(0, 0, 1),
             new XPoint3D(1, 0, 1),
             new XPoint3D(1, 1, 1),
             new XPoint3D(0, 1, 1)
        };
        
        int[][] edge = {
            { 0, 1 }, 
            { 1, 2 }, 
            { 2, 3 }, 
            { 3, 0 }, 
            { 4, 5 }, 
            { 5, 6 }, 
            { 6, 7 }, 
            { 7, 4 }, 
            { 0, 4 }, 
            { 1, 5 }, 
            { 2, 6 }, 
            { 3, 7 }
        };
        
        int[][] face = {
            { 4, 5, 6, 7 },  
            { 3, 2, 1, 0 },
            { 1, 2, 6, 5 },
            { 0, 4, 7, 3 },
            { 2, 3, 7, 6 },
            { 0, 1, 5, 4 }
        };
        
        result.setPoints(point);
        result.setEdges(edge);
        result.setFaces(face);
        
        return result;
    }
}

