New Gerber export

This applies to the Current 12/05/17 Github Fritzing development version.

I thought I would see what your opinions were on this before I opened an issue on Github.

The new Gerber export uses the clipper library to polygonize everything that way it can define all the shapes as complete solid polygons rather than thousands of thin strips as the original Gerber export did. This is obviously better than the thin strips but it results in there being no circles/curves defined in the gerbers which is why Gerbv says there are no holes defined in the Mask or Copper layers (drill file is fine).

Even if a board house could use the new gerbers to produce boards I could see the new shapes causing issues on high speed circuits or high voltage circuits because the rings and curved traces are now made up of lots of little straight segments rather than smooth curves.

This is the copper gerber layer of the default pcb with a single via in the middle.

0.9.3b

Development version

Overlay of the two showing they are not aligned with each other which makes it more of a problem.

Gerbv shows the properties of the via as:

This makes me think the new gerber output does not comply with Gerber RS-274x standards.

The only solutions I can think of are:

  1. Revert the new gerber export to the old one. :cry:

  2. Rewrite the new gerber export to use the original traces and rings and only use the new export for the copper fill. :sob:

After the Gerbv revelations, have you tried other gerber viewers.

I have not but as you can see from the text I posted from the gerber files the old way describes a circle and where to put it and the new way describes a series of connected lines.

I did have a look through the Gerber definition linked to in the other thread and it talks about how RS-274x is an improvement over RS-274d because it extends the data contained to describe what the elements are to make production easier.

I just did some more tests and the way it treats curved traces and copper/ground fill is so much better. It is only through hole rings that look to be worse now than before.

Both of these have the ground fill keep out set to 15mil.
0.9.3b you can see the curved trace and copper fill are very jagged and made up of strips. But the rings are perfect circles.


Development version you can see the curved trace and copper fill are much smoother but the rings are now polygons. Also note I got copper fill inside the space even though they are both using the same keep out setting.


So I guess the bug is much more minor than I originally thought and the improvements may outweigh the problem.

Here is the copper top layer output from the development version of my last test if you want to try it with other Gerber viewers. I just tried with two online ones and one worked and the other didn’t.

Just paste it in a text file and call it test2_copperTop.gtl

