aboutsummaryrefslogtreecommitdiff
path: root/py
diff options
context:
space:
mode:
Diffstat (limited to 'py')
-rwxr-xr-xpy/kicad_gerber.py43
1 files changed, 26 insertions, 17 deletions
diff --git a/py/kicad_gerber.py b/py/kicad_gerber.py
index 7da0a59..c6f6e4b 100755
--- a/py/kicad_gerber.py
+++ b/py/kicad_gerber.py
@@ -115,20 +115,14 @@ except:
pass
pctl.ClosePlot()
-if args.protel_extensions:
- popt.SetUseGerberProtelExtensions(True)
+# "Use protel filename extensions", default=False
+popt.SetUseGerberProtelExtensions(args.protel_extensions)
basename = os.path.splitext(filename)[0]
drlFileOut = drlFile = basename + ".drl"
drlNpthFileOut = drlNpthFile = basename + "-NPTH.drl"
-if args.protel_extensions:
- n, e = os.path.splitext(drlFileOut)
- drlFileOut = n + ".txt"
- n, e = os.path.splitext(drlNpthFileOut)
- drlNpthFileOut = n + ".txt"
-
if args.uppercase_extensions:
n, e = os.path.splitext(drlFileOut)
drlFileOut = n + e.upper()
@@ -159,7 +153,6 @@ for plan in plot_plan:
# if newExt is not None:
# ext = "." + newExt
- # if not args.protel_extensions:
plan.postfix = plan.layerName
plan.filename = basename + "-" + plan.postfix + ext
@@ -171,25 +164,35 @@ if args.detect_files_only:
for plan in plot_plan:
print(plan.filename, file=f)
- if args.protel_extensions:
- print(drlFileOut, file=f)
- print(drlNpthFileOut, file=f)
+ print(drlFileOut, file=f)
+ print(drlNpthFileOut, file=f)
sys.exit(0)
# Set some important plot options:
popt.SetPlotFrameRef(False)
+
+# "Default line width (mm)", default=0.1mm
popt.SetLineWidth(FromMM(0.1))
popt.SetAutoScale(False)
-popt.SetScale(1)
+
+# "Mirrored plot", default=False. Not applicable for Gerber
popt.SetMirror(False)
+
+# "Include extended attributes", default=False
popt.SetUseGerberAttributes(args.extended_gerber_attributes)
+
+# "Drill marks"
+popt.SetDrillMarksType(PCB_PLOT_PARAMS.NO_DRILL_SHAPE)
+
+# "Scaling"
popt.SetScale(1)
+
+# "Use auxilary axis as origin"
popt.SetUseAuxOrigin(False)
# This by gerbers only (also the name is truly horrid!)
popt.SetSubtractMaskFromSilk(False)
-popt.SetDrillMarksType(PCB_PLOT_PARAMS.NO_DRILL_SHAPE)
for plan in plot_plan:
pctl.SetLayer(plan.layerNum)
@@ -209,11 +212,17 @@ for plan in plot_plan:
drlwriter = EXCELLON_WRITER(board)
drlwriter.SetMapFileFormat(PLOT_FORMAT_GERBER)
+# "Drill file options"
+
+# "Mirror y axis", default=False
mirror = False
-minimalHeader = False
+
+# "Minimal header", default=True
+minimalHeader = True
+
offset = wxPoint(0, 0)
-# False to generate 2 separate drill files (one for plated holes, one for non plated holes)
-# True to generate only one drill file
+
+# "Merge PTH and NPTH into one file", default=False
mergeNPTH = False
drlwriter.SetOptions(mirror, minimalHeader, offset, mergeNPTH)