INTI-CMNB / KiBot

KiCad automation utility
GNU Affero General Public License v3.0
550 stars 65 forks source link

[BUG] Some layers cannot be pdf printed by itself when scaling and the board edge isn't printed #533

Open oliv3r opened 9 months ago

oliv3r commented 9 months ago

Using the kicad full 7 docker image, rendering a PDF with just the silk screen, results in white output. Adding any other layer 'fixes' this. The bottom silkscreen does not suffer from this problem.

breakout_hdmi-assembly.pdf

kibot:
  version: 1

global:
  environment:
    models_3d: '${KIPRJMOD}/packages3D'
  filters:
    - number: 9
      regex: 'KiCad config without environment.vars section'

preflight:
  run_drc: false
  run_erc: false
  set_text_variables:
    - name: 'VCS_PCB_DATE'
      command: 'date -d @$(git log -1 --format="%at" "${KIBOT_PCB_NAME}") -Idate'
    - name: 'VCS_PCB_TIMEDATE'
      command: 'date -d @$(git log -1 --format="%at" "${KIBOT_PCB_NAME}") -Iseconds'
    - name: 'VCS_PCB_HASH'
      command: 'git log -1 --format="%H" "${KIBOT_PCB_NAME}"'
      before: 'Git <'
      after: '>'
    - name: 'VCS_SCH_TIMEDATE'
      command: 'date -d @$(git log -1 --format="%at" "${KIBOT_SCH_NAME}") -Iseconds'
    - name: 'VCS_SCH_HASH'
      command: 'git log -1 --format="%H" "${KIBOT_SCH_NAME}"'
      before: 'Git <'
      after: '>'
    - name: 'VCS_TAG'
      command: '${CI_COMMIT_REF_NAME:-git describe --always --dirty}'
# restore_project: true

outputs:
  - name: 'pdf_sch_print'
    comment: 'Exports the schematic to the most common exchange format. Suitable for printing.'
    type: 'pdf_sch_print'
    dir: 'output/pdf'
    options:
      all_pages: true
      background_color: false
      frame: true
      monochrome: false
  - name: 'pdf_pcb_print'
    comment: 'Exports the PCB to the most common exchange format. Suitable for printing.'
    type: 'pcb_print'
    dir: 'output/pdf'
    options:
      force_edge_cuts: true
      keep_temporal_files: false
      sheet_reference_layout: '../git.kicad_wks'
      scaling: 1.5
      pages:
        - layers:
          - layer: 'F.Paste'
          - layer: 'F.Adhes'
          - layer: 'User.Comments'
          - layer: 'F.Fab'
          sheet: 'Fabrication layers'
        - layers:
          - layer: 'F.Cu'
          - layer: 'F.Mask'
            color: '#14332440'
          - layer: 'F.SilkS'
            color: '#f2eda1ff'
          - layer: 'User.Comments'
          sheet: 'Top layer'
        - layers:
          - layer: 'F.SilkS'
            color: '#00000000'
          - layer: 'User.Comments'
          sheet: 'Top silkscreen'
        - layers:
          - layer: 'F.Cu'
            color: '#c83434ff'
          - layer: 'User.Comments'
          sheet: 'Top copper'
        - layers:
          - layer: 'In1.Cu'
            color: '#7fc87fff'
          - layer: 'User.Comments'
          sheet: 'Inner1 copper'
        - layers:
          - layer: 'In2.Cu'
            color: '#ce7d2cff'
          - layer: 'User.Comments'
          sheet: 'Inner2 copper'
        - layers:
          - layer: 'B.Cu'
            color: '#4d7fc4ff'
          - layer: 'User.Comments'
          sheet: 'Bottom copper'
        - layers:
          - layer: 'B.SilkS'
            color: '#00000000'
          - layer: 'User.Comments'
          sheet: 'Bottom silkscreen'
          mirror: true
        - layers:
          - layer: 'B.Cu'
          - layer: 'B.Mask'
            color: '#14332440'
          - layer: 'B.SilkS'
            color: '#e8b2a7ff'
          - layer: 'User.Comments'
          sheet: 'Bottom layer'
          mirror: true

is my kibot yaml file.

set-soft commented 9 months ago

This is the KiCad issue I mentioned in #532

Note that KiBot from dev will work with the above configuration because you are forcing the PCB edge. But if you disable it you'll see the first page is empty. If you keep the temporals you'll see KiCad printed the important things outside the page.

One possible workaround is to always make the board edge visible, but this shouldn't be a solution.

set-soft commented 8 months ago

Ok, I filled a KiCad bug report lets see what the maintainers think about it. The .Cu, .SilkS and Edge.Cuts layers seems to work as expected, but the .Fab, .Paste, *.Adhes and user layers are scaled, but not centered. This moves the drawings outside the page for small boards, so you get an empty page.

set-soft commented 5 months ago

Update: This bug is also present on KiCad 8.0.1 and the developers didn't even decide its priority.