コード例 #1
0
 public void ProcessSlabs()
 {
     //for (int i = 0; i < Slabs.Count; i++)
     //    Slabs[i] = Slabs[i].Select(p => new MWPoint2D(p.X * pictureScale, p.Y * pictureScale)).ToList();
     Slabs = PicSlabs.Select(s => new Slab()
     {
         RawPoints = s.Select(p => new MWPoint2D(p.X, p.Y)).ToList()
     }).ToList();
 }
コード例 #2
0
        public double GetPicLongestEdge()
        {
            List <List <MWPoint2D> > slabsClosed = PicSlabs.Select(s => s.Append(s[0]).ToList()).ToList();
            double max = 0;

            for (int i = 0; i < slabsClosed.Count; i++)
            {
                for (int j = 0; j < slabsClosed[i].Count - 1; j++)
                {
                    double dist = Points.Distance(slabsClosed[i][j], slabsClosed[i][j + 1]);
                    max = dist > max ? dist : max;
                }
            }
            return(max);
        }
コード例 #3
0
 private MWPoint2D GetBarycenter()
 {
     return(MWGeometry.Points.GetBarycenter(PicSlabs.SelectMany(s => s.Select(p => new MWPoint2D(p.X, p.Y)).ToList()).ToList()));
 }