Пример #1
0
        private void btnMesh_Click(object sender, EventArgs e)
        {
            toolStripProgressBar1.Value = 0;
            generatingMesh = new GeneratingMesh(polygon, config.Quality);
            toolStripProgressBar1.Value = 30;
            generatingMesh.eps          = 0.000000000000001;
            domain.mesh = generatingMesh.GenerateGrid();
            toolStripProgressBar1.Value = 85;
            domain.mesh.RenumberNodes();
            toolStripProgressBar1.Value = 100;

            textBox1.Text  = "Triangles:   " + domain.mesh.triangles.Count + "\r\n";
            textBox1.Text += "Points:   " + domain.mesh.nodes.Count + "\r\n";
            toolStripProgressBar1.Value = 0;

            MeshMode();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Polygon lp = new Polygon();

            lp.AddVertex(new Node(0, 0));
            lp.AddVertex(new Node(1, 0));
            lp.AddVertex(new Node(1, 1));
            lp.AddVertex(new Node(0, 1));
            GeneratingMesh gener = new GeneratingMesh(lp, 2);

            gener.eps = 0.001;
            Mesh m = gener.GenerateGrid();

            /*
             * Segment s1 = new Segment(new Point(0, 0), new Point(1, 0));
             * Segment s2 = new Segment(new Point(1, 0), new Point(1, 1));
             *
             * Console.WriteLine(Segment.angle(s1,s2));*/
        }