From 37f8a7067c517fd2644b5291bc0a974e6387efe0 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 15 Nov 2023 12:47:33 -0300 Subject: [PATCH] [Position][Added] Option to remove KiKit auxiliary footprints - Enabled by default - KiKit is failing to mark them properly Solves #516 --- CHANGELOG.md | 1 + docs/source/configuration/outputs/position.rst | 1 + kibot/out_position.py | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17d56c9b..decb5783 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -53,6 +53,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Basic support for regular list items (#480) - Position: - Experimental support for gerber position files (#500) + - KiKit auxiliary footprints used for panels excluded (#516) - Help for the error levels - Warnings: - Explain about wrong dir/output separation (#493) diff --git a/docs/source/configuration/outputs/position.rst b/docs/source/configuration/outputs/position.rst index e13499c0..71f676ab 100644 --- a/docs/source/configuration/outputs/position.rst +++ b/docs/source/configuration/outputs/position.rst @@ -43,6 +43,7 @@ Parameters: - ``dnf_filter`` :index:`: ` [string|list(string)='_none'] Name of the filter to mark components as not fitted. A short-cut to use for simple cases where a variant is an overkill. + - ``exclude_strange_footprints`` :index:`: ` [boolean=true] Removes suspicious footprints. Currently removes footprints generated by KiKit to create the panel. - ``gerber_board_edge`` :index:`: ` [boolean=false] Include the board edge in the gerber output. - ``include_virtual`` :index:`: ` [boolean=false] Include virtual components. For special purposes, not pick & place. Note that virtual components is a KiCad 5 concept. diff --git a/kibot/out_position.py b/kibot/out_position.py index 0d0263e1..f4267ae7 100644 --- a/kibot/out_position.py +++ b/kibot/out_position.py @@ -91,6 +91,8 @@ class PositionOptions(VariantOptions): """ When generating the CSV quote all values, even numbers """ self.gerber_board_edge = False """ Include the board edge in the gerber output """ + self.exclude_strange_footprints = True + """ Removes suspicious footprints. Currently removes footprints generated by KiKit to create the panel """ super().__init__() self._expand_id = 'position' @@ -272,6 +274,9 @@ class PositionOptions(VariantOptions): for m in sorted(GS.get_modules(), key=lambda c: _ref_key(c.GetReference())): ref = m.GetReference() logger.debug('P&P ref: {}'.format(ref)) + if self.exclude_strange_footprints and ref.startswith('KiKit_'): + logger.debug('- KiKit auxiliary, excluded') + continue value = None # Apply any filter or variant data if comps_hash: