Example #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();
        }
Example #2
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();
        }