[Layers][Added] Mechanism to specify inner/outer copper layers

This commit is contained in:
Salvador E. Tropea 2024-01-15 10:29:30 -03:00
parent ea0518f47c
commit b78c659141
19 changed files with 44 additions and 18 deletions

View File

@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- General:
- Operations that copies the project now also copies the PRL and the DRU
- Files named *.kibot.yml are also detected as configuration files
- Mechanism to specify
- All inner layers (inners)
- All external copper layers (outers)
- Command line:
- `--help-list-offsets` to list footprint offsets (JLCPCB)
- `--help-list-rotations` to list footprint rotations (JLCPCB)

View File

@ -250,6 +250,8 @@ You can also use any of the following grup of layers:
paste, adhesive, etc.)
- **user** all the user layers (draw, comments, eco, margin, edge cuts,
etc.)
- **inners** all the inner copper layers
- **outers** all the outer copper layers
You can also mix the above definitions using a list:

View File

@ -18,7 +18,7 @@ Parameters:
- **comment** :index:`: <pair: output - diff; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - diff; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - diff; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - diff; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to use. When empty all available layers are used.
Note that if you want to support adding/removing layers you should specify a list here.

View File

@ -19,7 +19,7 @@ Parameters:
- **comment** :index:`: <pair: output - dxf; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - dxf; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - dxf; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - dxf; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to plot.
- Valid keys:

View File

@ -19,7 +19,7 @@ Parameters:
- **comment** :index:`: <pair: output - gerber; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - gerber; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - gerber; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - gerber; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to plot.
- Valid keys:

View File

@ -19,7 +19,7 @@ Parameters:
- **comment** :index:`: <pair: output - hpgl; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - hpgl; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - hpgl; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - hpgl; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to plot.
- Valid keys:

View File

@ -19,7 +19,7 @@ Parameters:
- **comment** :index:`: <pair: output - kiri; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - kiri; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - kiri; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - kiri; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to use. When empty all available layers are used.
Note that if you want to support adding/removing layers you should specify a list here.

View File

@ -21,7 +21,7 @@ Parameters:
- **comment** :index:`: <pair: output - pdf; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - pdf; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - pdf; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - pdf; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to plot.
- Valid keys:

View File

@ -21,7 +21,7 @@ Parameters:
- **comment** :index:`: <pair: output - pdf_pcb_print; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - pdf_pcb_print; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - pdf_pcb_print; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - pdf_pcb_print; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to include in the PDF.
- Valid keys:

View File

@ -20,7 +20,7 @@ Parameters:
- **comment** :index:`: <pair: output - ps; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - ps; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - ps; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - ps; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to plot.
- Valid keys:

View File

@ -21,7 +21,7 @@ Parameters:
- **comment** :index:`: <pair: output - svg; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - svg; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - svg; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - svg; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to plot.
- Valid keys:

View File

@ -20,7 +20,7 @@ Parameters:
- **comment** :index:`: <pair: output - svg_pcb_print; comment>` [string=''] A comment for documentation purposes. It helps to identify the output.
- **dir** :index:`: <pair: output - svg_pcb_print; dir>` [string='./'] Output directory for the generated files.
If it starts with `+` the rest is concatenated to the default dir.
- **layers** :index:`: <pair: output - svg_pcb_print; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user]
- **layers** :index:`: <pair: output - svg_pcb_print; layers>` [list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to include in the PDF.
- Valid keys:

View File

@ -234,6 +234,10 @@ class Layer(Optionable):
ext = cls._get_layers(Layer._plot_layers)
elif layer == 'copper':
ext = cls._get_layers(Layer._get_copper())
elif layer == 'inners':
ext = cls._get_layers(Layer._get_inners())
elif layer == 'outers':
ext = cls._get_layers(Layer._get_outers())
elif layer == 'technical':
ext = cls._get_layers(Layer._get_technical())
elif layer == 'user':
@ -255,6 +259,16 @@ class Layer(Optionable):
def _get_copper():
return {GS.board.GetLayerName(id): id for id in GS.board.GetEnabledLayers().CuStack()}
@staticmethod
def _get_inners():
return {GS.board.GetLayerName(id): id for id in GS.board.GetEnabledLayers().CuStack()
if id != pcbnew.B_Cu and id != pcbnew.F_Cu}
@staticmethod
def _get_outers():
return {GS.board.GetLayerName(id): id for id in GS.board.GetEnabledLayers().CuStack()
if id == pcbnew.B_Cu or id == pcbnew.F_Cu}
@staticmethod
def _get_technical():
return {GS.board.GetLayerName(id): id for id in GS.board.GetEnabledLayers().Technicals()}

View File

@ -298,7 +298,7 @@ class AnyLayer(BaseOutput):
super().__init__()
with document:
self.layers = Layer
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to plot """
def config(self, parent):

View File

@ -561,7 +561,7 @@ class Diff(BaseOutput): # noqa: F821
self.options = DiffOptions
""" *[dict] Options for the `diff` output """
self.layers = Layer
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to use. When empty all available layers are used.
Note that if you want to support adding/removing layers you should specify a list here """

View File

@ -342,7 +342,7 @@ class KiRi(BaseOutput): # noqa: F821
self.options = KiRiOptions
""" *[dict] Options for the `diff` output """
self.layers = Layer
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to use. When empty all available layers are used.
Note that if you want to support adding/removing layers you should specify a list here """

View File

@ -44,7 +44,7 @@ class PDF_PCB_Print(BaseOutput): # noqa: F821
self.options = PDF_PCB_PrintOptions
""" *[dict] Options for the `pdf_pcb_print` output """
self.layers = Layer
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to include in the PDF """
self._category = 'PCB/docs'

View File

@ -60,7 +60,7 @@ class SVG_PCB_Print(BaseOutput): # noqa: F821
self.options = SVG_PCB_PrintOptions
""" *[dict] Options for the `pdf_pcb_print` output """
self.layers = Layer
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user]
""" *[list(dict)|list(string)|string] [all,selected,copper,technical,user,inners,outers]
List of PCB layers to include in the PDF """
self._category = 'PCB/docs'

View File

@ -13,10 +13,8 @@ outputs:
pages:
- scaling: 2.0
sheet: '%ln'
sketch_pads_on_fab_layers: true
sketch_pad_line_width: 1
repeat_for_layer: 'F.Cu'
repeat_layers: copper
repeat_layers: outers
layers:
- layer: Edge.Cuts
- layer: F.Cu
@ -28,3 +26,12 @@ outputs:
plot_footprint_refs: false
plot_footprint_values: false
- layer: Dwgs.User
- scaling: 2.0
sheet: '%ln'
repeat_for_layer: 'F.Cu'
repeat_layers: inners
layers:
- layer: Edge.Cuts
- layer: F.Cu
- layer: F.SilkS
- layer: Dwgs.User