Class Cube

  • Direct Known Subclasses:
    Cube3

    public class Cube
    extends Model
    Create a wireframe model of a cube with its center at the origin, having edge length 2, and with its vertices at (±1, ±1, ±1).

    Here is a picture showing how the cube's eight corners are labeled.

    
                      v4=(-1,1,-1)
                      +---------------------+ v5=(1,1,-1)
                     /|                    /|
                    / |                   / |
                   /  |                  /  |
                  /   |                 /   |
                 /    |                /    |
             v7 +---------------------+ v6  |
                |     |               |     |
                |     |               |     |
                |     | v0=(-1,-1,-1) |     |
                |     +---------------|-----+ v1=(1,-1,-1)
                |    /                |    /
                |   /                 |   /
                |  /                  |  /
                | /                   | /
                |/                    |/
                +---------------------+
                v3=(-1,-1,1)          v2=(1,-1,1)
    
    See https://en.wikipedia.org/wiki/Cube
    See Also:
    Tetrahedron, Octahedron, Icosahedron, Dodecahedron
    • Constructor Detail

      • Cube

        public Cube()
        Create a cube with its center at the origin, having edge length 2, and with its vertices at (±1, ±1, ±1).
      • Cube

        public Cube​(String name)
        Create a cube with its center at the origin, having edge length 2, and with its vertices at (±1, ±1, ±1).
        Parameters:
        name - a {link String} that is a name for this Cube