kibot:
  version: 1

global:
  filters:
  - number: 1007
  - number: 1015
  - number: 58
  dir: Generated

filters:
- name: only_jlc_parts
  comment: Only parts with JLC (LCSC) code
  type: generic
  include_only:
  - column: LCSC#
    regex: ^C\d+
- name: fix_rotation
  comment: 'Adjust rotation for JLC'
  type: rot_footprint
  rotations:
    - ["^SOT-23", 0.0]
    # - ["^SK6812", 180.0] # SK6812 is 180deg to WS2812. JLCPCB only has WS2812 in stock. DO NOT uncomment unless you populate with SK6812.
    - ["^Sensirion_DFN-8", -90.0]
    - ["^IC_NT3H2211W0FHKH", 180.0]

variants:
- name: jlcpcb
  comment: 'JLCPCB requires some rotational transforms'
  type: kibom
  variant: jlcpcb
  pre_transform: fix_rotation

outputs:
- name: basic_pdf_sch_print
  comment: Schematic in PDF format
  type: pdf_sch_print
  dir: +/Schematic

- name: JLCPCB_gerbers
  comment: Gerbers compatible with JLCPCB
  type: gerber
  dir: +/Manufacturers/JLCPCB
  options:
    exclude_edge_layer: true
    exclude_pads_from_silkscreen: true
    plot_sheet_reference: false
    plot_footprint_refs: true
    plot_footprint_values: false
    force_plot_invisible_refs_vals: false
    tent_vias: true
    use_protel_extensions: true
    create_gerber_job_file: false
    disable_aperture_macros: true
    gerber_precision: 4.6
    use_gerber_x2_attributes: false
    use_gerber_net_attributes: false
    line_width: 0.1
    subtract_mask_from_silk: true
    inner_extension_pattern: .gp%n
  layers: &id002
  - layer: F.Cu
    suffix: F_Cu
    description: Front copper
  - layer: B.Cu
    suffix: B_Cu
    description: Bottom copper
  - layer: B.Paste
    suffix: B_Paste
    description: Bottom solder paste
  - layer: F.Paste
    suffix: F_Paste
    description: Front solder paste
  - layer: B.Silkscreen
    suffix: B_Silkscreen
    description: Bottom silkscreen (artwork)
  - layer: F.Silkscreen
    suffix: F_Silkscreen
    description: Front silkscreen (artwork)
  - layer: B.Mask
    suffix: B_Mask
    description: Bottom soldermask (negative)
  - layer: F.Mask
    suffix: F_Mask
    description: Front soldermask (negative)
  - layer: Edge.Cuts
    suffix: Edge_Cuts
    description: Board shape
- name: JLCPCB_drill
  comment: Drill files compatible with JLCPCB
  type: excellon
  dir: +/Manufacturers/JLCPCB
  options:
    pth_and_npth_single_file: false
    pth_id: -PTH
    npth_id: -NPTH
    metric_units: true
    map: gerber
    route_mode_for_oval_holes: false
    output: '%f%i.%x'
- name: JLCPCB_position
  comment: Pick and place file, JLCPCB style
  type: position
  dir: +/Manufacturers/JLCPCB
  options:
    variant: jlcpcb
    output: '%f_cpl_jlc.%x'
    format: CSV
    units: millimeters
    separate_files_for_front_and_back: false
    only_smd: true
    columns:
    - id: Ref
      name: Designator
    - Val
    - Package
    - id: PosX
      name: Mid X
    - id: PosY
      name: Mid Y
    - id: Rot
      name: Rotation
    - id: Side
      name: Layer
- name: JLCPCB_bom
  comment: BoM for JLCPCB
  type: bom
  dir: +/Manufacturers/JLCPCB
  options:
    output: '%f_%i_jlc.%x'
    exclude_filter: only_jlc_parts
    ref_separator: ','
    columns:
    - field: Value
      name: Comment
    - field: References
      name: Designator
    - Footprint
    - field: LCSC#
      name: 'LCSC Part #'
    csv:
      hide_pcb_info: true
      hide_stats_info: true
      quote_all: true
- name: JLCPCB
  comment: ZIP file for JLCPCB
  type: compress
  dir: +/Manufacturers
  options:
    files:
    - from_output: JLCPCB_gerbers
      dest: /
    - from_output: JLCPCB_drill
      dest: /
    - from_output: JLCPCB_position
      dest: /
    - from_output: JLCPCB_bom
      dest: /

- name: basic_step
  comment: 3D model in STEP format
  type: step
  dir: +/3D

- name: basic_render_3d_top
  comment: 3D view from top
  type: render_3d
  dir: +/3D
  options:
    zoom: 3
    height: 5000
    width: 5000
    solder_mask: '#101010'
    background1: '#ffffff'
    background2: '#ffffff'
    ray_tracing: true
    orthographic: true
- name: basic_render_3d_bottom
  comment: 3D view from bottom
  type: render_3d
  dir: +/3D
  options:
    zoom: 3
    height: 5000
    width: 5000
    solder_mask: '#101010'
    background1: '#ffffff'
    background2: '#ffffff'
    ray_tracing: true
    orthographic: true
    view: bottom