ThisIsNotRocketScience / GerberTools

Tools to load/edit/create/panelizer sets of gerber files
MIT License
725 stars 144 forks source link

When rotating PCB, rectangle apertures are converted to invalid macros #139

Open positron96 opened 3 years ago

positron96 commented 3 years ago

Here is my source gerber, created with EasyEDA, it contains a soic-8 with reactangle pads: Gerber_rot_2021-05-27.zip image

Here is a sample panel created with GerberPanelizer, with one non-rotated PCB and one rotated 180deg: bugreport.gerberset.txt image

Exporting gerbers produce the following piece of text in .gtl (top copper):

%AMCOMP4*
4,1,3,
0.04349999999999999,0.012000000000000005,
-0.04349999999999999,0.011999999999999997,
-0.04349999999999999,-0.012000000000000005,
0.04349999999999999,-0.011999999999999997,
0*%
%ADD32COMP4*%

In non-rotated PCB, this element (a pad of SOIC8) is represented by a rectangle macro. In rotated PCB, the pad is made with a new outline macro (above).

According to spec, for an outline the first and last points should be the same. Here they are not, and last point of the rectangle is missing (there should be 5 (starting+4) points, 5th must be the same as start point).

This would not be a problem, but JLCPcb and PCBWay process this gerber badly (it's invalid, so they have every right to do so):

Here is an UI of JLCPCB: image

Here is an example of PCBWay gerber previewer: image

I did order at JLCPcb and am afraid to receive PCBs with these triangular pads (confirmation images contained this defect as well).

Ucamco's reference gerber viewer (Ucamco are the creators of the standard) complains about this macro as well: image

positron96 commented 3 years ago

I'm testing this on b79281acaf5d070be755a5ee68249d62ab7fc4b8