GraphicsPath getGraphicsPath(RawDetail det) { GraphicsPath gp = new GraphicsPath(); foreach (var item in det.Outers) { gp.AddPolygon(item.Points.Select(z => Transform(z)).ToArray()); } return(gp); }
public GraphicsPath Draw(RawDetail det, Pen pen = null, Brush brush = null) { var gp = getGraphicsPath(det); if (brush != null) { gr.FillPath(brush, gp); } if (pen != null) { gr.DrawPath(pen, gp); } return(gp); }
//--------------------->Second function points here public void ImportFromRawDetail(RawDetail raw, int src) { NFP po = new NFP(); po.Name = raw.Name;//take name po.Points = new SvgPoint[] { }; //if (raw.Outers.Any()) { var tt = raw.Outers.Union(raw.Holes).OrderByDescending(z => z.Len).First(); foreach (var item in tt.Points) { po.AddPoint(new SvgPoint(item.X, item.Y)); } po.source = src; polygons.Add(po); } }