Le 16/02/2016 07:44, Mikael Arguedas a écrit : > Hi Miguel, > > Thanks for the clarification. I can now appreciate the difference. In this > case it's indeed more useful to have a minimum size that won't be 0. > > Actually I thought these were 1nm steps. My intent was to have every > courtyard size to be rounded to 0.1mm and thus land on a 0.05mm grid as > specified in the KLC. > Anyway I tested it on a couple of footprints and it seems to be giving the > expected result. > > Thanks for reviewing and for the explanation!
In fact the patch needs a bit of enhancement: - It uses values given in internal units. this is not a good practice if you want to use a value of 0.5 mm, use 0.5 mm. (like for all uthers values) The meaning of values just given as integer is always not easy to understand. - Because the rounding is subject to change, and used 6 times, only one method called 6 times is more easy to change, and more easy to understand for the reader. - the KLC say 0.05 mm rounding. Why to use 0.1 mm? Leave 0.05 rounding level. Thanks for your interest at Kicad. > > > On Mon, Feb 15, 2016 at 1:20 AM, Miguel Angel Ajo Pelayo < > majop...@redhat.com> wrote: > >> Hi Mikael, >> >> Sorry, my comment is probably irrelevant, >> >> sizex = (int(sizex/100000)+1)*100000 >> >> vs >> >> sizex = (int((sizex+(100000-1))/100000))*100000 >> >> >> for sizex of 0, on the first one you end up with 100000 >> while on the second you end up with 0 >> >> and for sizex of 1, both render the same result. >> >> Anyway, given those are 10nm steps, you probably don’t care, and actually >> you want to start by 1mm minimum, >> right?, so your function would be more appropriate. >> >> Cheers :) >> >> On 14 Feb 2016, at 15:28, Mikael Arguedas <mikael.argue...@gmail.com> >> wrote: >> >> Hi Miguel, >> >> The question may seem silly (sorry I'm an EE guy who doesnt know much >> about computer science). How is your suggested implementation of ceil >> better? Is it a matter of stability ? performance ? >> They seem completely identical to me in terms of performance and result >> but I'd really like to learn where I mistaken. >> >> Thanks! >> MIkael >> >> On Sun, Feb 14, 2016 at 6:07 AM, Mikael Arguedas < >> mikael.argue...@gmail.com> wrote: >> -- Jean-Pierre CHARRAS _______________________________________________ Mailing list: https://launchpad.net/~kicad-developers Post to : kicad-developers@lists.launchpad.net Unsubscribe : https://launchpad.net/~kicad-developers More help : https://help.launchpad.net/ListHelp