From 7f098579387bb16c775ab28490be2f347b05e51b Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 15 Sep 2016 00:37:46 +0200 Subject: Adding CMake commands: kicad_pcb_plot() that plots the PCB in PDF, PS and SVG formats. kicad_gerber() that generates GERBER files from a PCB. Can optionally create a ZIP file with all the files. Supports old (protel) naming of files. --- py/kicad_pcb_plot.py | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'py/kicad_pcb_plot.py') diff --git a/py/kicad_pcb_plot.py b/py/kicad_pcb_plot.py index ef62cb2..d6f123d 100755 --- a/py/kicad_pcb_plot.py +++ b/py/kicad_pcb_plot.py @@ -53,7 +53,8 @@ PLOT_FORMAT_GERBER import sys from pcbnew import * -filename=sys.argv[1] #e.g left-main/left-main.kicad_pcb + +filename = sys.argv[1] # e.g left-main/left-main.kicad_pcb board = LoadBoard(filename) @@ -64,8 +65,6 @@ popt = pctl.GetPlotOptions() # popt.SetOutputDirectory("plot/") popt.SetOutputDirectory(sys.argv[2]) - - # Set some important plot options: popt.SetPlotFrameRef(False) popt.SetLineWidth(FromMM(0.35)) @@ -102,16 +101,16 @@ pctl.PlotLayer() # param 0 is a string added to the file base name to identify the drawing # param 1 is the layer ID plot_plan = [ - ( "F.Cu", F_Cu, "Front layer" ), - ( "B.Cu", B_Cu, "Bottom layer" ), - ( "F.Paste", F_Paste, "Paste front" ), - ( "B.Paste", B_Paste, "Paste bottom" ), - ( "F.Silk", F_SilkS, "Silk front" ), - ( "B.Silk", B_SilkS, "Silk bottom" ), - ( "F.Mask", F_Mask, "Mask front" ), - ( "B.Mask", B_Mask, "Mask bottom" ), - ( "Edge.Cuts", Edge_Cuts, "Edges" ), - ( "Cmts.User", Cmts_User, "User comments" ), + ("F.Cu", F_Cu, "Front layer"), + ("B.Cu", B_Cu, "Bottom layer"), + ("F.Paste", F_Paste, "Paste front"), + ("B.Paste", B_Paste, "Paste bottom"), + ("F.Silk", F_SilkS, "Silk front"), + ("B.Silk", B_SilkS, "Silk bottom"), + ("F.Mask", F_Mask, "Mask front"), + ("B.Mask", B_Mask, "Mask bottom"), + ("Edge.Cuts", Edge_Cuts, "Edges"), + ("Cmts.User", Cmts_User, "User comments"), ] for layer_info in plot_plan: @@ -180,7 +179,7 @@ pctl.SetLayer(Cmts_User) pctl.PlotLayer() # Bottom mask as lines only, in red -#popt.SetMode(LINE) +# popt.SetMode(LINE) popt.SetColor(RED) pctl.SetLayer(B_Mask) pctl.PlotLayer() @@ -192,7 +191,7 @@ pctl.PlotLayer() # Top paste in light blue, filled popt.SetColor(BLUE) -#popt.SetMode(FILLED) +# popt.SetMode(FILLED) pctl.SetLayer(F_Paste) pctl.PlotLayer() @@ -229,7 +228,7 @@ popt.SetReferenceColor(19) popt.SetValueColor(21) popt.SetColor(0) -#popt.SetMode(LINE) +# popt.SetMode(LINE) pctl.SetLayer(B_SilkS) pctl.PlotLayer() popt.SetColor(14) @@ -258,7 +257,7 @@ pctl.PlotLayer() # better anyway... popt.SetColor(17) -#popt.SetMode(FILLED) +# popt.SetMode(FILLED) popt.SetDrillMarksType(PCB_PLOT_PARAMS.FULL_DRILL_SHAPE) pctl.SetLayer(B_Cu) pctl.PlotLayer() -- cgit v1.2.3