示例#1
0
        public PlateCombine GetMinPlateCombine(PlateModel source, float T, string type, float limit = -1)
        {
            RectHelper rect  = new RectHelper();
            CopyOper   co    = new CopyOper();
            PlateModel pm    = co.CopyPlate(source);
            PlateModel pmnew = co.CopyPlate(source);       //旋转180后的图形

            pmnew = Rotate(pmnew, 180);

            List <PointF> pnew  = pmnew.OutModel.ExpandPoint;
            List <PointF> chnew = rect.GetConvexHull(pmnew.OutModel.ExpandPoint);

            List <PointF> p  = pm.OutModel.ExpandPoint;
            List <PointF> ch = rect.GetConvexHull(pm.OutModel.ExpandPoint);

            Dictionary <string, object> diccombine = rect.Combine(p, ch, pnew, chnew, T, limit, type, 0.9f);
            List <PointF> chcombine = (List <PointF>)diccombine["convexhull"];

            Move(pmnew, Convert.ToSingle(diccombine["movex"]), Convert.ToSingle(diccombine["movey"]));
            RotateAndMove(pm, pmnew, Convert.ToSingle(diccombine["angle"]));

            PlateCombine pc = new PlateCombine(pm, pmnew);

            pc.flag = diccombine["flag"].ToString();
            pc.Rect = pm.Rect = pmnew.Rect = GetRect(pm.OutModel.ExpandPoint, pmnew.OutModel.ExpandPoint);
            return(pc);
        }