public void Fiducial(PointD pos, double copperdiameter = 1.0, double maskdiameter = 2.0, BoardSide fiducialSide = BoardSide.Top, FiducialStyle style = FiducialStyle.Square) { var coppers = GetGAW(fiducialSide, BoardLayer.Copper); var mask = GetGAW(fiducialSide, BoardLayer.SolderMask); var silk = GetGAW(fiducialSide, BoardLayer.Silk); Fiducials.Add(new FiducialPlacement() { Pos = pos, Style = style, Side = fiducialSide }); switch (style) { case FiducialStyle.Round: { PolyLine Circle = new PolyLine(); Circle.MakeCircle((maskdiameter + 1) / 2, 20, pos.X, pos.Y); foreach (var c in coppers) { c.AddFlash(pos, copperdiameter / 2.0); } foreach (var sm in mask) { sm.AddFlash(pos, maskdiameter / 2.0); } foreach (var s in silk) { s.AddPolyLine(Circle, 0.1); } } break; case FiducialStyle.Square: { PolyLine SmallSquare = new PolyLine(); SmallSquare.MakeRectangle(copperdiameter, copperdiameter, pos.X, pos.Y); PolyLine BiggerSquare = new PolyLine(); BiggerSquare.MakeRectangle(maskdiameter, maskdiameter, pos.X, pos.Y); PolyLine BiggestSquare = new PolyLine(); BiggestSquare.MakeRectangle(maskdiameter + 1, maskdiameter + 1, pos.X, pos.Y); foreach (var c in coppers) { c.AddPolygon(SmallSquare); } foreach (var sm in mask) { sm.AddPolygon(BiggerSquare); } foreach (var s in silk) { s.AddPolyLine(BiggestSquare, 0.1); } } break; } }
public void CreateBoxOutline() { PolyLine Box = new PolyLine( PolyLine.PolyIDs.Outline); Box.MakeRectangle(BoundingBox.Width(), BoundingBox.Height()); Box.Translate(BoundingBox.TopLeft.X + BoundingBox.Width() / 2.0, BoundingBox.TopLeft.Y + BoundingBox.Height() / 2.0); Box.Hole = false; //Box.Close(); // Box.Vertices.Reverse(); ParsedGerber PLS = new ParsedGerber(); PLS.Name = "Generated BoundingBox"; PLS.DisplayShapes.Add(Box); PLS.OutlineShapes.Add(Box); PLS.Shapes.Add(Box); PLS.Layer = BoardLayer.Outline; PLS.Side = BoardSide.Both; // PLS.FixPolygonWindings(); PLS.CalcPathBounds(); PLSs.Add(PLS); }
public void CellularArt() { Bounds B = Outline.GetBounds(); for (int y = 0; y < B.Height(); y += 1) { for (int x = 0; x < B.Width(); x += 1) { if (InArt(x + B.TopLeft.X + 0.5, y + B.TopLeft.Y + 0.5, 0.5)) { if (((x + y) % 2) == 0) { PolyLine P = new PolyLine(); P.MakeRectangle(0.7, 0.7, x + B.TopLeft.X + 0.5, y + B.TopLeft.Y + 0.5); TopSilk.AddPolygon(P); } } } } }