Exemplo n.º 1
0
 public void ReplaceEdge(ECEdge from, ECEdge to)
 {
     for (int i = 0; i < 3; i++)
     {
         if (AdjEdges[i] == from)
         {
             AdjEdges[i] = to;
             to.LinkFace(this);
         }
         else if (AdjEdges[i] == from.Twin())
         {
             AdjEdges[i] = to.Twin();
             to.Twin().LinkFace(this);
         }
     }
     MarkPlaneInvalid();
 }
Exemplo n.º 2
0
        public ECEdge CreateEdge(ECVertex v1, ECVertex v2)
        {
            ECEdge e = new ECEdge(v1, v2);

            Edges.Add(e);
            e.UId = Edges.Count - 1;
            e.Twin().UId = e.UId;
            ValidEdgesCount++;
            return(e);
        }
Exemplo n.º 3
0
        public void MayFixFace(ECFace face)
        {
            ECVertex v0 = face.GetVertex(0);
            ECVertex v1 = face.GetVertex(1);
            ECVertex v2 = face.GetVertex(2);
            ECEdge   e0 = face.GetEdge(0);
            ECEdge   e1 = face.GetEdge(1);
            ECEdge   e2 = face.GetEdge(2);
            bool     a  = (v0 == v1);
            bool     b  = (v0 == v2);
            bool     c  = (v1 == v2);

            if (a && c)
            {
                KillEdge(e0);
                KillEdge(e1);
                KillEdge(e2);
                KillFace(face);
            }
            else if (a)
            {
                KillEdge(e0);
                e1.ReplaceBy(e2.Twin());
                KillFace(face);
            }
            else if (b)
            {
                KillEdge(e2);
                e0.ReplaceBy(e1.Twin());
                KillFace(face);
            }
            else if (c)
            {
                KillEdge(e1);
                e0.ReplaceBy(e2.Twin());
                KillFace(face);
            }
        }