%ASAXBY*%
%FSLAX26Y26*%
%MOIN*%
%OFA0B0*%
%SFA1.0B1.0*%
G01*
%ADD23C,0.024*%
%ADD17C,0.076X0.074*%
%ADD16C,0.075*%
G36*
X3305300Y2207120D02*
X3307200Y2206720D01*
X3309100Y2206120D01*
X3310900Y2205220D01*
X3312500Y2204120D01*
X3314000Y2202720D01*
X3315300Y2201220D01*
X3316900Y2198620D01*
X3317600Y2196820D01*
X3318200Y2193820D01*
X3318300Y2192820D01*
X3318200Y29120D01*
X3318000Y27120D01*
X3317400Y25220D01*
X3316700Y23320D01*
X3315600Y21620D01*
X3315100Y20820D01*
X3313700Y19320D01*
X3312200Y18020D01*
X3309600Y16520D01*
X3307800Y15820D01*
X3304800Y15120D01*
X28900Y15120D01*
X27000Y15420D01*
X25000Y15920D01*
X23200Y16720D01*
X21500Y17720D01*
X20700Y18320D01*
X19200Y19620D01*
X17900Y21120D01*
X16300Y23720D01*
X15600Y25620D01*
X15000Y28520D01*
X14900Y29520D01*
X15000Y2193320D01*
X15200Y2195220D01*
X15800Y2197220D01*
X16500Y2199020D01*
X17600Y2200720D01*
X18100Y2201520D01*
X19500Y2203020D01*
X21000Y2204320D01*
X23600Y2205920D01*
X25400Y2206620D01*
X28400Y2207220D01*
X29400Y2207320D01*
X3303300Y2207320D01*
G37*
%LPC*%
G36*
X1172500Y1270420D02*
X1162000Y1270220D01*
X1151600Y1268920D01*
X1149800Y1268520D01*
X1138600Y1265620D01*
X1127800Y1261120D01*
X1118400Y1255920D01*
X1109300Y1249320D01*
X1107700Y1247820D01*
X1101300Y1241520D01*
X1099700Y1239820D01*
X1092700Y1230420D01*
X1086800Y1219520D01*
X1086000Y1217520D01*
X1082200Y1206620D01*
X1079700Y1193720D01*
X1079100Y1186020D01*
X1079000Y1179320D01*
X1079400Y1171320D01*
X1080400Y1162420D01*
X1083800Y1146620D01*
X1084200Y1145120D01*
X1087500Y1135420D01*
X1088000Y1133420D01*
X1088200Y1132520D01*
X1088300Y1130520D01*
X1087500Y1123720D01*
X1087500Y1121220D01*
X1088200Y1115820D01*
X1088900Y1113220D01*
X1090200Y1109320D01*
X1091300Y1107220D01*
X1094000Y1102620D01*
X1097300Y1098720D01*
X1098300Y1097720D01*
X1102300Y1094420D01*
X1104100Y1093120D01*
X1106700Y1091520D01*
X1108200Y1090220D01*
X1109500Y1088620D01*
X1110700Y1086820D01*
X1123600Y1063120D01*
X1125800Y1060020D01*
X1128900Y1057020D01*
X1131800Y1055020D01*
X1135000Y1053220D01*
X1136400Y1052620D01*
X1141700Y1051120D01*
X1146200Y1050720D01*
X1199700Y1050220D01*
X1203400Y1050520D01*
X1207200Y1051520D01*
X1211700Y1053520D01*
X1215100Y1055720D01*
X1217400Y1057620D01*
X1218400Y1058720D01*
X1221200Y1062120D01*
X1223000Y1065220D01*
X1234700Y1087820D01*
X1235900Y1089520D01*
X1237200Y1090920D01*
X1239900Y1093020D01*
X1241100Y1093720D01*
X1246400Y1098120D01*
X1250000Y1102320D01*
X1251300Y1104220D01*
X1253700Y1108520D01*
X1255800Y1114320D01*
X1256200Y1115920D01*
X1256800Y1121020D01*
X1256800Y1122420D01*
X1256300Y1128320D01*
X1256300Y1130320D01*
X1256600Y1132320D01*
X1257200Y1134320D01*
X1260300Y1143120D01*
X1263600Y1156720D01*
X1264000Y1158920D01*
X1264800Y1165020D01*
X1265300Y1172520D01*
X1265300Y1181220D01*
X1264800Y1187720D01*
X1262500Y1200320D01*
X1261900Y1202220D01*
X1257900Y1213620D01*
X1252500Y1224220D01*
X1251600Y1225520D01*
X1244800Y1235020D01*
X1244000Y1235920D01*
X1236600Y1243820D01*
X1227900Y1250920D01*
X1226700Y1251820D01*
X1217400Y1257720D01*
X1216500Y1258220D01*
X1208200Y1262220D01*
X1205500Y1263320D01*
X1196100Y1266620D01*
X1184700Y1269220D01*
X1173900Y1270420D01*
G37*
%LPD*%
G36*
X1126000Y1141620D02*
X1130100Y1140420D01*
X1136100Y1136220D01*
X1140300Y1130220D01*
X1141500Y1126120D01*
X1141800Y1122320D01*
X1141500Y1118420D01*
X1140300Y1114320D01*
X1136100Y1108220D01*
X1130000Y1104220D01*
X1126100Y1103020D01*
X1122200Y1102620D01*
X1118200Y1103020D01*
X1114300Y1104220D01*
X1108100Y1108220D01*
X1104100Y1114420D01*
X1102900Y1118320D01*
X1102500Y1122320D01*
X1102900Y1126220D01*
X1104100Y1130120D01*
X1108100Y1136220D01*
X1114200Y1140420D01*
X1118300Y1141620D01*
X1122200Y1141920D01*
G37*
%LPC*%
G36*
X1120200Y1129920D02*
X1119500Y1129720D01*
X1116600Y1127720D01*
X1114800Y1125120D01*
X1114600Y1124320D01*
X1114400Y1122320D01*
X1114600Y1120320D01*
X1114800Y1119520D01*
X1116600Y1116720D01*
X1119300Y1114920D01*
X1120200Y1114720D01*
X1122100Y1114520D01*
X1124200Y1114720D01*
X1125000Y1114920D01*
X1127600Y1116720D01*
X1129600Y1119620D01*
X1129800Y1120320D01*
X1130000Y1122320D01*
X1129800Y1124420D01*
X1129600Y1124920D01*
X1127600Y1127720D01*
X1124800Y1129720D01*
X1124100Y1129920D01*
X1122200Y1130120D01*
G37*
%LPD*%
G36*
X1226000Y1141620D02*
X1230100Y1140420D01*
X1236100Y1136220D01*
X1240300Y1130220D01*
X1241500Y1126120D01*
X1241800Y1122320D01*
X1241500Y1118420D01*
X1240300Y1114320D01*
X1236100Y1108220D01*
X1230000Y1104220D01*
X1226100Y1103020D01*
X1222200Y1102620D01*
X1218200Y1103020D01*
X1214300Y1104220D01*
X1208100Y1108220D01*
X1204100Y1114420D01*
X1202900Y1118320D01*
X1202500Y1122320D01*
X1202900Y1126220D01*
X1204100Y1130120D01*
X1208100Y1136220D01*
X1214200Y1140420D01*
X1218300Y1141620D01*
X1222200Y1141920D01*
G37*
%LPC*%
G36*
X1220200Y1129920D02*
X1219500Y1129720D01*
X1216600Y1127720D01*
X1214800Y1125120D01*
X1214600Y1124320D01*
X1214400Y1122320D01*
X1214600Y1120320D01*
X1214800Y1119520D01*
X1216600Y1116720D01*
X1219300Y1114920D01*
X1220200Y1114720D01*
X1222100Y1114520D01*
X1224200Y1114720D01*
X1225000Y1114920D01*
X1227600Y1116720D01*
X1229600Y1119620D01*
X1229800Y1120320D01*
X1230000Y1122320D01*
X1229800Y1124420D01*
X1229600Y1124920D01*
X1227600Y1127720D01*
X1224800Y1129720D01*
X1224100Y1129920D01*
X1222200Y1130120D01*
G37*
%LPD*%
G36*
X1171500Y1216420D02*
X1176500Y1215920D01*
X1183300Y1214620D01*
X1189100Y1212820D01*
X1194200Y1210620D01*
X1197700Y1208520D01*
X1199500Y1207320D01*
X1202400Y1204920D01*
X1205600Y1201420D01*
X1208300Y1197520D01*
X1209000Y1196120D01*
X1210500Y1192820D01*
X1210900Y1191520D01*
X1211900Y1187720D01*
X1212700Y1181320D01*
X1212400Y1174420D01*
X1211000Y1166020D01*
X1210800Y1165120D01*
X1209000Y1158920D01*
X1208300Y1157120D01*
X1207400Y1155320D01*
X1206200Y1153720D01*
X1204800Y1152220D01*
X1201700Y1149820D01*
X1198900Y1147420D01*
X1197000Y1145520D01*
X1194300Y1142320D01*
X1193000Y1140520D01*
X1190500Y1136120D01*
X1189700Y1133820D01*
X1188400Y1129720D01*
X1187900Y1127320D01*
X1187500Y1123720D01*
X1187600Y1119020D01*
X1187400Y1117120D01*
X1187000Y1115120D01*
X1186200Y1113220D01*
X1185300Y1111520D01*
X1184100Y1109920D01*
X1182700Y1108420D01*
X1181200Y1107220D01*
X1179500Y1106120D01*
X1177600Y1105320D01*
X1175700Y1104820D01*
X1173700Y1104520D01*
X1170700Y1104520D01*
X1168700Y1104820D01*
X1166800Y1105320D01*
X1165000Y1106120D01*
X1163200Y1107120D01*
X1162400Y1107720D01*
X1160900Y1109020D01*
X1159600Y1110520D01*
X1158100Y1113120D01*
X1157400Y1115020D01*
X1156800Y1117920D01*
X1156700Y1119920D01*
X1156800Y1122420D01*
X1156700Y1124220D01*
X1156300Y1128020D01*
X1155500Y1131120D01*
X1154300Y1134720D01*
X1152900Y1137620D01*
X1150200Y1141920D01*
X1146900Y1145920D01*
X1145400Y1147420D01*
X1140200Y1151720D01*
X1138900Y1153220D01*
X1137800Y1154920D01*
X1136900Y1156720D01*
X1135800Y1159720D01*
X1133200Y1169420D01*
X1131700Y1178920D01*
X1131500Y1185720D01*
X1132000Y1191820D01*
X1132300Y1193320D01*
X1133400Y1197420D01*
X1135100Y1201220D01*
X1137500Y1204920D01*
X1138800Y1206420D01*
X1140700Y1208320D01*
X1143900Y1210620D01*
X1148500Y1213020D01*
X1153200Y1214720D01*
X1158100Y1215720D01*
X1159500Y1216020D01*
X1164700Y1216520D01*
X1170000Y1216520D01*
G37*
D23*
X1198809Y1077070D02*
X1213479Y1105370D01*
X1131250Y1105530D02*
X1146320Y1077680D01*
X1146320Y1077690D02*
X1198809Y1077080D01*
X1222209Y1122230D02*
X1229204Y1136142D01*
X1234240Y1149255D01*
X1237448Y1161558D01*
X1238959Y1173042D01*
X1238903Y1183696D01*
X1237411Y1193512D01*
X1234613Y1202479D01*
X1230641Y1210587D01*
X1225623Y1217828D01*
X1219692Y1224190D01*
X1212977Y1229665D01*
X1205609Y1234241D01*
X1197719Y1237911D01*
X1189437Y1240663D01*
X1180894Y1242489D01*
X1172221Y1243378D01*
X1163547Y1243320D01*
X1155004Y1242306D01*
X1146721Y1240326D01*
X1138831Y1237371D01*
X1131462Y1233429D01*
X1124746Y1228493D01*
X1118814Y1222551D01*
X1113795Y1215594D01*
X1109821Y1207613D01*
X1107021Y1198597D01*
X1105527Y1188537D01*
X1105470Y1177423D01*
X1106978Y1165245D01*
X1110184Y1151993D01*
X1115218Y1137658D01*
X1122210Y1122230D01*
D17*
X61899Y2160354D03*
D16*
X61899Y2160354D03*
M02*

