kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23140
Re: PATCH: Set SMD attribute in footprint wizard
Hi,
On Mon, Feb 15, 2016 at 11:49 PM, jp charras <jp.charras@xxxxxxxxxx> 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.
> 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.
>
> 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!
>
> >
> >
> > On Mon, Feb 15, 2016 at 1:20 AM, Miguel Angel Ajo Pelayo <
> > majopela@xxxxxxxxxx> 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.arguedas@xxxxxxxxx>
> >> 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.arguedas@xxxxxxxxx> wrote:
> >>
>
>
>
> --
> Jean-Pierre CHARRAS
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
Follow ups
References