aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-08-21 12:52:47 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2017-08-21 12:52:47 +0200
commite7594ab06f9402c75f30a0cd55565672ffb2635c (patch)
treee45d1f8b6aab6dffdac43f0b0dda6ffc9c3831d9
parentf265f77c943971000e2a298274d23772cf0d2411 (diff)
downloadkicad-utils-e7594ab06f9402c75f30a0cd55565672ffb2635c.tar.gz
kicad-utils-e7594ab06f9402c75f30a0cd55565672ffb2635c.tar.bz2
kicad-utils-e7594ab06f9402c75f30a0cd55565672ffb2635c.tar.xz
kicad-utils-e7594ab06f9402c75f30a0cd55565672ffb2635c.zip
o Documenting KiCAD's defaults.
o Changing "Minimal header" to default to True instead of False to match KiCAD's defaults.
-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)