예제 #1
0
        public void ComputeHull()
        {
            if (this.pointSet_0 == null)
            {
                throw new InvalidOperationException("Can not compute convex hull: no point set defined.");
            }
            if (this.pointSet_0.Count < 4)
            {
                throw new ArgumentException("Can not compute 3d convex hull for less than four points.");
            }
            if (!Class20.bool_0)
            {
                Class20.smethod_0();
            }
            Class21 @class = new Class21(this);

            this.method_1(@class.method_2().GetRange(0, @class.method_2().Count - 4), ref @class);
            this.list_0 = new List <Triangle>();
            for (int i = 0; i < @class.method_0().Count; i++)
            {
                try
                {
                    if (@class.method_0()[i].method_0())
                    {
                        this.list_0.Add(@class.method_0()[i].method_16());
                    }
                }
                catch (System.Exception ex)
                {
                    this.int_0++;
                }
            }
            this.pointSet_1 = new PointSet();
            for (int j = 0; j < @class.method_2().Count; j++)
            {
                if (@class.method_2()[j].method_4())
                {
                    this.pointSet_1.Add(@class.method_2()[j].method_0());
                }
            }
        }
예제 #2
0
 private void method_1(List <Class25> vertexList, ref Class21 class21_0)
 {
     for (int i = vertexList.Count - 1; i >= 0; i--)
     {
         this.vmethod_0(null, null);
         Class25 @class = vertexList[i];
         try
         {
             if (@class.method_2().Count != 0)
             {
                 List <Class23> list = class21_0.method_7(@class);
                 if (list != null)
                 {
                     if (list.Count < 3)
                     {
                         this.list_1.Add(@class);
                     }
                     else
                     {
                         List <Class13> list2 = new List <Class13>();
                         for (int j = 0; j < list.Count; j++)
                         {
                             Class13 class2 = new Class13(list[j].method_0(), list[j].method_2(), @class);
                             list2.Add(class2);
                             Class13 class3 = list[j].method_4()[0];
                             Class13 class4 = list[j].method_4()[1];
                             for (int k = 0; k < class3.method_10().Count; k++)
                             {
                                 Class25 class5 = class3.method_10()[k];
                                 if (!(class5 == @class) && !class4.method_15(class5) && class2.method_15(class5))
                                 {
                                     class2.method_10().Add(class5);
                                     class5.method_2().Add(class2);
                                 }
                             }
                             for (int l = 0; l < class4.method_10().Count; l++)
                             {
                                 Class25 class6 = class4.method_10()[l];
                                 if (!(class6 == @class) && class2.method_15(class6))
                                 {
                                     class2.method_10().Add(class6);
                                     class6.method_2().Add(class2);
                                 }
                             }
                             class2.method_8()[2] = class4;
                             if (class4.method_6() == list[j].method_0() && class4.method_4() == list[j].method_2())
                             {
                                 class4.method_8()[0] = class2;
                             }
                             if (class4.method_2() == list[j].method_0() && class4.method_6() == list[j].method_2())
                             {
                                 class4.method_8()[1] = class2;
                             }
                             if (class4.method_4() == list[j].method_0() && class4.method_2() == list[j].method_2())
                             {
                                 class4.method_8()[2] = class2;
                             }
                         }
                         list2[0].method_8()[0] = list2[1];
                         list2[0].method_8()[1] = list2[list2.Count - 1];
                         for (int m = 1; m < list2.Count - 1; m++)
                         {
                             list2[m].method_8()[0] = list2[m + 1];
                             list2[m].method_8()[1] = list2[m - 1];
                         }
                         list2[list2.Count - 1].method_8()[0] = list2[0];
                         list2[list2.Count - 1].method_8()[1] = list2[list2.Count - 2];
                         for (int n = 0; n < @class.method_2().Count; n++)
                         {
                             @class.method_2()[n].method_1(false);
                         }
                         class21_0.method_0().AddRange(list2);
                     }
                 }
             }
         }
         catch (System.Exception ex)
         {
             this.list_1.Add(@class);
         }
     }
 }