Le 16/02/2016 09:08, Mikael Arguedas a écrit : > Hi, > > > > > On Mon, Feb 15, 2016 at 11:49 PM, jp charras <jp.char...@wanadoo.fr> wrote: > >> 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) >> > - I did use the values already used by the scripts themselves (variables > sizex and sizy are expressed in 1nm steps). All this patch does is rounding > the values already used by the scripts to draw the recangle. I didnt want > to change the internals of the script given that they all use the same > format. > What I can do: > - Use pcbnew.FromMM() method to make clearer where these numbers come > from. > - Implement this ceiling function in the parent class and just call it in > all the scripts using it.
Yes, this is a good idea. > >> 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. >> > All the scripts seem to give the size of a rectangle to draw. This > rectangle is centered on the origin. So if I use 0.05 for rounding the > courtyards line may endup on a 0.025 grid. That is the reason I used 0.1mm. In fact, AFAIK, some scripts use the size of a rectangle, and some others the distance (coordinate) from X or Y axis. Rectangles are used for SMD ICs, but connectors do not use always rectangles to build the courtyard. If you are implementing the ceiling function in a parent class, use 0.05 mm, because it will be not necessary used for sizes, but also for distances, and round the half size if needed. > >> >> Thanks for your interest at Kicad. >> > You're welcome I love this project. I'm using it everyday so I'm happy to > contribute back! > -- 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