Maybe not 100% perfect compared to the FZ orig, but it’s not too bad in Gerbv and GerbView.

Does Gerbview give you any information about the condition of the file or did it just accept it the way it is?

The new gerber export does seem to me written in a much easier to understand way than the old one. In the old one I can not find a single place that deals with round pads but rather they are dealt with multiple times in multiple ways, in the new version it is clear.

This is the part of the new gerber generator that deals with round apertures. You can see how it builds the string that is returned. Now only if I understood Gerber format and object oriented programming I could make some changes.

    struct RoundAperture {
        RoundAperture(int id_):id(id_), diameter(0), holeX(0), holeY(0) {}
        double diameter;
        double holeX;
        double holeY;
        int id;

        void toDefinition(QTextStream &stream) const{
            stream << "%ADD" << QString::number(id) << "C," << QString::number(diameter);
            // don't be fooled, in gerber "X" is a separator, not an axis name.
            if (holeX) {
                stream << "X" << QString::number(holeX) ;
                if (holeY)
                    stream << "X" << QString::number(holeY);
            }
             stream << "*%\n";
        }

        bool operator==(const RoundAperture &e2) const
        {
            return diameter == e2.diameter && holeX == e2.holeX && holeY == e2.holeY;
        }
    };

With the warning I’m mostly ignorant about gerbers so my opinion is under informed, I think we want to make improvements to the new code if at all possible, both because it is a step forward and to encourage new developers (a lot of work went in to this update and I’d hate to see it die).

