diff options
-rw-r--r-- | cmake/kicad_gerber.cmake | 19 | ||||
-rwxr-xr-x | py/kicad_gerber.py | 14 |
2 files changed, 25 insertions, 8 deletions
diff --git a/cmake/kicad_gerber.cmake b/cmake/kicad_gerber.cmake index 327733c..5495e0e 100644 --- a/cmake/kicad_gerber.cmake +++ b/cmake/kicad_gerber.cmake @@ -1,5 +1,5 @@ function(kicad_gerber) - set(options ALL UPPERCASE_EXTENSIONS SHOW_OUTPUTS) + set(options ALL UPPERCASE_EXTENSIONS SHOW_OUTPUTS EXTENDED_GERBER_ATTRIBUTES) set(one_value_args TARGET PCB_FILE DIR ZIP_FILE NAMING_STYLE) set(multi_value_args LAYER_EXTENSION) cmake_parse_arguments(ARGS "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) @@ -44,6 +44,10 @@ function(kicad_gerber) set(uppercase_extensions --uppercase-extensions) endif () + if (ARGS_EXTENDED_GERBER_ATTRIBUTES) + set(extended_gerber_attributes "--extended-gerber-attributes") + endif () + set(out_dir "${ARGS_DIR}") set(prefix "${out_dir}/${basename}") @@ -52,7 +56,10 @@ function(kicad_gerber) --pcb "${pcb_file}" --output-directory "${out_dir}" --detect-files-only ${CMAKE_CURRENT_BINARY_DIR}/${target}-gerber-index.txt - ${protel} ${uppercase_extensions} ${les} + ${protel} + ${uppercase_extensions} + ${extended_gerber_attributes} + ${les} OUTPUT_VARIABLE out ERROR_VARIABLE out RESULT_VARIABLE res) @@ -74,7 +81,13 @@ function(kicad_gerber) add_custom_command( OUTPUT ${outputs} COMMAND cmake -E make_directory "${out_dir}" - COMMAND "${KicadUtilsPyDir}/kicad_gerber.py" --pcb "${pcb_file}" --output-directory "${out_dir}" ${protel} ${uppercase_extensions} ${les} + COMMAND "${KicadUtilsPyDir}/kicad_gerber.py" + --pcb "${pcb_file}" + --output-directory "${out_dir}" + ${protel} + ${uppercase_extensions} + ${extended_gerber_attributes} + ${les} MAIN_DEPENDENCY "${pcb_file}") if (ARGS_ALL) diff --git a/py/kicad_gerber.py b/py/kicad_gerber.py index 173aae1..7da0a59 100755 --- a/py/kicad_gerber.py +++ b/py/kicad_gerber.py @@ -41,6 +41,11 @@ parser.add_argument('--protel-extensions', action='store_true', help='Use Protel filename extensions instead of .gbr') +parser.add_argument('--extended-gerber-attributes', + dest='extended_gerber_attributes', + action='store_true', + help='Use extended Gerber attributes') + parser.add_argument('--uppercase-extensions', action='store_true', help='Uppercase all extensions') @@ -173,17 +178,18 @@ if args.detect_files_only: # Set some important plot options: popt.SetPlotFrameRef(False) -popt.SetLineWidth(FromMM(0.35)) +popt.SetLineWidth(FromMM(0.1)) popt.SetAutoScale(False) popt.SetScale(1) popt.SetMirror(False) -popt.SetUseGerberAttributes(True) +popt.SetUseGerberAttributes(args.extended_gerber_attributes) popt.SetScale(1) -popt.SetUseAuxOrigin(True) +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) @@ -200,8 +206,6 @@ for plan in plot_plan: pctl.PlotLayer() pctl.ClosePlot() -popt.SetDrillMarksType(PCB_PLOT_PARAMS.FULL_DRILL_SHAPE) - drlwriter = EXCELLON_WRITER(board) drlwriter.SetMapFileFormat(PLOT_FORMAT_GERBER) |