KiCad / kicad-library-utils

Some scripts for helping with library development
GNU General Public License v3.0
128 stars 95 forks source link

Fix F5.3 check #337

Closed cpresser closed 3 years ago

cpresser commented 3 years ago

This fixes a regression from #334.


My testing when making #334 was not good enough. For some cases the weird +0.00005 math breaks the rounding really bad. I remove that block completely, the rounding is simpler and better. At least my current testing shows that it now works again as intended.

@evanshultz can you please take a look. This breaks travis (false positives). So I would like to address that right away.

See https://github.com/KiCad/kicad-footprints/pull/2438#issuecomment-694928293

chschlue commented 3 years ago

Two questions:

cpresser commented 3 years ago

ad1. To check if lines are on a grid, their coordinates are converted to micrometer nanometer. That should return an integer so a modulo division can be used to determine if they are on the grid. I agree that 1E3 and 1E6 seems wrong. But it is wrong at two places, so the code works :smile: GRID = int(KLC_CRTYD_GRID * 1E6) Proposed fix, rename the function to mmToNanometer()

ad2. I was not aware, I will change that.

cpresser commented 3 years ago

I did a force-push to keep all changes in one commit. This is so small, adding a 2nd commit seemed wrong.

evanshultz commented 3 years ago

I'm fine to do it. Anybody object to merging now as is?