From 03dae2cb63161a421643d63ef8744bf76d76a41d Mon Sep 17 00:00:00 2001 From: grodnay <70773975+grodnay@users.noreply.github.com> Date: Thu, 5 Dec 2024 09:49:34 +0200 Subject: [PATCH] fix: Trough Hole & "unspecified" position to center of pads (#181) * Fixed Trough Hole position to center of pads, and "unspecifiled" to centor of bounding box. * "unspecified" changed to center of pads. "Origin" field added. --- .DS_Store | Bin 0 -> 6148 bytes README.md | 10 +++++++++- plugins/.DS_Store | Bin 0 -> 6148 bytes plugins/process.py | 27 ++++++++++++++++++--------- 4 files changed, 27 insertions(+), 10 deletions(-) create mode 100644 .DS_Store create mode 100644 plugins/.DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a7b0016a4594b5d087a79d40ca36089aba2f55b5 GIT binary patch literal 6148 zcmeHKJ8DBQ5S&d6F}QJ=Qdh_ggt1TH3z)PFdI4K|n{=NeKeQ0#YUN|Pkr-MVZ0K^%?VVp-V zL2Mo%_QEld5t=2Hm{hA4!;;Q;tGr$~CMF$L&4<;^Rvn7P?L5ClI;as{jB1 literal 0 HcmV?d00001 diff --git a/README.md b/README.md index 87fcf03..e54ca94 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,15 @@ _The fields will be queried in the order denoted above._ _The fields will be queried in the order denoted above._ -### ⑤ Override Component Layer +### ⑤ Override Component Origin +The Fabrication Toolkit reports the position of each component based on an automatically selected point of reference. This default behavior can be overridden by adding an **Origin** field to the component. + +The **Origin** field supports the following values: + +- `Anchor` - Uses the footprint's anchor point, which can be modified in KiCad's footprint editor. +- `Center` - Uses the center of the bounding box formed by the footprint's pads. + +### ⑥ Override Component Layer Some footprints may have their components defined on the opposite layer to there actual footprints. In these instances you can override mount side by using this field. Values can be `top`, `bottom`, `t` or `b`. diff --git a/plugins/.DS_Store b/plugins/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..fdae4bd6f9cf77b4297b1699cebeee812033fb5f GIT binary patch literal 6148 zcmeHK!A`ysWB-7$V_V!qyA>Q^t#T#)wMi&5(1n z(n!hTnK?NU_lP;}IG(Y6%iqow@rJyNt4fHaGMAch#@Jk06Ru%_H)feL;*)cx?4`_} z^Qm-gGkP8{;_N*S~wMUN7oTm~!)rBjD^K|;75Elom zJ$gEvX68I0vkNyAr`hR`G#oDWXtgO|3T!KI;=5fr|L+gq|F=ojGX+e6f2DwH568m+ zUn!ieJ1-|^ZN&1 0: # get bounding box based on pads only to ignore non-copper layers, e.g. silkscreen bbox = pads[0].GetBoundingBox() # start with small bounding box for pad in pads: bbox.Merge(pad.GetBoundingBox()) # expand bounding box - position = bbox.GetCenter() - + else: + position = footprint.GetPosition() #if we have no pads we fallback to anchor + return position def generate_tables(self, temp_dir, auto_translate, exclude_dnp):