Ejemplo n.º 1
0
        public float[] tete(float[] a)
        {
            float[] k = null;
            if (a != null && a.Length > 0 && a.Length % 3 == 0)
            {
                PointList pList = new PointList();
                for (int i = 0; i < a.Length; i += 3)
                {
                    Point p = new Point(a[i], a[i + 1], a[i + 2]);
                    pList.pointList.Add(p);
                }

                Construction_TIN ct = new Construction_TIN(pList);
                TriangleList     tl = ct.Triangle_const();

                if (tl.Count > 0)
                {
                    PointList tPoints = new PointList();
                    for (int i = 0; i < tl.Count; i++)
                    {
                        tPoints.pointList.Add(tl[i].A);
                        tPoints.pointList.Add(tl[i].B);
                        tPoints.pointList.Add(tl[i].C);
                    }
                    List <float> temp = new List <float>();
                    for (int i = 0; i < tPoints.Count; i++)
                    {
                        temp.Add(tPoints[i].X);
                        temp.Add(tPoints[i].Y);
                        temp.Add(tPoints[i].Z);
                    }
                    k = temp.ToArray();
                }
            }
            return(k);
        }
Ejemplo n.º 2
0
 //构造函数用于给以上声明的两个列表初始化
 public Construction_TIN(PointList points)
 {
     this.pointlist = points;
     this.triangles = new TriangleList();
 }