Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature][Drill Map Drawing/Table] Generate drill drawings in PCB Print #755

Closed
wants to merge 6 commits into from

Conversation

nguyen-v
Copy link

@nguyen-v nguyen-v commented Dec 31, 2024

This PR addresses #733.
It adds the following:

  • CSV drill table output to excellon output
outputs:
- name: csv_drill_table
  type: excellon
  options:
    generate_drill_files: false
    table:
      pth_and_npth_single_file: @PTH_NPTH@
      group_slots_and_round_holes: @GROUP_ROUND_SLOTS@
  • Fixes a few issues with Include Table when setting has_header: false which was not working correctly before
  • Include Table now also in PCB Print
  • Mechanism to add a drill table and drill map drawing to the PCB Print using repeat_layers and setting the CSV as a drill table with a flag. Also new text expansions (%lp, %lpn) available. When using repeat_layers: 'drill_pairs', it will create as many pages as there are drill layer pairs (taking into account separation of PTH/NPTH). The drill table group has to be placed on the same layer as the repeat_layers layer.
outputs:
- name: pdf_fabrication
  type: pcb_print
  options:
    colored_pads: false
    colored_vias: false
    output: '%f-fabrication%I%v.%x'
    format: 'PDF'
    realistic_solder_mask: false
    dnf_filter: _kibom_dnf_Config
    frame_plot_mechanism: 'internal' 
    drill:
      pth_and_npth_single_file: @PTH_NPTH@
      group_slots_and_round_holes: @GROUP_ROUND_SLOTS@
    include_table:
      outputs:
        - name: 'csv_drill_table'
          is_drill: true

    pages:
      - scaling: @SCALING@
        sheet: 'Drill Drawing %lp'
        layer_var: 'Drill Drawing %lp (Scale @SCALING@:1)'
        sheet_reference_color: '#000000'
        colored_holes: true
        holes_color: "#FFFFFF"
        repeat_for_layer: '@LAYER_DRILL_MAP@'
        repeat_layers: 'drill_pairs'
        layers:
          - layer: '@LAYER_DRILL_MAP@'
            color: '#000000'

Example of what it can output:
image

@nguyen-v
Copy link
Author

nguyen-v commented Jan 1, 2025

I seem to encounter some segmentation faults for some reason with two pdf pcb print in succession, will investigate

@nguyen-v
Copy link
Author

nguyen-v commented Jan 1, 2025

Also with the current behavior, the PCB is modified by PCB Print (to save the tables in the PCB). I also needed to add a save just after restoring the image groups (otherwise it would be saved in a state where the image groups are still on the work layer as it is being saved after include table). I think this is fine, but maybe we should add a flag for it? It also looks like it's making one of the tests fail

@set-soft
Copy link
Member

set-soft commented Jan 2, 2025

Hi @nguyen-v !
Lets separate the features in individual PRs. And also add some test cases, otherwise is too hard to review and debug.

@nguyen-v
Copy link
Author

nguyen-v commented Jan 2, 2025

Hi @nguyen-v ! Lets separate the features in individual PRs. And also add some test cases, otherwise is too hard to review and debug.

Got it!

@nguyen-v nguyen-v closed this Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants