protected Curve GetLines(Point[,] vertexes)
        {
            var curve = new Curve();
            var rows = vertexes.GetLength(0);
            var columns = vertexes.GetLength(1);

            for (var i = 0; i < rows - 1; i++)
            {
                for (var j = 0; j < columns - 1; j++)
                {
                    if (i == 0) { SetCurve(curve, i, j, i, j + 1); }
                    else { SetCurve(curve, i, j, i, j + 1, vertexes); }
                    if (j == 0) { SetCurve(curve, i, j, i + 1, j); }
                    else { SetCurve(curve, i, j, i + 1, j, vertexes); }
                }
            }

            for (var i = 0; i < rows - 1; i++) { SetCurve(curve, i, columns - 1, i + 1, columns - 1); }
            for (var j = 0; j < columns - 1; j++) { SetCurve(curve, rows - 1, j, rows - 1, j + 1); }

            return curve;
        }
 private void SetCurve(Curve curve, int x1, int y1, int x2, int y2, Point[,] vertexes)
 {
     curve[x1, y1, x2, y2] = GetConnectPoints(vertexes[x1, y1], vertexes[x2, y2], (x1 + y1) % 2 == 0);
 }
 private void SetCurve(Curve curve, int x1, int y1, int x2, int y2)
 {
     curve[x1, y1, x2, y2] = null;
 }