Fix rotation in mnbtool

This commit is contained in:
Jan-Henrik 2020-03-29 15:06:18 +02:00
parent db70c6828c
commit 9ce28e066d

View file

@ -28,16 +28,9 @@ for reader in [reader_t, reader_b]:
for row in reader: for row in reader:
row = list(filter(None, row[0].split(' '))) row = list(filter(None, row[0].split(' ')))
rotation = int(row[3]) rotation = int(row[3])
# special behaviour for SOIC8: if layer == 'Bottom':
print(len(row)) rotation = (360 - rotation + 180) % 360
if len(row) >= 6:
print(row[5])
if "SOIC8" in row[5]:
if rotation == 180:
rotation = 0
elif rotation == 0:
rotation = 180
writer.writerow({'Designator': row[0], 'Mid X': row[1], writer.writerow({'Designator': row[0], 'Mid X': row[1],
'Mid Y': row[2], 'Layer': layer, 'Rotation': rotation}) 'Mid Y': row[2], 'Layer': layer, 'Rotation': rotation})