matthewlai / JLCKicadTools

Tool for using JLCPCB assembly service with KiCad
GNU General Public License v3.0
346 stars 62 forks source link

Fixes for bottom layer #30

Closed purdeaandrei closed 4 years ago

purdeaandrei commented 4 years ago

1) Kicad mirrors the x axis for the bottom layer. This is reversed 2) When applying rotation adjustment to the bottom layer, it should be applied in the opposite direction

purdeaandrei commented 4 years ago

Rebased to fix conflicts

purdeaandrei commented 4 years ago

Please note, that I have successfully built a bottom-populated PCB with these changes: https://deskthority.net/viewtopic.php?f=50&t=24512 I ended up not using resistor networks because they went out of stock for a while.

purdeaandrei commented 4 years ago

image I did not get any placement errors from jlcpcb

purdeaandrei commented 4 years ago

Alright, so the first version of this PR wasn't exactly right. I misinterpreted what I was seeing, I thought I would need to add 180 degrees to rotation of bottom layer components, but that was wrong. It worked by coincidence for the project above, because I also had a bug in my code that only added 180 degrees to the components that would have been rotation-adjusted normally anyway. So and adjustment of +180 + 90 = +270 has the same effect as -90 would have, and that's why it looked correct.

So now the current version of the PR is correct, I tested it with many more components. On the top layer it adds the adjustment, on the bottom layer it substracts the adjustment.

Also I removed that ugly rotation_changed variable that was in the previous version of my PR. But still -- if rotation is not changed, the format of the rotation is not re-formatted. Do you want me to change that? It would involve just moving the "row[rotation_index] = "{0:.6f}".format(rotation)" statement out of the if and for blocks. I'm fine either way, but I think I would prefer to keep it like this.

(Note: also I removed a mod to the database from this PR, to make the purpose of the PR singular. I will put what I removed in a different PR. )