# Gerber and drill files for P-Ban, without stencil
# URL: https://www.p-ban.com/
# Based on setting used by Gerber Zipper (https://github.com/g200kg/kicad-gerberzipper)
kibot:
  version: 1

outputs:
  - name: P-Ban_gerbers
    comment: Gerbers compatible with P-Ban
    type: gerber
    dir: P-Ban
    options: &gerber_options
      exclude_edge_layer: true
      exclude_pads_from_silkscreen: true
      plot_sheet_reference: false
      plot_footprint_refs: true
      plot_footprint_values: true
      force_plot_invisible_refs_vals: false
      tent_vias: true
      use_protel_extensions: true
      create_gerber_job_file: false
      gerber_precision: 4.6
      use_gerber_x2_attributes: true
      use_gerber_net_attributes: false
      line_width: 0.15
      subtract_mask_from_silk: false
      inner_extension_pattern: '.gp%n'
      custom_reports:
        - output: '製造基準書.txt'
          content: '部品面パターン : ${filename(F.Cu)}\r\n半田面パターン : ${filename(B.Cu)}\r\n内層パターン1 : ${filename(In1.Cu)}\r\n内層パターン2 : ${filename(In2.Cu)}\r\n内層パターン3 : ${filename(In3.Cu)}\r\n内層パターン4 : ${filename(In4.Cu)}\r\n内層パターン5 : ${filename(In5.Cu)}\r\n内層パターン6 : ${filename(In6.Cu)}\r\n部品面レジスト : ${filename(F.Mask)}\r\n半田面レジスト : ${filename(B.Mask)}\r\n部品面シルク : ${filename(F.SilkS)}\r\n半田面シルク : ${filename(B.SilkS)}\r\n基板外形 : ${filename(Edge.Cuts)}\r\n\nドリルデータ : ${basename}.drl\r\nドリルマップ : ${basename}-drl_map.gbr\r\nドリルリスト : ${basename}-drl.rpt\r\n'
    layers:
      # Note: a more generic approach is to use 'copper' but then the filenames
      # are slightly different.
      - F.Cu
      - B.Cu
      - In1.Cu
      - In2.Cu
      - In3.Cu
      - In4.Cu
      - In5.Cu
      - In6.Cu
      - F.SilkS
      - B.SilkS
      - F.Mask
      - B.Mask
      - Edge.Cuts

  - name: P-Ban_drill
    comment: Drill files compatible with P-Ban
    type: excellon
    dir: P-Ban
    options:
      pth_and_npth_single_file: true
      map:
        type: gerber
      report:
        filename: '%f-drl.rpt'
      zeros_format: SUPPRESS_LEADING
      left_digits: 3
      right_digits: 3
      output: "%f.drl"

  - name: P-Ban
    comment: ZIP file for P-Ban
    type: compress
    dir: P-Ban
    options:
      files:
        - from_output: P-Ban_gerbers
          dest: /
        - from_output: P-Ban_drill
          dest: /
