Skip to content

Commit

Permalink
[DOCs][Updated][PCB Print] New options
Browse files Browse the repository at this point in the history
  • Loading branch information
set-soft committed Jan 7, 2025
1 parent 9b7f1b5 commit 08ce008
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 26 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A mechanism to filter components for a particular layer (#706)
- Workaround for Ghostscript handling %d wrong when followed by an hex digit
(#763)
- Now you can include drill maps using `drill_pairs` as `repeat_layers` (#764)
- Report:
- `top_total`, `bot_total`, `total_smd`, `total_tht` and `total_all`
component counts (See #730)
Expand Down
16 changes: 14 additions & 2 deletions docs/samples/generic_plot.kibot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2882,6 +2882,14 @@ outputs:
# [number=360] [36,1200] Resolution (Dots Per Inch) for the output file. Most objects are vectors, but thing
# like the the solder mask are handled as images by the conversion tools
dpi: 360
# [boolean|dict=false] Use a boolean for simple cases or fine-tune its behavior
drill:
# [boolean=true] By default KiCad groups slots and rounded holes if they can be cut from the same tool (same diameter)
group_slots_and_round_holes: true
# [string='auto'] [yes,no,auto] Choose whether to unify plated and non-plated
# holes in the same table. If 'auto' is chosen, the setting is copied
# from the `excellon` output's `pth_and_npth_single_file`
unify_pth_and_npth: 'auto'
# [string='full'] [none,small,full] What to use to indicate the drill places, can be none, small or full (for real scale)
drill_marks: 'full'
# [string|list(string)='_null'] Name of the filter to exclude components from processing.
Expand Down Expand Up @@ -3005,7 +3013,9 @@ outputs:
repeat_inherit: true
# [list(dict)|list(string)|string='inners'] [all,selected,copper,technical,user,inners,outers,*]
# List of layers to replace `repeat_for_layer`.
# This can be used to generate a page for each copper layer, here you put `copper`
# This can be used to generate a page for each copper layer, here you put `copper`.
# You can also use it to generate pages with drill maps, in this case use `drill_pairs` here.
# Note that in this case the `repeat_for_layer` should be some drawing layer
repeat_layers:
# [string=''] Color used for this layer.
# KiCad 6+: don't forget the alpha channel for layers like the solder mask
Expand Down Expand Up @@ -3040,7 +3050,9 @@ outputs:
# Pattern (%*) and text variables are expanded.
# The %ll is the list of layers included in this page.
# In addition when you use `repeat_for_layer` the following patterns are available:
# %ln layer name, %ls layer suffix and %ld layer description
# %ln layer name, %ls layer suffix and %ld layer description.
# When `repeat_layers` is `drill_pairs`, the following additional patterns are available:
# %lnp layer name pair, %lp layer pair
sheet: 'Assembly'
# [string=''] Color to use for the frame and title block
sheet_reference_color: ''
Expand Down
2 changes: 2 additions & 0 deletions docs/source/Changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ Added
- A mechanism to filter components for a particular layer (#706)
- Workaround for Ghostscript handling %d wrong when followed by an
hex digit (#763)
- Now you can include drill maps using ``drill_pairs`` as
``repeat_layers`` (#764)

- Report:

Expand Down
2 changes: 2 additions & 0 deletions docs/source/configuration/outputs/PCB_PrintOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ PCB_PrintOptions parameters

- ``dpi`` :index:`: <pair: output - pcb_print - options; dpi>` [:ref:`number <number>`] (default: ``360``) (range: 36 to 1200) Resolution (Dots Per Inch) for the output file. Most objects are vectors, but thing
like the the solder mask are handled as images by the conversion tools.
- ``drill`` :index:`: <pair: output - pcb_print - options; drill>` [:ref:`DrillOptions parameters <DrillOptions>`] [:ref:`boolean <boolean>` | :ref:`dict <dict>`] (default: ``false``) Use a boolean for simple cases or fine-tune its behavior.
- ``drill_marks`` :index:`: <pair: output - pcb_print - options; drill_marks>` [:ref:`string <string>`] (default: ``'full'``) (choices: "none", "small", "full") What to use to indicate the drill places, can be none, small or full (for real scale).
- ``exclude_filter`` :index:`: <pair: output - pcb_print - options; exclude_filter>` [:ref:`string <string>` | :ref:`list(string) <list(string)>`] (default: ``'_null'``) Name of the filter to exclude components from processing.
Is a short-cut to use for simple cases where a variant is an overkill. |br|
Expand Down Expand Up @@ -87,4 +88,5 @@ PCB_PrintOptions parameters
.. toctree::
:caption: Used dicts

DrillOptions
PagesOptions
4 changes: 3 additions & 1 deletion docs/source/configuration/outputs/PagesOptions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ PagesOptions parameters
Pattern (%*) and text variables are expanded. |br|
The %ll is the list of layers included in this page. |br|
In addition when you use `repeat_for_layer` the following patterns are available:
%ln layer name, %ls layer suffix and %ld layer description.
%ln layer name, %ls layer suffix and %ld layer description. |br|
When `repeat_layers` is `drill_pairs`, the following additional patterns are available:
%lnp layer name pair, %lp layer pair.
- ``sheet_reference_color`` :index:`: <pair: output - pcb_print - options - pages; sheet_reference_color>` [:ref:`string <string>`] (default: ``''``) Color to use for the frame and title block.
- ``sketch_pad_line_width`` :index:`: <pair: output - pcb_print - options - pages; sketch_pad_line_width>` [:ref:`number <number>`] (default: ``0.1``) Line width for the sketched pads [mm], see `sketch_pads_on_fab_layers` (KiCad 6+)
Note that this value is currently ignored by KiCad (6.0.9).
Expand Down
9 changes: 6 additions & 3 deletions kibot/out_pcb_print.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022-2024 Salvador E. Tropea
# Copyright (c) 2022-2024 Instituto Nacional de Tecnología Industrial
# Copyright (c) 2022-2025 Salvador E. Tropea
# Copyright (c) 2022-2025 Instituto Nacional de Tecnología Industrial
# License: AGPL-3.0
# Project: KiBot (formerly KiPlot)
# Base idea: https://gitlab.com/dennevi/Board2Pdf/ (Released as Public Domain)
# Drill maps contributed by Nguyen Vincent (@nguyen-v)
"""
Dependencies:
- from: RSVG
Expand Down Expand Up @@ -268,7 +269,9 @@ def __init__(self):
self.repeat_layers = LayerOptions
""" [list(dict)|list(string)|string='inners'] [all,selected,copper,technical,user,inners,outers,*]
List of layers to replace `repeat_for_layer`.
This can be used to generate a page for each copper layer, here you put `copper` """
This can be used to generate a page for each copper layer, here you put `copper`.
You can also use it to generate pages with drill maps, in this case use `drill_pairs` here.
Note that in this case the `repeat_for_layer` should be some drawing layer """
self.repeat_inherit = True
""" If we will inherit the options of the layer we are replacing.
Disable it if you specify the options in `repeat_layers`, which is unlikely """
Expand Down
23 changes: 23 additions & 0 deletions tests/GUI/outputs
Original file line number Diff line number Diff line change
Expand Up @@ -8953,6 +8953,29 @@
],
null
],
[
"drill",
[
"DataTypeDict",
"DataTypeBoolean"
],
[
[
"unify_pth_and_npth",
[
"DataTypeChoice"
],
null
],
[
"group_slots_and_round_holes",
[
"DataTypeBoolean"
],
null
]
]
],
[
"drill_marks",
[
Expand Down
41 changes: 21 additions & 20 deletions tests/GUI/stats
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
48 outputs types with a total of 1948 different parameters
Single type parameters: 1772 (91 %)
Multi type parameters: 176 (9 %)
48 outputs types with a total of 1951 different parameters
Single type parameters: 1774 (91 %)
Multi type parameters: 177 (9 %)
Average parameters: 41
Maximum number of parameters: 217
Minimum number of parameters: 14
Expand Down Expand Up @@ -73,7 +73,7 @@ Outputs sorted by parameters:
- pdf: 65
- render_3d: 67
- blender_export: 76
- pcb_print: 94
- pcb_print: 97
- bom: 149
- panelize: 217
Average depth: 2.5833333333333335
Expand Down Expand Up @@ -138,11 +138,11 @@ Outputs sorted by depth:
--------------------------------------------------------------------------------
14 different data types
- String: 854
- Boolean: 479
- Boolean: 481
- Number: 270
- ListStringSingular: 265
- Choice: 99
- Dict: 81
- Choice: 100
- Dict: 82
- ListDictOrString: 23
- ListDict: 20
- Combo: 14
Expand All @@ -154,10 +154,10 @@ Outputs sorted by depth:
--------------------------------------------------------------------------------
Used as single data type:
- String: 698
- Boolean: 423
- Boolean: 424
- ListStringSingular: 262
- Number: 176
- Choice: 96
- Choice: 97
- Dict: 70
- ListDict: 20
- ListString: 9 ['blender_export.options.pcb3d.highlight', 'bom.options.group_fields', 'bom.options.group_fields_fallbacks', 'bom.options.no_conflict', 'kibom.options.conf.group_fields', 'pcbdraw.options.libs', 'pcbdraw.options.highlight', 'render_3d.options.highlight', 'vrml.options.highlight']
Expand All @@ -168,7 +168,7 @@ Used as single data type:
- StringDict: 1 ['download_datasheets.options.classify_extra']
- NumberChoice: 1 ['gerber.options.gerber_precision']
--------------------------------------------------------------------------------
10 different data type combinations
11 different data type combinations
- Number,String: 92
- Boolean,String: 52
- Combo,ListDictOrString: 12
Expand All @@ -178,6 +178,7 @@ Used as single data type:
- Choice,Dict: 2 ['excellon.options.map', 'gerb_drill.options.map']
- Dict,Number: 2 ['pcbdraw.options.margin', 'svg.options.margin']
- Boolean,Choice: 1 ['ibom.options.highlight_pin1']
- Boolean,Dict: 1 ['pcb_print.options.drill']
- String,StringDict: 1 ['pcbdraw.options.remap']
================================================================================
================================================================================
Expand Down Expand Up @@ -392,9 +393,9 @@ Used as single data type:
- Number,String: 15
================================================================================
================================================================================
87 totals types with a total of 2322 different parameters
Single type parameters: 2122 (91 %)
Multi type parameters: 200 (9 %)
87 totals types with a total of 2325 different parameters
Single type parameters: 2124 (91 %)
Multi type parameters: 201 (9 %)
Average parameters: 27
Maximum number of parameters: 217
Minimum number of parameters: 1
Expand Down Expand Up @@ -506,7 +507,7 @@ Totals sorted by parameters:
- pdf: 65
- render_3d: 67
- blender_export: 76
- pcb_print: 94
- pcb_print: 97
- bom: 149
- panelize: 217
Average depth: 2.206896551724138
Expand Down Expand Up @@ -610,11 +611,11 @@ Totals sorted by depth:
--------------------------------------------------------------------------------
14 different data types
- String: 1007
- Boolean: 578
- Boolean: 580
- Number: 320
- ListStringSingular: 294
- Choice: 131
- Dict: 92
- Choice: 132
- Dict: 93
- ListDict: 30
- ListDictOrString: 26
- Combo: 14
Expand All @@ -626,10 +627,10 @@ Totals sorted by depth:
--------------------------------------------------------------------------------
Used as single data type:
- String: 835
- Boolean: 514
- Boolean: 515
- ListStringSingular: 291
- Number: 211
- Choice: 128
- Choice: 129
- Dict: 73
- ListDict: 30
- ListString: 12
Expand All @@ -644,7 +645,7 @@ Used as single data type:
- Number,String: 107
- Boolean,String: 52
- Combo,ListDictOrString: 12
- Boolean,Dict: 8 ['draw_fancy_stackup.draw_fancy_stackup', 'draw_stackup.draw_stackup', 'drc.drc', 'erc.erc', 'include_table.include_table', 'run_drc.run_drc', 'run_erc.run_erc', 'update_xml.update_xml']
- Boolean,Dict: 9 ['pcb_print.options.drill', 'draw_fancy_stackup.draw_fancy_stackup', 'draw_stackup.draw_stackup', 'drc.drc', 'erc.erc', 'include_table.include_table', 'run_drc.run_drc', 'run_erc.run_erc', 'update_xml.update_xml']
- Dict,String: 7 ['blender_export.options.pcb3d', 'excellon.options.report', 'excellon.options.table', 'gerb_drill.options.report', 'gerb_drill.options.table', 'kibom.options.conf', 'pcbdraw.options.style']
- ListDictOrString,String: 5 ['bom.options.columns.join', 'bom.options.cost_extra_columns.join', 'bom.options.xlsx.specs_columns.join', 'panelize.options.configs', 'include_table.include_table.outputs']
- Boolean,ListStringSingular: 3 ['bom.options.html.lcsc_link', 'bom.options.xlsx.lcsc_link', 'kibom.options.conf.lcsc_link']
Expand Down

0 comments on commit 08ce008

Please sign in to comment.