Comment 12 for bug 1661705

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1661705] Re: Integer overflow in gerber export and 3d viewer

On 3/8/2018 10:31 AM, jean-pierre charras wrote:
> No so simple.
> Gerber can handle 9999.99999 mm (internal unit = 10 nanometers)
>
> But Pcbnew cannot handle this size.
> It is limited to roughly -1m to +1m

Do you mean the drawing area of pcbnew is limited to -1m to 1m? I
thought the internal units of pcbnew was 1 nanometer. If I am not
mistaken, the internal units (coordinates) are held by 32 bit integers.
If my math is correct, the board editor should be able to support a
drawing area from -2147.483648mm to 2147.483648mm. That should fit
comfortably into the gerber file limits.

>
> this board file has a text located to INT_MIN on the y axis.
> I do not know how it is possible, but this is outside the Pcbnew capacity.
> see the line:
> (gr_text Reset (at 129.54 -2147.483648 180) (layer B.Cu)

My guess is that this was edited by hand which would cause the text it
extend past the allowable drawing area triggering an integer overflow
but -2147.483648 should be a valid coordinate as long as nothing
extended beyond this limit.

>
> that locate a text at y = -2m and this is not possible with Pcbnew.
>
> Therefore the .gbr file cannot be correctly created by Pcbnew (integer
> overflow) and I think the board file is broken.
>