From 407f7b0508634394e7f8d8bf8ab9b169ed68f334 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Fri, 17 Nov 2023 07:45:51 -0300 Subject: [PATCH] [Rotation Filter][Fixed] Offset sign when using fields To match the plugin we are using as reference --- kibot/fil_rot_footprint.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/kibot/fil_rot_footprint.py b/kibot/fil_rot_footprint.py index 897a3059..882c6ffc 100644 --- a/kibot/fil_rot_footprint.py +++ b/kibot/fil_rot_footprint.py @@ -244,10 +244,10 @@ class Rot_Footprint(BaseFilter): # noqa: F821 rcos = cos(rotation) comp.pos_offset_x = pos_offset_x * rcos - pos_offset_y * rsin comp.pos_offset_y = pos_offset_x * rsin + pos_offset_y * rcos - # logger.error(f"Ang: {angle} DB offset: {pos_offset_x},{pos_offset_y} " - # f"Offset: {comp.pos_offset_x},{comp.pos_offset_y}") comp.pos_offset_x = -GS.from_mm(comp.pos_offset_x) comp.pos_offset_y = GS.from_mm(comp.pos_offset_y) + # logger.error(f"{comp.ref} Ang: {angle} DB offset: {pos_offset_x},{pos_offset_y} " + # f"Offset: {comp.pos_offset_x},{comp.pos_offset_y}") def apply_field_offset(self, comp): for f in self.offset_fields: @@ -258,9 +258,13 @@ class Rot_Footprint(BaseFilter): # noqa: F821 pos_offset_y = float(value.split(",")[1]) except ValueError: logger.warning(f'{W_BADOFFSET}Wrong offset `{value}` in {f} field of {comp.ref}') - return + return False + if self.bennymeg_mode: + pos_offset_x = -pos_offset_x + pos_offset_y = -pos_offset_y self.apply_offset_value(comp, comp.offset_footprint_rot, pos_offset_x, pos_offset_y) - return + return True + return False def apply_offset(self, comp): if self.apply_field_offset(comp):