Exemple #1
0
        public List <Vector2> HullPointsInOrder()
        {
            List <Edge> hullEdges = HullEdges();

            List <Vector2> points = new List <Vector2>();

            if (hullEdges.Count == 0)
            {
                return(points);
            }

            EdgeReorderer reorderer = new EdgeReorderer(hullEdges, typeof(Site));

            hullEdges = reorderer.Edges;
            List <LR> orientations = reorderer.EdgeOrientations;

            reorderer.Dispose();

            LR orientation;

            for (int i = 0; i < hullEdges.Count; i++)
            {
                Edge edge = hullEdges[i];
                orientation = orientations[i];
                points.Add(edge.Site(orientation).Coord);
            }
            return(points);
        }
Exemple #2
0
        private Site RightRegion(Halfedge he, Site bottomMostSite)
        {
            Edge edge = he.edge;

            if (edge == null)
            {
                return(bottomMostSite);
            }
            return(edge.Site(LR.Other(he.leftRight)));
        }
Exemple #3
0
        private Site LeftRegion(Halfedge he, Site bottomMostSite)
        {
            Edge edge = he.Edge;

            if (edge == null)
            {
                return(bottomMostSite);
            }
            return(edge.Site(he.LeftRight));
        }