I’m not sure that gerbv is wrong here. As I understand it (which may not be that well) the input gerber is thought to not meet the standards. In that case the output from a gerber viewer is basically undefined. The desirable one is an error message saying the input file violates the gerber standard (if indeed it does), but visibly broken output to tell you something is wrong may be an easier in the code and an acceptable answer. Putting out an image that looks correct but may not be producable would be worse in my view.

Peter

If you have W7 64 here is the bin folder from new KiCad which contains Gerbview, and can be straight clicked to start. It saves the 750MB download because it is 75MB - I didn’t know what files I could strip -.

I work with Gerber RS-274x & ODB++ all day long. I very rarely see any RS-274d data here in the US. The best PCB data has flashed shapes for all the pads and uses traces that are made up of single lines widths defined by the d-codes. Polygons are normally only used for copper area and Power/Ground layers (if they are positively drawn).
You do NOT want all the data to be polygons. This would be a real pain for the CAM operator at any PCB shop.

I hope I am not miss understanding where this thread was going…

@DiodeDave Thank you for confirming what I feared. Someone wrote a new Gerber output with 6,000+ changes to the code and it does not comply with RS-274x standards.

Since you are here in the Fritzing forum I’ll assume you have used Fritzing 0.9.3b. Can you comment on the 0.9.3b’s Gerber output? From what I see of the output from 0.9.3b it look like the Pads/Rings are flashed shapes but I think the traces and copper fill are polygons. Would you consider 0.9.3b’s output acceptable?

sublimeartistry, Actually I have not yet used the Fritzing software so I can not really say much on it yet. I have wanted to try it out, but my play time is limited.

