From 6b040af84956435fbe8f00cea0a5dd6804bcf2a7 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 15 Nov 2023 07:26:14 -0300 Subject: [PATCH] [Rotation Filter][Added] More comments about rotations --- kibot/fil_rot_footprint.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kibot/fil_rot_footprint.py b/kibot/fil_rot_footprint.py index 47d34b08..e4e0c4d7 100644 --- a/kibot/fil_rot_footprint.py +++ b/kibot/fil_rot_footprint.py @@ -5,6 +5,7 @@ # Project: KiBot (formerly KiPlot) # Description: Implements a filter to rotate footprints. # This is inspired in JLCKicadTools by Matthew Lai. +# See: https://github.com/matthewlai/JLCKicadTools/blob/master/jlc_kicad_tools/cpl_rotations_db.csv # I latter added more information from bennymeg/JLC-Plugin-for-KiCad from math import sin, cos, radians from re import compile @@ -19,6 +20,15 @@ logger = log.get_logger() # Known rotations for JLC +# Notes: +# - Rotations are CC (counter clock) +# - Most components has pin 1 at the top-right angle, while KiCad uses the top-left +# This is why most of the ICs has a rotation of 270 (-90) +# - The same applies to things like SOT-23-3, so here you get 180. +# - Most polarized components has pin 1 on the positive pin, becoming it the right one. +# On KiCad this is not the case, diodes follows it, but capacitors don't. So they get 180. +# - There are exceptions, like SOP-18 or SOP-4 which doesn't follow the JLC rules. +# - KiCad mirrors components on the bottom layer, but JLC doesn't. So you need to "un-mirror" them. DEFAULT_ROTATIONS = [["^R_Array_Convex_", 90.0], ["^R_Array_Concave_", 90.0], # *SOT* seems to need 180