private static PcbGraphics PolylineHelper(PcbUnits coordinateUnits,Piece item) { PcbGraphicsLayer l = PcbGraphicsLayer.TopSilk; PcbLineType t = PcbLineType.Solid; if (Piece.GraphicsLayerMapping.ContainsKey(item.CurrentLayer)) { l = Piece.GraphicsLayerMapping[item.CurrentLayer]; } else { WarningListener.AddFormat(new NotImplementedException(), "Default graphics layer used instead of #{0}",item.CurrentLayer); } if (Piece.LineTypeMapping.ContainsKey(item.CurrentLineType)) { t = Piece.LineTypeMapping[item.CurrentLineType]; } else { WarningListener.AddFormat(new NotImplementedException(), "Default line type used instead of {0}",Enum.GetName(typeof(Piece.LineType),item.CurrentLineType)); } PcbGraphics g = new PcbGraphics(coordinateUnits,coordinateUnits,l,item.XY.Count - 1); for (int i = 1; i < item.XY.Count; i++) { g.Lines.Add(new PcbSilkLine(item.XY[i - 1],item.XY[i],coordinateUnits,coordinateUnits,item.Width,t)); } return(g); }
public PcbSilkLine(Point start, Point end, PcbUnits units, PcbUnits coordinateUnits, double thickness, PcbLineType type = PcbLineType.Solid) { Start = start; End = end; Units = units; CoordinateUnits = coordinateUnits; Thickness = thickness; Type = type; }