示例#1
0
        public void AddTriangle(int a, int b, int c)
        {
            faces[currentFace]        = new AdjTriangle();
            faces[currentFace].Ref[0] = a;
            faces[currentFace].Ref[1] = b;
            faces[currentFace].Ref[2] = c;

            faces[currentFace].Tri[0] = -1;
            faces[currentFace].Tri[1] = -1;
            faces[currentFace].Tri[2] = -1;

            if (a < b)
            {
                AddEdge(a, b, currentFace);
            }
            else
            {
                AddEdge(b, a, currentFace);
            }

            if (a < c)
            {
                AddEdge(a, c, currentFace);
            }
            else
            {
                AddEdge(c, a, currentFace);
            }

            if (b < c)
            {
                AddEdge(b, c, currentFace);
            }
            else
            {
                AddEdge(c, b, currentFace);
            }

            currentFace++;
        }
示例#2
0
        public void AddTriangle(int a, int b, int c)
        {
            faces[currentFace] = new AdjTriangle();
            faces[currentFace].Ref[0] = a;
            faces[currentFace].Ref[1] = b;
            faces[currentFace].Ref[2] = c;

            faces[currentFace].Tri[0] = -1;
            faces[currentFace].Tri[1] = -1;
            faces[currentFace].Tri[2] = -1;

            if (a < b) { AddEdge(a, b, currentFace); }
            else {       AddEdge(b, a, currentFace); }

            if (a < c) { AddEdge(a, c, currentFace); }
            else {       AddEdge(c, a, currentFace); }

            if (b < c) { AddEdge(b, c, currentFace); }
            else {       AddEdge(c, b, currentFace); }

            currentFace++;
        }