← Back to team overview

kicad-developers team mailing list archive

Re: Eagle plugin


On 5/16/19 4:52 PM, Seth Hillbrand wrote:
> Am 2019-05-16 16:44, schrieb Wayne Stambaugh:
>> On 5/16/19 4:31 PM, Seth Hillbrand wrote:
>>> Am 2019-05-16 16:24, schrieb Wayne Stambaugh:
>>>> I'm fixing a bug[1] in the Eagle plugin in Pcbnew when loading stand
>>>> alone Eagle footprint libraries.  The fix is easy enough but I'm not
>>>> sure why the original code was written this way.  When the Eagle plugin
>>>> in loads a board, it uses the board layer line widths instead of the
>>>> line width defined in the EWIRE object read from the file.  Since I'm
>>>> not an expert on the Eagle board file, do footprints in an Eagle board
>>>> file use the layer line width defined in some board layer definition or
>>>> does each EWIRE definition define its own line width?  Thanks in
>>>> advance
>>>> for the help.
>>> Where do you see this behavior?  In packageWire(), the width is loaded
>>> from the wire definition itself, not a different node.
>>> -S
>> Not if it's < 0.  This is where the issue was (line 1405 in
>> pcbnew/eagle_plugin.cpp).  The call aModule->GetBoard() was null when
>> loading a library which caused the segfault.  I just added a null guard
>> which falls back to the <=0 width which interestingly doesn't seem to
>> cause any issues because the footprints looked fine to me once I fixed
>> the bugs.  I can certainly set the <0 line with to some KiCad internal
>> default.
>> Wayne
> Oh.  Right.  <= 0 is invalid for us and couldn't be selected.  We loaded
> the design settings to get the user preferences.  We could just use the
> layer defaults if GetBoard() is null as we used to do:
>         switch( layer )
>         {
>         case Edge_Cuts:
>             width = DEFAULT_EDGE_WIDTH;
>             break;
>         case F_SilkS:
>         case B_SilkS:
>             width = DEFAULT_SILK_LINE_WIDTH;
>             break;
>         case F_CrtYd:
>         case B_CrtYd:
>             width = DEFAULT_COURTYARD_WIDTH;
>             break;
>         default:
>             width = DEFAULT_LINE_WIDTH;
>         }
> -S

That's what I was thinking so I will set the width to the layer defaults
when no board is present and the read wire width is < 0.