Exemple #1
0
        public void make_tetrahedron(Polyhedron cube = null)
        {
            if (cube == null)
            {
                cube = new Polyhedron();
                cube.make_hexahedron();
            }
            Polygon f0 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[0].Points[0]),
                new Point3D(cube.Faces[1].Points[1]),
                new Point3D(cube.Faces[1].Points[3])
            }
                );

            Polygon f1 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[1].Points[3]),
                new Point3D(cube.Faces[1].Points[1]),
                new Point3D(cube.Faces[0].Points[2])
            }
                );

            Polygon f2 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[0].Points[2]),
                new Point3D(cube.Faces[1].Points[1]),
                new Point3D(cube.Faces[0].Points[0])
            }
                );

            Polygon f3 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[0].Points[2]),
                new Point3D(cube.Faces[0].Points[0]),
                new Point3D(cube.Faces[1].Points[3])
            }
                );

            Faces = new List <Polygon> {
                f0, f1, f2, f3
            };
            find_center();
        }
Exemple #2
0
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox1.SelectedIndex)
            {
            case 0:
                //Tetrahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.make_tetrahedron();
                figure.show(g, projection);
                break;

            case 1:
                //Hexahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.make_hexahedron();
                figure.show(g, projection);
                break;

            case 2:
                //Oktahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.make_octahedron();
                figure.show(g, projection);
                break;

            case 3:
                //Icosahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.make_icosahedron();
                figure.show(g, projection);
                break;

            case 4:
                //Dodecahedron
                g.Clear(Color.White);
                figure = new Polyhedron();
                figure.make_dodecahedron();
                figure.show(g, projection);
                break;

            default:
                break;
            }
        }
Exemple #3
0
        public void make_octahedron(Polyhedron cube = null)
        {
            if (cube == null)
            {
                cube = new Polyhedron();
                cube.make_hexahedron();
            }

            Polygon f0 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[2].Center),
                new Point3D(cube.Faces[1].Center),
                new Point3D(cube.Faces[4].Center)
            }
                );

            Polygon f1 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[2].Center),
                new Point3D(cube.Faces[1].Center),
                new Point3D(cube.Faces[5].Center)
            }
                );

            Polygon f2 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[2].Center),
                new Point3D(cube.Faces[5].Center),
                new Point3D(cube.Faces[0].Center)
            }
                );

            Polygon f3 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[2].Center),
                new Point3D(cube.Faces[0].Center),
                new Point3D(cube.Faces[4].Center)
            }
                );

            Polygon f4 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[3].Center),
                new Point3D(cube.Faces[1].Center),
                new Point3D(cube.Faces[4].Center)
            }
                );

            Polygon f5 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[3].Center),
                new Point3D(cube.Faces[1].Center),
                new Point3D(cube.Faces[5].Center)
            }
                );

            Polygon f6 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[3].Center),
                new Point3D(cube.Faces[5].Center),
                new Point3D(cube.Faces[0].Center)
            }
                );

            Polygon f7 = new Polygon(
                new List <Point3D>
            {
                new Point3D(cube.Faces[3].Center),
                new Point3D(cube.Faces[0].Center),
                new Point3D(cube.Faces[4].Center)
            }
                );

            Faces = new List <Polygon> {
                f0, f1, f2, f3, f4, f5, f6, f7
            };
            find_center();
        }