LibTessDotNet.Mesh.ZapFace C# (CSharp) 메소드

ZapFace() 공개 메소드

Destroys a face and removes it from the global face list. All edges of fZap will have a NULL pointer as their left face. Any edges which also have a NULL pointer as their right face are deleted entirely (along with any isolated vertices this produces). An entire mesh can be deleted by zapping its faces, one at a time, in any order. Zapped faces cannot be used in further mesh operations!
public ZapFace ( LibTessDotNet.MeshUtils.Face fZap ) : void
fZap LibTessDotNet.MeshUtils.Face
리턴 void
        public void ZapFace(MeshUtils.Face fZap)
        {
            var eStart = fZap._anEdge;

            // walk around face, deleting edges whose right face is also NULL
            var eNext = eStart._Lnext;
            MeshUtils.Edge e, eSym;
            do {
                e = eNext;
                eNext = e._Lnext;

                e._Lface = null;
                if (e._Rface == null)
                {
                    // delete the edge -- see TESSmeshDelete above

                    if (e._Onext == e)
                    {
                        MeshUtils.KillVertex(e._Org, null);
                    }
                    else
                    {
                        // Make sure that e._Org points to a valid half-edge
                        e._Org._anEdge = e._Onext;
                        MeshUtils.Splice(e, e._Oprev);
                    }
                    eSym = e._Sym;
                    if (eSym._Onext == eSym)
                    {
                        MeshUtils.KillVertex(eSym._Org, null);
                    }
                    else
                    {
                        // Make sure that eSym._Org points to a valid half-edge
                        eSym._Org._anEdge = eSym._Onext;
                        MeshUtils.Splice(eSym, eSym._Oprev);
                    }
                    MeshUtils.KillEdge(e);
                }
            } while (e != eStart);

            /* delete from circular doubly-linked list */
            var fPrev = fZap._prev;
            var fNext = fZap._next;
            fNext._prev = fPrev;
            fPrev._next = fNext;

            fZap.Free();
        }

Usage Example

예제 #1
0
 private void DiscardExterior()
 {
     MeshUtils.Face next;
     for (MeshUtils.Face face = _mesh._fHead._next; face != _mesh._fHead; face = next)
     {
         next = face._next;
         if (!face._inside)
         {
             _mesh.ZapFace(face);
         }
     }
 }
All Usage Examples Of LibTessDotNet.Mesh::ZapFace