I loaded the “test2_copperTop.gtl” code into my favorite Gerber Viewer and it is totally made of polygons with no flashes. It is a single layer composed of 7 scratch layers (Positive, Negative layers combined). As shown in Old_Gray’s image

To me as a Fabricator… I would like this layer to be composed of 2 pads/flashes .0395" with the round trace .024" connecting the pads. the rest of the shield are could be polygons or filled.

  1. If the shield is filled it would normally only take 1 layer with no scratches needed.
  2. If the shield was a polygon I would expect the layer to have scratches. It would be something like the pads and traces on the top layer then a scratch to isolate the pads/traces then a third layer that is the outline polygon filled.

I am loading it now as I write this to check out your questions.

The current downloadable version of Fritzing 0.9.3b would be closer to what you would expect but the curved traces and copper fill are made up of what the code refers to as scan lines. This is lines that have been intersected with the on screen render. It results in the jagged edged Gerbers you can see in my 2nd post in this thread. But it does output the pad/flashes for all the exposed areas. Board shops are not the happiest with the current way so I would imagine they would refuse the new polygon way since it gives them even less information.

I have been studying the code to see if I can grasp how it used to be done to see if I can implement the pads/flashes with the new copper fill and curved traces since they are an improvement over the old. But as I have said before I am not a programmer and have very little experience with object oriented programming so it is slow going.

I would also like to say since this is your first time trying Fritzing it completely goes against the current EDA paradigm so you will be lost and confused looking for things you expect. Fritzing was written in a more intuitive way that lets you start where ever you want and you can switch between views while building your circuit and it is automatically added to the other views (note there is a bug that can cause issues if you work a lot in breadboard and then make changes in other views). It should also be said it is only a Beta release.

Well if there is anything Gerber related let me know and I would be happy to help. I have been working for a PCB MFG for more than 30 years. I was the Front End Engineering Manager (CAM Mgr) for many years. I have also done lamination, electrical test, AOI, Photo, LDI and many other duties before switching to IT department. I even took classes for PCB design several years ago.

Fritzing looks interesting, I will give it a try :wink:

@DiodeDave Welcome to Fritzing and thank you for your help.

I was really excited about this new gerber output and it was the only reason I figured out how to compile Fritzing. But unfortunately I keep finding even more bugs with the new output. My guess is the person that wrote the new Gerber output knew scalable graphics but not Gerber.

It is producing paste masks for through hole parts which you do not want.

It produces mirror layers in the gerber output which you do not need (I think you only want these for SVG and PDF output).

The drill sizes are wrong. (In Fritzing the via has a 0.015748" hole and the gerber drill file says T101C0.026559)

The paste mask is larger than the solder mask which is opposite of what you want.

Copper is yellow.
Red is solder mask.
Green is paste mask.

It is looking more and more like we need the old gerber export back and to find someone familiar with QT and Gerbers to take on making a new gerber export with the good qualities of both implementations. :sob:

1 Like

Hi all,

this is Patrick from AISLER (Fritzing Fab). We had a look at the new Gerber Export when it was first merged into the master branch on Github. As you already figured out it does not work reliable at all so we did a rollback to 0.9.3b.
IMHO a more iterative approach to the Gerber export would be more successful, e.g. improving the scan line behavior. If anyone is interested in this, we could organize a development branch and rollback of the master branch for this.

@DiodeDave do you mind having a look at the original gerber output and elaborate a little bit on what things we could improve?

Cheers,
Patrick

Hi Patrick,

Sure I would be happy to run the Gerber through the software that I have access to (Frontline Genesis/GenFlex, Insight and Pentalogix CAM Master). Just let me know where I can get the sample Gerber files to evaluate. :wink:

DiodeDave

@aisler I have managed to revert all the related commits for the new gerber https://github.com/Intrinsically-Sublime/fritzing-app/tree/Old-Gerber while keeping all the bug fixes from the last year+. I was planning to open an issue about the Gerber problems and also a pull request for the reversion.

@DiodeDave Would you like me to provide a sample? If not you could just download Fritzing and open one of the example sketches and export the gerber yourself http://fritzing.org/download .

2 Likes

Okay I have created an issue on Github for this https://github.com/fritzing/fritzing-app/issues/3375 and also a pull request to have the changes reverted until we can get it working properly. https://github.com/fritzing/fritzing-app/pull/3378 The more people we have comment on the issue and/or pull requests the more likely we can get things moving again. I can not see why we can’t at least get a new release with all the other bug fixes even if we do not get this major improvement.