Exemplo n.º 1
0
 public bool compere(Verge a1, Verge a2)
 {
     if (a1.a.x == a2.a.x || a1.a.x == a2.a.y || a1.a.x == a2.a.z)
     {
         if (a1.a.y == a2.a.x || a1.a.y == a2.a.y || a1.a.y == a2.a.z || a1.a.z == a2.a.x || a1.a.z == a2.a.y || a1.a.z == a2.a.z)
         {
             return(true);
         }
     }
     if (a1.a.y == a2.a.x || a1.a.y == a2.a.y || a1.a.y == a2.a.z)
     {
         if (a1.a.x == a2.a.x || a1.a.x == a2.a.y || a1.a.x == a2.a.z || a1.a.z == a2.a.x || a1.a.z == a2.a.y || a1.a.z == a2.a.z)
         {
             return(true);
         }
     }
     if (a1.a.z == a2.a.x || a1.a.z == a2.a.y || a1.a.z == a2.a.z)
     {
         if (a1.a.x == a2.a.x || a1.a.x == a2.a.y || a1.a.x == a2.a.z || a1.a.y == a2.a.x || a1.a.y == a2.a.y || a1.a.y == a2.a.z)
         {
             return(true);
         }
     }
     return(false);
 }
Exemplo n.º 2
0
        public static Verge createVerge(Point a, Point b, Point c, Point x)
        {
            Point vector = Normal(a, b, c);
            Verge v      = new Verge();

            if (!isHighter(vector, a, x))
            {
                v.a    = a;
                v.b    = b;
                v.c    = c;
                v.norm = vector;
                return(v);
            }
            else
            {
                v.a      = a;
                v.b      = b;
                v.c      = c;
                vector.x = -vector.x;
                vector.y = -vector.y;
                vector.z = -vector.z;
                v.norm   = vector;
                return(v);
            }
        }
Exemplo n.º 3
0
        public static void addtoHorizont(ref List <Point> horizont, Verge verge)
        {
            bool isNorm = true;

            for (int i = 0; i < horizont.Count; i++)
            {
                if (horizont[i] == verge.a)
                {
                    isNorm = false;
                    break;
                }
            }
            if (isNorm)
            {
                horizont.Add(verge.a);
            }
            isNorm = true;
            for (int i = 0; i < horizont.Count; i++)
            {
                if (horizont[i] == verge.b)
                {
                    isNorm = false;
                    break;
                }
            }
            if (isNorm)
            {
                horizont.Add(verge.b);
            }
            isNorm = true;
            for (int i = 0; i < horizont.Count; i++)
            {
                if (horizont[i] == verge.c)
                {
                    isNorm = false;
                    break;
                }
            }
            if (isNorm)
            {
                horizont.Add(verge.c);
            }
        }