Esempio n. 1
0
        private HalfEdge addAdjoiningFace(Vertex eyeVtx, HalfEdge he)
        {
            Face face = Face.createTriangle(eyeVtx, he.tail(), he.head());

            faces.Add(face);
            face.getEdge(-1).setOpposite(he.getOpposite());
            return(face.getEdge(0));
        }
Esempio n. 2
0
        protected void calculateHorizon(Point3d eyePnt, HalfEdge edge0, Face face, ArrayList horizon)
        {
            //	   oldFaces.add (face);
            deleteFacePoints(face, null);
            face.mark = Face.DELETED;
            if (debug)
            {
                Console.WriteLine("  visiting face " + face.getVertexString());
            }
            HalfEdge edge;

            if (edge0 == null)
            {
                edge0 = face.getEdge(0);
                edge  = edge0;
            }
            else
            {
                edge = edge0.getNext();
            }
            do
            {
                Face oppFace = edge.oppositeFace();
                if (oppFace.mark == Face.VISIBLE)
                {
                    if (oppFace.distanceToPlane(eyePnt) > tolerance)
                    {
                        calculateHorizon(eyePnt, edge.getOpposite(),
                                         oppFace, horizon);
                    }
                    else
                    {
                        horizon.Add(edge);
                        if (debug)
                        {
                            Console.WriteLine("  adding horizon edge " +
                                              edge.getVertexString());
                        }
                    }
                }
                edge = edge.getNext();
            }while (edge != edge0);
        }