Skip to content

Commit

Permalink
Don't switch rotation correction direction on bottom side
Browse files Browse the repository at this point in the history
  • Loading branch information
dzid26 authored and Bouni committed Jan 22, 2024
1 parent 1030329 commit 5afa9ec
Showing 1 changed file with 8 additions and 18 deletions.
26 changes: 8 additions & 18 deletions fabrication.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,14 @@ def fix_rotation(self, footprint):

def rotate(self, footprint, rotation, correction):
"""Calculate the actual correction."""
if footprint.GetLayer() == 0:
rotation = (rotation + int(correction)) % 360
self.logger.info(
"Fixed rotation of %s (%s / %s) on Top Layer by %d degrees",
footprint.GetReference(),
footprint.GetValue(),
footprint.GetFPID().GetLibItemName(),
correction,
)
else:
rotation = (rotation - int(correction)) % 360
self.logger.info(
"Fixed rotation of %s (%s / %s) on Bottom Layer by %d degrees",
footprint.GetReference(),
footprint.GetValue(),
footprint.GetFPID().GetLibItemName(),
correction,
)
rotation = (rotation + int(correction)) % 360
self.logger.info(
"Fixed rotation of %s (%s / %s) on Top Layer by %d degrees",
footprint.GetReference(),
footprint.GetValue(),
footprint.GetFPID().GetLibItemName(),
correction,
)
return rotation

def get_position(self, footprint):
Expand Down

0 comments on commit 5afa9ec

Please sign in to comment.