示例#1
0
        public List <Point> HullPointsInOrder()
        {
            List <Edge>  hullEdges = HullEdges();
            List <Point> points    = new List <Point>();

            if (hullEdges.Count < 1)
            {
                return(points);
            }

            EdgeReorderer re = new EdgeReorderer(hullEdges, "s");

            hullEdges = re.GetEdges();
            List <Orientation> orientations = re.GetEdgeOrientations();

            re.Dispose();

            Orientation orient;

            int n = hullEdges.Count;

            for (int i = 0; i < n; ++i)
            {
                Edge e = hullEdges[i];
                orient = orientations[i];
                points.Add(e.Site(orient).coord);
            }

            return(points);
        }
示例#2
0
        Site RightRegion(HalfEdge hE, Site lowestSite)
        {
            Edge e = hE.e;

            if (e == null)
            {
                return(lowestSite);
            }

            return(e.Site(Orientation.Other(hE.orientation)));
        }
示例#3
0
        Site LeftRegion(HalfEdge hE, Site lowestSite)
        {
            Edge e = hE.e;

            if (e == null)
            {
                return(lowestSite);
            }

            return(e.Site(hE.orientation));
        }