Exemplo n.º 1
0
        static void Main(string[] args)
        {
            /** this algorithm works for any number of nodes, but is not as regular
            int N = 100;
            double dlong = Math.PI * (3 - Math.Sqrt(5));
            double dz = 2.0 / N;
            double longitude = 0;
            double z = 1 - dz / 2;
            var nodes = new List<Vector3D>();
            for (var k = 0; k < N; k++) {
                var r = Math.Sqrt(1 - z * z);
                nodes.Add(new Vector3D(Math.Cos(longitude) * r, Math.Sin(longitude) * r, z));
                z = z - dz;
                longitude = longitude + dlong;
            }
            foreach (var node in nodes) {
                Console.WriteLine(node);
            }
            Console.ReadKey();
            */

            var sector = new Icosahedron(4);
            for (int i = 0; i < sector.Vertices.Count; i++) {
                Console.WriteLine(
                    "[" + i + "] \t" + VertStr(sector.Vertices[i])
                    + "\tIP(" + sector.GetIP(i)
                    + ")\tex" + SetStr(sector.Edges(i)));
            }
            Console.ReadKey();
        }
Exemplo n.º 2
0
 public void CreateIcosahedronTest()
 {
     var sphere = new Icosahedron(2);
 }