From f832e4e0079d43b49ec8b9fff90815eefa8a521b Mon Sep 17 00:00:00 2001 From: RevK Date: Wed, 21 Jun 2023 11:13:11 +0100 Subject: [PATCH] Bottom side rotates still not quite right Inverting around 360 degrees looked fine for angles, even 45 degrees and 10 degrees and so on, but turns out it actually needs inverting around 180 degrees else your diodes are all backwards. Arrrg. --- plugins/process.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/process.py b/plugins/process.py index 3a91ff8..0fba646 100644 --- a/plugins/process.py +++ b/plugins/process.py @@ -176,9 +176,9 @@ class ProcessManager: pos_offset = ( pos_offset[0] * rcos - pos_offset[1] * rsin, pos_offset[0] * rsin + pos_offset[1] * rcos ) mid_x, mid_y = tuple(map(sum,zip((mid_x, mid_y), pos_offset))) - # JLC expect 'Rotation' to be 'as viewed from above component', so bottom needs inverting. - if layer == 'bottom' and rotation != 0: - rotation = 360.0 - rotation + # JLC expect 'Rotation' to be 'as viewed from above component', so bottom needs inverting, and ends up 180 degrees out as well + if layer == 'bottom': + rotation = (540.0 - rotation) % 360.0 self.components.append({ 'Designator': designator,