Пример #1
0
        protected void addNewFaces(FaceList newFaces, Vertex eyeVtx, ArrayList horizon)
        {
            newFaces.clear();

            HalfEdge hedgeSidePrev  = null;
            HalfEdge hedgeSideBegin = null;

            foreach (object o in horizon)
            {
                HalfEdge horizonHe = (HalfEdge)o;
                HalfEdge hedgeSide = addAdjoiningFace(eyeVtx, horizonHe);
                if (debug)
                {
                    Console.WriteLine(
                        "new face: " + hedgeSide.face.getVertexString());
                }
                if (hedgeSidePrev != null)
                {
                    hedgeSide.next.setOpposite(hedgeSidePrev);
                }
                else
                {
                    hedgeSideBegin = hedgeSide;
                }
                newFaces.add(hedgeSide.getFace());
                hedgeSidePrev = hedgeSide;
            }
            hedgeSideBegin.next.setOpposite(hedgeSidePrev);
        }
Пример #2
0
        public void triangulate()
        {
            double minArea = 1000 * charLength * DOUBLE_PREC;

            newFaces.clear();

            foreach (object o in faces)
            {
                Face face = (Face)o;
                if (face.mark == Face.VISIBLE)
                {
                    face.triangulate(newFaces, minArea);
                    // splitFace (face);
                }
            }
            for (Face face = newFaces.first(); face != null; face = face.next)
            {
                faces.Add(face);
            }
        }