KiCad / kicad-library-utils

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

Add rouding to mmToMicrons() function #334

Closed cpresser closed 3 years ago

cpresser commented 4 years ago

For when using getStartPoint() on arcs combined with the mmToMicrons() function the accuracy was not good leading to errors of the F5.3 check. See https://github.com/KiCad/kicad-footprints/pull/2267

With rounding applied to the value before converting it to int that issue is gone. This change won't break other rules since the function mmToMicrons() is only used for rule F5.3.

Fixes #329

evanshultz commented 3 years ago

OK. Looks simple enough. Thanks!

cpresser commented 3 years ago

is gone. This change won't break other rules since the function mmToMicrons() is only used for rule F5.3.

Fixes #329

Well... turns out my testing was not good enough: image

Will push a fix for that soon.