From a94d09dfa60f675a1eedeacd3c35546b7619cd06 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 26 Mar 2024 10:57:01 -0300 Subject: [PATCH] [Rotations][Fixed] JLCPCB bottom rotations with offset The angle must be -angle and the X offset mirrored See #591 --- CHANGELOG.md | 4 +++- kibot/fil_rot_footprint.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4602e8d92..2b0e0dcd3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,7 +19,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Netlist generation problems with components on the PCB but not in schematic. (#578) -- Filters: _none filter not always honored (i.e. exclude in BoM) (#580) +- Filters: + - _none filter not always honored (i.e. exclude in BoM) (#580) + - Rotation for bottom JLCPCB parts with offset (#591) - PCB Parity: components excluded from the board reported anyways (#585) - BoardView: - X axis mirroring issues (whitequark/kicad-boardview#11) diff --git a/kibot/fil_rot_footprint.py b/kibot/fil_rot_footprint.py index 31c98edb6..449248d69 100644 --- a/kibot/fil_rot_footprint.py +++ b/kibot/fil_rot_footprint.py @@ -251,6 +251,10 @@ def apply_rotation(self, comp): self.apply_rotation_angle(comp, 0) def apply_offset_value(self, comp, angle, pos_offset_x, pos_offset_y): + if comp.bottom and self.mirror_bottom: + logger.debugl(2, '- applying mirror to the offset') + pos_offset_x = -pos_offset_x + angle = -angle if angle: rotation = radians(angle) rsin = sin(rotation) @@ -282,7 +286,7 @@ def apply_field_offset(self, comp): pos_offset_x = -pos_offset_x pos_offset_y = -pos_offset_y logger.debugl(2, f'- changing to {pos_offset_x}, {pos_offset_y} mm to match signs') - self.apply_offset_value(comp, comp.offset_footprint_rot, pos_offset_x, pos_offset_y) + self.apply_offset_value(comp, comp.footprint_rot, pos_offset_x, pos_offset_y) return True return False