Exemplo n.º 1
0
        private void WriteContained(PolyLine boundary, string outputfilename, ProgressLog log)
        {
            ExcellonFile Out = new ExcellonFile();

            foreach (var T in Tools)
            {
                Out.Tools[T.Key] = new ExcellonTool()
                {
                    ID = T.Value.ID, Radius = T.Value.Radius
                };
                foreach (var d in T.Value.Drills)
                {
                    if (boundary.PointInPoly(new PointD(d.X, d.Y)))
                    {
                        Out.Tools[T.Key].Drills.Add(d);
                    }
                }
                foreach (var d in T.Value.Slots)
                {
                    if (boundary.PointInPoly(d.Start) || boundary.PointInPoly(d.End))
                    {
                        Out.Tools[T.Key].Slots.Add(d);
                    }
                }
            }

            Out.Write(outputfilename, 0, 0, 0, 0);
        }