Пример #1
0
 static public void make(int to, int from, OriEdge x)
 {
     made[from, to]  = true;
     made[to, from]  = true;
     edges[from, to] = x;
     edges[to, from] = x;
 }
Пример #2
0
        public override bool Equals(object obj)
        {
            if (obj == null || obj.GetType() != this.GetType())
            {
                return(false);
            }
            OriEdge e = obj as OriEdge;

            return(((start.p == e.start.p) && (end.p == e.end.p)) || ((start.p == e.end.p) && (end.p == e.start.p)));
        }
Пример #3
0
        public void CreateMesh(int[] num, List <OriVertex> v, int count)
        {
            index  = num;
            number = count;
            FACE_NUM++;
            OriEdge x;

            for (int i = 0; i < num.Length; i++)
            {
                vertexs.Add(v[num[i]]);

                if (i != 0)
                {
                    if (!EdgesDP.check(num[i - 1], num[i]))
                    {
                        x = new OriEdge(v[num[i - 1]], v[num[i]]);
                        EdgesDP.make(num[i], num[i - 1], x);
                    }
                    else
                    {
                        x = EdgesDP.get(num[i], num[i - 1]);
                    }
                    x.AddJointing(this, true);
                    edges.Add(x);
                }
            }

            if (!EdgesDP.check(num[num.Length - 1], num[0]))
            {
                x = new OriEdge(v[num[num.Length - 1]], v[num[0]]);
                EdgesDP.make(num[0], num[num.Length - 1], x);
            }
            else
            {
                x = EdgesDP.get(num[0], num[num.Length - 1]);
            }
            x.AddJointing(this, true);
            edges.Add(x);

            IsPlane = true;

            side = Vector3.Cross(v[num[0]].p - v[num[1]].p, v[num[2]].p - v[num[1]].p).normalized;
        }