GerbView crashes when opening file with rounded rectangles in it (SOLVED)

Hi! I was using gerbview to check my gebers that I generated with TopoR. And it crashed on some files. I narrowed it down a bit, it appears to be caused by AMROUNDRECTNOHOLE10 entries in the gerber file. At least, if I edit the pads so that there are only straight rectangles, it works fine.

This one crashes gerbview:
F.Mask_roundrect.gbr (5.5 KB)
And this one opens without trouble:
F.Mask.gbr (4.3 KB)

Application: gerbview
Version: (2017-09-09 revision 8c7175b00)-makepkg, release build
Libraries:
wxWidgets 3.0.3
libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 8 (build 9200), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
Boost: 1.60.0
Curl: 7.54.1
Compiler: GCC 7.1.0 with C++ ABI 1011

Build settings:
USE_WX_GRAPHICS_CONTEXT=OFF
USE_WX_OVERLAY=OFF
KICAD_SCRIPTING=ON
KICAD_SCRIPTING_MODULES=ON
KICAD_SCRIPTING_WXPYTHON=ON
KICAD_SCRIPTING_ACTION_MENU=ON
BUILD_GITHUB_PLUGIN=ON
KICAD_USE_OCE=ON
KICAD_SPICE=ON

Hi @DeepSOIC
this issue would be better to be posted at kicad mailing list
https://lists.launchpad.net/kicad-developers/
or raise a bug issue at launchpad…

In this forum very little developers are present…
Maurice

1 Like

Thanks, I am going to try make a bug report on Launchpad then.

Made a bug report

1 Like

It looks like JP already fixed it for you.

1 Like

Yep! Moreover, he pointed out that my gerber file is erroneous. He gave just enough pointers, so that I found the exact problem with the file rather quickly.

%AMROUNDRECTNOHOLE13*
...    
4,1,9,1.2500,0.7500,0.7500,1.2500,-0.7500,1.2500,-1.2500,0.7500,-1.2500,-0.7500,-0.7500,-1.2500,0.7500,-1.2500,1.2500,-0.7500,1.2500,0.7500,0*
%

The line with numbers says: primitive filled polygon (4), positive (1), 9 vertices, 9*(x-y pairs)., rotation angle (0)
The problem is, for 9 vertices, there should be 10 x-y pairs, with the final one equal to the first one. But, TopoR listed only 9 pairs.

The actual wrong part is that the polygon should have 8 vertices (it’s a “+” shape, I think). If I replace these "9"s with "8"s, the file opens correctly.