Gerber Viewer: Some macro primitives rotate about the primitive's center rather than the macro's origin
Description
Per the Gerber Layer Format Specification, Revision 2023.08, all macro primitives should rotate about the macro's origin. However, Gerber Viewer does not obey that for the Polygon, Thermal, and Moire primitives. Those three appear to rotate about the primitive's center rather than the macro's origin. Attached is a sample Gerber file that tests all macro primitive types with each at three different rotations. This is the image displayed by Gerber Viewer:
But it should look like this:
Note that Ucamco's online Reference Gerber Viewer also has a similar problem (besides the above-mentioned primitives, it is also failing to rotate the Circle primitive about the macro's origin). They have acknowledged this and are working on a solution:
Steps to reproduce
- Open Gerber Viewer
- Use it to open the attached Gerber file
- Observe that the Thermal, Polygon (pentagon in this case), and Moire primitives rotate in place rather than rotating about the macro's origin as do the other primitives (Circle, Outline, Lower Left Line, Center Line, and Vector Line).
KiCad Version
Application: KiCad x64 on x64
Version: 7.0.8, release build
Libraries:
wxWidgets 3.2.2
FreeType 2.12.1
HarfBuzz 6.0.0
FontConfig 2.14.1
libcurl/7.88.1-DEV Schannel zlib/1.2.13
Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Sep 29 2023 18:44:47
wxWidgets: 3.2.2 (wchar_t,wx containers)
Boost: 1.81.0
OCC: 7.7.1
Curl: 7.88.1-DEV
ngspice: 41
Compiler: Visual C++ 1936 without C++ ABI
Build settings:
KICAD_SPICE=ON