yaqwsx / KiKit

Automation tools for KiCAD
https://yaqwsx.github.io/KiKit
MIT License
1.49k stars 200 forks source link

Footprint text is incorrectly rotated when 'Keep Upright' is set and footprint is rotated #656

Closed cbull-86 closed 5 months ago

cbull-86 commented 5 months ago

Prerequisites

KiKit version

1.5.0

KiCAD version

8

Operating system

Windows

Description

Footprint text is incorrectly rotated after panelization for some footprints. I have tracked it down to the following criteria: -Footprint is rotated -'Keep upright' is set on the text -Text is rotated It seems to occur in panelize.py around line 1011 - in a debug session if I manually re-set the KeepUpright after item.SetKeepUpright(False) and before item.SetTextAngle(actualOrientation - footprint.GetOrientation()) the text retains the correct rotation. Likewise the problem is solved by unticking 'keep upright' for the text in KiCad before running panelization.

Steps to Reproduce

yaqwsx commented 5 months ago

This issue is confirmed; it happens only on KiCAD 8, not KiCAD 7. It seems that the meaning of TextAngle has changed between versions:

What happens for KiCAD 7:

actualOrientation: 90.0, footprint.GetOrientation(): 90.0
Text angle: 180.0 
New text angle: 0.0

What happens for KiCAD 8:

actualOrientation: 90.0, footprint.GetOrientation(): 90.0
Text angle: -90.0 
New text angle: 0.0

This needs to be investigated further.

yaqwsx commented 5 months ago

This should be fixed by 495e55c