JLCPCB - strange issue with rounded rectangle pads + kicad nightly

I guess I’ve figured out why two corners are lost for the rounded rectangle pads.
In thread Apologies from atommann (an engineer from JLCPCB), about Gerber X2 files at JLCPCB, I suspected it was caused by the 5th parameter (rotation angle) of Apertrure Macro Circle (Code 1), and it is!

Here’s the test I did this afternoon:

  1. Create a project in Kicad 5.99 and add several chip capacitors which uses RoundRect macros.
  2. Generate Gerber X2 files with Aperture Macros enabled.
  3. Import Gerbers into CAM-B, two rounded corners are missing.
  4. Copy top copper layer, remove the 5th parameter for circle.
  5. Import the modified Gerbers into CAM-B again, all 4 rounded corners are displayed correctly.

Same layer, circle with 5th parameter vs without 5th parameter:

The Gerber Format Specification Revision 2020.09, page 52:

The Gerber Format Specification November 2013 Revision J1, page 85:

1 Like

interesting and nice investigation.
So looking at the GERBER spec 2020.09, the 5th parameter is listed as OPTIONAL (default no rotation)

so if the example is:
%AMCircle*
1,1,1,5,0,0,0*%

vs
%AMCircle*
1,1,1,5,0,0*%

so… if you have time, if you were to take a KiCad X2+macro GERBER set and manually remove that additional rotation parameter (whatever the angle) does it work in both CAM packages?

rotation on a circle seems odd because it is symmetrical … but it’s the spec. If manually removing works then one solution would be an option to suppress rotation information. Ideal solution is interacting with the CAM vendor but well :slight_smile:

@Naib It’s rotation around the macro origin, not rotation around the centre of the circle (which obviously does nothing).

However, for compatibility reasons I think KiCAD should be modified to avoid outputting the rotation parameter at all. I have raised an issue for this: https://gitlab.com/kicad/code/kicad/-/issues/7047

2 Likes

oooooh… that makes more sense :frowning:

and yes some UI option to disable rotation it probably the best. Then Fab houses can list their recomended settings.

I don’t even think it needs to be a UI option. What’s the point of outputting that data if it just serves to make the file bigger and less compatible? As far as I know KiCad never outputs a nonzero rotation there.

The point would be specification compliant. The updated specification w.r.t. the aperture macro explicitly states the rotation. While it is optional, it is still there and at some future date some new rotation might be required to create more complex openings and thus completely removing the ability to include this could cause problems later.

Also the inclusion would help with a statement that the format aligns to a certain version of the specification

Well, don’t output it if the value is zero, then.

that’s viable, as long as it was captured in some document that this is the behaviour…
i’m just from an industry where an awful lot of time and money is spent to exhaustively show not only compliance to but also the exact response to requirements is. If a source material that something is meant to show compliance to stated the format, then this would need to be demonstrated

Did another test on the rotation angle for aperture macro circle primitive.

Also just several chip capacitors with rounded corner rectangle pads. Modify one rotation angle to 22.5 degrees to see how the pads will look like in different Gerber viewers. am-circle-rot-test-gerbers.zip (8.6 KB)

0 Add four circle primitives for the rounded corners*
1,1,$1+$1,$2,$3,22.5*
1,1,$1+$1,$4,$5,0*
1,1,$1+$1,$6,$7,0*
1,1,$1+$1,$8,$9,0*

Reference Viewer by Ucamco:

gerbview in KiCad 5.99:

tracespace view:

Gerbv 2.6.1 in Ubuntu 18.04:

The UCAMCO viewer does not show UCAMCO spec files correctly?

So much for “standards” :roll_eyes:

It did shows it correctly as you can see one circle was rotated 22.5 degrees around the macro’s origin. So looks like KiCad’s own viewer, tracespace viewer, ref viewer from ucamco all implemented correctly as per the Gerber spec rev 2020-09.

That looks correct though. Rotate the circle 22.5deg around the origin and you would have that. The modification was done at RAW level not generated by some package. Gerbv-2.6.1 outright ignores any rotation

2.6.1 is not the latest version of Gerbv. I’m curious how the test file will look in the newest Gerbv.

True, it is interesting it silently ignored the final parameter. I would have expected some form of warning as the aperture termination would have been incorrect against an old parser. This would imply it isn’t parsing correctly.
good question how it is viewed in the updated version.

I tried windows version of 2.7.0

1 Like

Well, that was quick… my proposed change has been made already.

3 Likes

Did you compile it yourself? I couldn’t find any binaries for windows.

From here https://sourceforge.net/p/gerbv/bugs/237/#ea9c/17a8

2 Likes

Just gave it a try using our CAM solution, https://aisler.net/PatrickFranken/playground/am-circle-rot-test-gerbers/board
Looks all fine. As said on the other thread, the fix was actually just two lines of code. So if there is any chance to patch the CAM software you are using, I could provide some insights.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.