From eb911f35d1ced65d7c30cec65fd574cac65ccf60 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 28 Dec 2022 13:26:15 -0300 Subject: [PATCH] [PCB_Print][Added] Support for sketch_pads_on_fab_layers Closes #356 --- CHANGELOG.md | 2 +- README.md | 24 +++++++++++++++++------- docs/samples/generic_plot.kibot.yaml | 23 +++++++++++++++++------ kibot/out_any_layer.py | 3 ++- kibot/out_pcb_print.py | 9 +++++++++ tests/yaml_samples/pcb_print.kibot.yaml | 2 ++ 6 files changed, 48 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d8a28bf..f1a67949 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `vrml` export the 3D model in Virtual Reality Modeling Language (#349) - iBoM: - `hide_excluded` to hide excluded *.Fab drawings. -- Plot related outputs: +- Plot related outputs and PCB_Print: - Added support for the KiCad 6 "sketch_pads_on_fab_layers" option. (#356) ### Fixed - PCB_Print: diff --git a/README.md b/README.md index 46f0bb4e..064130af 100644 --- a/README.md +++ b/README.md @@ -1913,7 +1913,8 @@ Notes: You must disable it to get the dimensions (See https://gitlab.com/kicad/code/kicad/-/issues/11901). - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. - - `sketch_pad_line_width`: [number=0.1] Line width for the sketched pads [mm] (KiCad 6+). + - `sketch_pad_line_width`: [number=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). - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `sketch_plot`: [boolean=false] Don't fill objects, just draw the outline. - `tent_vias`: [boolean=true] Cover the vias. @@ -2092,7 +2093,8 @@ Notes: - `plot_footprint_values`: [boolean=true] Include the footprint values. - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. - - `sketch_pad_line_width`: [number=0.1] Line width for the sketched pads [mm] (KiCad 6+). + - `sketch_pad_line_width`: [number=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). - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `tent_vias`: [boolean=true] Cover the vias. - `uppercase_extensions`: [boolean=false] Use uppercase names for the extensions. @@ -2157,7 +2159,8 @@ Notes: - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. - `scaling`: [number=0] Scale factor (0 means autoscaling). - - `sketch_pad_line_width`: [number=0.1] Line width for the sketched pads [mm] (KiCad 6+). + - `sketch_pad_line_width`: [number=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). - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `sketch_plot`: [boolean=false] Don't fill objects, just draw the outline. - `tent_vias`: [boolean=true] Cover the vias. @@ -2953,6 +2956,9 @@ Notes: - `page_id`: [string='%02d'] Text to differentiate the pages. Use %d (like in C) to get the page number. - `sheet`: [string='Assembly'] Text to use for the `sheet` in the title block. - `sheet_reference_color`: [string=''] Color to use for the frame and title block. + - `sketch_pad_line_width`: [number=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). + - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `tent_vias`: [boolean=true] Cover the vias. - `title`: [string=''] Text used to replace the sheet title. %VALUE expansions are allowed. If it starts with `+` the text is concatenated. @@ -3196,7 +3202,8 @@ Notes: - `plot_footprint_values`: [boolean=true] Include the footprint values. - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. - - `sketch_pad_line_width`: [number=0.1] Line width for the sketched pads [mm] (KiCad 6+). + - `sketch_pad_line_width`: [number=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). - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `tent_vias`: [boolean=true] Cover the vias. - `uppercase_extensions`: [boolean=false] Use uppercase names for the extensions. @@ -3237,7 +3244,8 @@ Notes: - `priority`: [number=50] [0,100] Priority for this output. High priority outputs are created first. Internally we use 10 for low priority, 90 for high priority and 50 for most outputs. - `run_by_default`: [boolean=true] When enabled this output will be created when no specific outputs are requested. - - `sketch_pad_line_width`: [number=0.1] Line width for the sketched pads [mm] (KiCad 6+). + - `sketch_pad_line_width`: [number=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). - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `tent_vias`: [boolean=true] Cover the vias. - `uppercase_extensions`: [boolean=false] Use uppercase names for the extensions. @@ -3497,7 +3505,8 @@ Notes: A short-cut to use for simple cases where a variant is an overkill. - `scale_adjust_x`: [number=1.0] Fine grain adjust for the X scale (floating point multiplier). - `scale_adjust_y`: [number=1.0] Fine grain adjust for the Y scale (floating point multiplier). - - `sketch_pad_line_width`: [number=0.1] Line width for the sketched pads [mm] (KiCad 6+). + - `sketch_pad_line_width`: [number=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). - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `sketch_plot`: [boolean=false] Don't fill objects, just draw the outline. - `tent_vias`: [boolean=true] Cover the vias. @@ -3896,7 +3905,8 @@ Notes: - `plot_footprint_values`: [boolean=true] Include the footprint values. - `pre_transform`: [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. A short-cut to use for simple cases where a variant is an overkill. - - `sketch_pad_line_width`: [number=0.1] Line width for the sketched pads [mm] (KiCad 6+). + - `sketch_pad_line_width`: [number=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). - `sketch_pads_on_fab_layers`: [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+). - `svg_precision`: [number=4] [0,6] Scale factor used to represent 1 mm in the SVG (KiCad 6). The value is how much zeros has the multiplier (1 mm = 10 power `svg_precision` units). diff --git a/docs/samples/generic_plot.kibot.yaml b/docs/samples/generic_plot.kibot.yaml index 229fcad6..ef7e89b4 100644 --- a/docs/samples/generic_plot.kibot.yaml +++ b/docs/samples/generic_plot.kibot.yaml @@ -653,7 +653,8 @@ outputs: # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. # A short-cut to use for simple cases where a variant is an overkill pre_transform: '_none' - # [number=0.1] Line width for the sketched pads [mm] (KiCad 6+) + # [number=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) sketch_pad_line_width: 0.1 # [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+) sketch_pads_on_fab_layers: false @@ -816,7 +817,8 @@ outputs: # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. # A short-cut to use for simple cases where a variant is an overkill pre_transform: '_none' - # [number=0.1] Line width for the sketched pads [mm] (KiCad 6+) + # [number=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) sketch_pad_line_width: 0.1 # [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+) sketch_pads_on_fab_layers: false @@ -894,7 +896,8 @@ outputs: pre_transform: '_none' # [number=0] Scale factor (0 means autoscaling) scaling: 0 - # [number=0.1] Line width for the sketched pads [mm] (KiCad 6+) + # [number=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) sketch_pad_line_width: 0.1 # [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+) sketch_pads_on_fab_layers: false @@ -1896,6 +1899,11 @@ outputs: sheet: 'Assembly' # [string=''] Color to use for the frame and title block sheet_reference_color: '' + # [number=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) + sketch_pad_line_width: 0.1 + # [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+) + sketch_pads_on_fab_layers: false # [boolean=false] Try to sort the layers in the same order that uses KiCad for printing sort_layers: false # [boolean=true] Cover the vias @@ -2139,7 +2147,8 @@ outputs: # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. # A short-cut to use for simple cases where a variant is an overkill pre_transform: '_none' - # [number=0.1] Line width for the sketched pads [mm] (KiCad 6+) + # [number=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) sketch_pad_line_width: 0.1 # [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+) sketch_pads_on_fab_layers: false @@ -2385,7 +2394,8 @@ outputs: scale_adjust_y: 1.0 # [number=1] Scale factor (0 means autoscaling) scaling: 1 - # [number=0.1] Line width for the sketched pads [mm] (KiCad 6+) + # [number=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) sketch_pad_line_width: 0.1 # [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+) sketch_pads_on_fab_layers: false @@ -2789,7 +2799,8 @@ outputs: # [string|list(string)='_none'] Name of the filter to transform fields before applying other filters. # A short-cut to use for simple cases where a variant is an overkill pre_transform: '_none' - # [number=0.1] Line width for the sketched pads [mm] (KiCad 6+) + # [number=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) sketch_pad_line_width: 0.1 # [boolean=false] Draw only the outline of the pads on the *.Fab layers (KiCad 6+) sketch_pads_on_fab_layers: false diff --git a/kibot/out_any_layer.py b/kibot/out_any_layer.py index 7152eaf3..93199ac7 100644 --- a/kibot/out_any_layer.py +++ b/kibot/out_any_layer.py @@ -78,7 +78,8 @@ class AnyLayerOptions(VariantOptions): self.sketch_pads_on_fab_layers = False """ Draw only the outline of the pads on the *.Fab layers (KiCad 6+) """ self.sketch_pad_line_width = 0.1 - """ Line width for the sketched pads [mm], see `sketch_pads_on_fab_layers` (KiCad 6+) """ + """ 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) """ super().__init__() def config(self, parent): diff --git a/kibot/out_pcb_print.py b/kibot/out_pcb_print.py index 674cf9d7..42984773 100644 --- a/kibot/out_pcb_print.py +++ b/kibot/out_pcb_print.py @@ -197,6 +197,11 @@ class PagesOptions(Optionable): You can reuse other layers lists, some options aren't used here, but they are valid """ self.page_id = '%02d' """ Text to differentiate the pages. Use %d (like in C) to get the page number """ + self.sketch_pads_on_fab_layers = False + """ Draw only the outline of the pads on the *.Fab layers (KiCad 6+) """ + self.sketch_pad_line_width = 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) """ self._scaling_example = 1.0 self._autoscale_margin_x_example = 0 self._autoscale_margin_y_example = 0 @@ -219,6 +224,7 @@ class PagesOptions(Optionable): self.autoscale_margin_x = parent.autoscale_margin_x if self.autoscale_margin_y is None: self.autoscale_margin_y = parent.autoscale_margin_y + self.sketch_pad_line_width = GS.from_mm(self.sketch_pad_line_width) class PCB_PrintOptions(VariantOptions): @@ -1066,6 +1072,9 @@ class PCB_PrintOptions(VariantOptions): if GS.ki5: po.SetLineWidth(FromMM(p.line_width)) po.SetPlotPadsOnSilkLayer(not p.exclude_pads_from_silkscreen) + else: + po.SetSketchPadsOnFabLayers(p.sketch_pads_on_fab_layers) + po.SetSketchPadLineWidth(p.sketch_pad_line_width) filelist = [] if self.force_edge_cuts and next(filter(lambda x: x._id == edge_id, p.layers), None) is None: p.layers.append(edge_layer) diff --git a/tests/yaml_samples/pcb_print.kibot.yaml b/tests/yaml_samples/pcb_print.kibot.yaml index 042ad6a2..6e41057f 100644 --- a/tests/yaml_samples/pcb_print.kibot.yaml +++ b/tests/yaml_samples/pcb_print.kibot.yaml @@ -31,6 +31,8 @@ outputs: sheet_reference_color: "#A02020" # black_holes: false # holes_color: "#8080FF" + sketch_pads_on_fab_layers: true + sketch_pad_line_width: 1 layers: - layer: Edge.Cuts - layer: F.Cu