kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #23124
Re: PATCH: Set SMD attribute in footprint wizard
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 <mailto:mikael.arguedas@xxxxxxxxx>> wrote:
> Hi guys,
>
> Here is an updated version of the patch, I removed the textSize fix because it has already been merged here <https://lists.launchpad.net/kicad-developers/msg23113.html>.
>
> Cheers,
> Mikael Arguedas
>
> On Fri, Feb 12, 2016 at 8:56 AM, Mikael Arguedas <mikael.arguedas@xxxxxxxxx <mailto:mikael.arguedas@xxxxxxxxx>> wrote:
> Hi Miguel,
>
> I'm new to bazaar and that's the reason I started by just submitting patch files but for any further feature addition I'll send a branch for review.
>
> Yes the purpose of this function was to perform a ceil. Either of these implementations is good for me given that they have the same complexity and the same result.
>
> Cheers,
> Mikael Arguedas
>
>
> On Fri, Feb 12, 2016 at 1:31 AM, Miguel Angel Ajo Pelayo <majopela@xxxxxxxxxx <mailto:majopela@xxxxxxxxxx>> wrote:
> Hi, Mikael, I haven’t fully looked at the patch, it would be easier if you can send a branch for review via launchpad.
>
> But, Could you explain those changes:
>
> === modified file 'pcbnew/scripting/plugins/qfp_wizard.py'
> --- pcbnew/scripting/plugins/qfp_wizard.py 2016-02-11 15:02:37 +0000
> +++ pcbnew/scripting/plugins/qfp_wizard.py 2016-02-12 03:39:11 +0000
> @@ -113,6 +113,8 @@
> self.draw.SetLayer(pcbnew.F_CrtYd)
> sizex = (lim_x + cmargin) * 2 + pad_length
> sizey = (lim_y + cmargin) * 2 + pad_length
> + sizex = (int(sizex/100000)+1)*100000
> + sizey = (int(sizey/100000)+1)*100000
>
>
> --- pcbnew/scripting/plugins/zip_wizard.py 2016-02-11 15:02:37 +0000
> +++ pcbnew/scripting/plugins/zip_wizard.py 2016-02-12 03:31:52 +0000
> @@ -106,6 +106,8 @@
> thick = self.draw.GetLineThickness()
> sizex = (pin1posX + cmarginx) * 2 + pad_Hsize + thick
> sizey = (pin1posY + cmarginy) * 2 + pad_Vsize + thick
> + sizex = (int(sizex/100000)+1)*100000
> + sizey = (int(sizey/100000)+1)*100000
>
>
>
> The semantics for size x/y seem very different. :)
>
> Also, are you trying to round here?
> + sizex = (int(sizex/100000)+1)*100000
> + sizey = (int(sizey/100000)+1)*100000
>
> Wouldn’t it be better like
> sizex = (int((sizex+(100000-1))/100000))*100000
> (if you were trying to do a ceil?)
>
>
> Cheers,
> Miguel Ángel
>
>
>> On 12 Feb 2016, at 05:03, Mikael Arguedas <mikael.arguedas@xxxxxxxxx <mailto:mikael.arguedas@xxxxxxxxx>> wrote:
>>
>> Hi guys,
>>
>> Here is the updated patch including changes from https://lists.launchpad.net/kicad-developers/msg23059.html <https://lists.launchpad.net/kicad-developers/msg23059.html>
>> This patch fixes the following KLC violations in the generated footprints:
>> - fixes the text size as specified in rule 6.9
>> - rounds the courtyard position on a 0.05mm grid as specified in rule 6.6
>> - set the attribute for SMD components as specified in rule 10.5
>>
>> Cheers,
>> Mikael Arguedas
>>
>> On Thu, Feb 11, 2016 at 6:54 PM, Mikael Arguedas <mikael.arguedas@xxxxxxxxx <mailto:mikael.arguedas@xxxxxxxxx>> wrote:
>> Hi guys,
>>
>> Sorry for spamming.
>> This patch sets the footprint attibute to SMD if needed. This allows the generated footprints to comply with KLC rule 10.5.
>>
>> Cheers,
>> Mikael Arguedas
>>
>> <fixWizards.patch>_______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx <mailto:kicad-developers@xxxxxxxxxxxxxxxxxxx>
>> Unsubscribe : https://launchpad.net/~kicad-developers <https://launchpad.net/~kicad-developers>
>> More help : https://help.launchpad.net/ListHelp <https://help.launchpad.net/ListHelp>
>
>
>
>
Follow ups
References