Upgrading the DRC bot to handle negative pours, etc

Can this be done? It seems that a number of packages are starting to use negative areas in copper pours, and the current bot just can’t handle the awesomeness of it all.

Any idea when the next revision of the bot is going to handle these, so I can stop obsessing over designs sent back that show only a fraction of the traces?

Just curious…

Thanks

-dave

I shot the batchpcb guy a PM about this a while ago, but didn’t hear back.

Regarding the DRC bot code - most parts of the gerber parsing and interpretation frontend; and a large chunk of the shape-generation code is copyright myself, having been written for my own use before I joined SparkFun, the rest - DRC Checking, macros, and many frontend bug fixes being (C) Sparkfun, because I did it while I was working there. When I left SFE [SFE is great, but I like Canada ;)] I was given permission to put the whole of the codebase up as open source under the GPLv2, but I should check again with Nathan to see if he’s still up for that.

In my own time before I left, I had started writing a DRC Bot V2 - using the same gerber parsing / interpreting frontend as the original DRC bot, but using polygon-based DRC violation detection, rather than a set of primitives with operations for testing for violations.

If anyone else interested in helping to update the software, I can check with SparkFun to see if they’re still OK with GPLing the code, and to see if they’d be interested in implementing it once updated. Personally, I’d be interested in working on it as an open source project - as there isn’t really an open source design-rule-check solution out there.

[P.S - I pity whoever at SFE has to maintain that gerber parsing frontend - it has a lot of hacks in it due to the “flexibility” of the gerber file format].

–David Carne

Iiiiinteresting. It makes sense though. The gerber format is a mess of quasi-standardization. I pity anyone who tries to be all things to all inputs.

Hopefully someone who’s good at grokking code will step up. Unfortunately, I mainly program with solder.

Thanks

-dave

busonerd:
I shot the batchpcb guy a PM about this a while ago, but didn’t hear back.

Regarding the DRC bot code - most parts of the gerber parsing and interpretation frontend; and a large chunk of the shape-generation code is copyright myself, having been written for my own use before I joined SparkFun, the rest - DRC Checking, macros, and many frontend bug fixes being (C) Sparkfun, because I did it while I was working there. When I left SFE [SFE is great, but I like Canada ;)] I was given permission to put the whole of the codebase up as open source under the GPLv2, but I should check again with Nathan to see if he’s still up for that.

In my own time before I left, I had started writing a DRC Bot V2 - using the same gerber parsing / interpreting frontend as the original DRC bot, but using polygon-based DRC violation detection, rather than a set of primitives with operations for testing for violations.

If anyone else interested in helping to update the software, I can check with SparkFun to see if they’re still OK with GPLing the code, and to see if they’d be interested in implementing it once updated. Personally, I’d be interested in working on it as an open source project - as there isn’t really an open source design-rule-check solution out there.

[P.S - I pity whoever at SFE has to maintain that gerber parsing frontend - it has a lot of hacks in it due to the “flexibility” of the gerber file format].

–David Carne

I’m curious, what programming language was the software written in?

-Dave Pollum

First bot was written in a mix of C / C++.

Bot V2 [not in service] was done in C++ / Python [using boost.python to bind the C modules], python used for overall flow control.

If anyone is interested in more technical details, I’ll write up a longer post detailing the internals; but its been a while, and my memory is rusty, so I’d have to dive into the code. Reply if you’re interested and I’ll do so.

–David Carne

FreePCB also uses negative gerber draws when a board layer has a copper pour. For a little while right after the shift to the updated BatchPCB web-site, the web-site was displaying my designs correctly while the DRC bot showed solid areas for the copper poor and over sized traces. Since then one of the updates to the web-site has partially broken the display of my gerbers. (no change in the DRC bot)

While this is anoying, once my design was manually passed through DRC it was manufactured exactly as I expected.

Sincerely,

Lawson

Could someone please post some Gebers that use these negative pours? I think I’ve handled them correctly in the code for my parser and renderer, but it would be nice to test some “real” files.

BTW, the parser is written in 100% managed (safe) C#, and I’ve verified it works nicely with Mono.

Here is a (negative) ground plane for one of my four-layer boards:

G04 GENERATED BY PULSONIX 5.0 GERBER.DLL 3467*
%INDK-01*%
%FSLAX25Y25*%
%IPPOS*%
%LPD*%
%OFA0B0*%
%MOIN*%
%ADD100C,0.07200*%
%ADD101C,0.03200*%
%ADD102C,0.03700*%
%AMT103*0 Thermal pad*7,0,0,0.05000,0.02000,0.00500,0*%
%ADD103T103*%
%AMT104*0 Thermal pad*7,0,0,0.05500,0.02500,0.00500,0*%
%ADD104T104*%
%ADD105C,0.11436*%
%ADD106C,0.07200*%
%AMT107*0 Thermal pad*7,0,0,0.09000,0.06000,0.00500,0*%
%ADD107T107*%
%AMT108*0 Thermal pad*4,1,38,-0.00250,0.03000,-0.01250,0.03000,-0.01547,0.02985,-0.01841,0.02941,-0.02129,0.02868,-0.02409,0.02767,-0.02677,0.02639,-0.02931,0.02485,-0.03169,0.02306,-0.03388,0.02105,-0.03586,0.01883,-0.03761,0.01642,-0.03911,0.01386,-0.04035,0.01115,-0.04132,0.00834,-0.04200,0.00545,-0.04240,0.00250,-0.05743,0.00250,-0.05709,0.00607,-0.05646,0.00960,-0.05556,0.01308,-0.05438,0.01646,-0.05294,0.01975,-0.05123,0.02291,-0.04929,0.02592,-0.04710,0.02877,-0.04470,0.03143,-0.04210,0.03390,-0.03930,0.03615,-0.03634,0.03817,-0.03322,0.03995,-0.02997,0.04147,-0.02661,0.04273,-0.02317,0.04372,-0.01965,0.04443,-0.01609,0.04486,-0.01250,0.04500,-0.00250,0.04500,-0.00250,0.03000,0*4,1,38,-0.04240,-0.00250,-0.04200,-0.00545,-0.04132,-0.00834,-0.04035,-0.01115,-0.03911,-0.01385,-0.03761,-0.01642,-0.03586,-0.01883,-0.03388,-0.02104,-0.03169,-0.02306,-0.02931,-0.02484,-0.02677,-0.02639,-0.02409,-0.02767,-0.02129,-0.02868,-0.01841,-0.02941,-0.01547,-0.02985,-0.01250,-0.03000,-0.00250,-0.03000,-0.00250,-0.04500,-0.01250,-0.04500,-0.01608,-0.04486,-0.01965,-0.04443,-0.02316,-0.04372,-0.02661,-0.04273,-0.02997,-0.04147,-0.03322,-0.03995,-0.03634,-0.03817,-0.03930,-0.03615,-0.04209,-0.03390,-0.04470,-0.03143,-0.04710,-0.02877,-0.04928,-0.02592,-0.05123,-0.02291,-0.05293,-0.01975,-0.05438,-0.01647,-0.05556,-0.01308,-0.05646,-0.00961,-0.05709,-0.00607,-0.05743,-0.00250,-0.04240,-0.00250,0*4,1,38,0.00250,-0.03000,0.01250,-0.03000,0.01547,-0.02985,0.01841,-0.02941,0.02129,-0.02868,0.02409,-0.02767,0.02677,-0.02639,0.02931,-0.02485,0.03169,-0.02306,0.03388,-0.02105,0.03586,-0.01883,0.03761,-0.01642,0.03911,-0.01386,0.04035,-0.01115,0.04132,-0.00834,0.04200,-0.00545,0.04240,-0.00250,0.05743,-0.00250,0.05709,-0.00607,0.05646,-0.00960,0.05556,-0.01308,0.05438,-0.01646,0.05294,-0.01975,0.05123,-0.02291,0.04929,-0.02592,0.04711,-0.02877,0.04470,-0.03143,0.04210,-0.03390,0.03930,-0.03615,0.03634,-0.03817,0.03322,-0.03995,0.02997,-0.04147,0.02661,-0.04273,0.02317,-0.04372,0.01965,-0.04443,0.01609,-0.04486,0.01250,-0.04500,0.00250,-0.04500,0.00250,-0.03000,0*4,1,38,0.04240,0.00250,0.04200,0.00545,0.04132,0.00834,0.04035,0.01115,0.03911,0.01385,0.03761,0.01642,0.03586,0.01883,0.03388,0.02105,0.03169,0.02306,0.02931,0.02484,0.02677,0.02639,0.02409,0.02767,0.02129,0.02868,0.01841,0.02941,0.01547,0.02985,0.01250,0.03000,0.00250,0.03000,0.00250,0.04500,0.01250,0.04500,0.01608,0.04486,0.01965,0.04443,0.02316,0.04372,0.02661,0.04273,0.02997,0.04147,0.03322,0.03995,0.03634,0.03817,0.03930,0.03615,0.04209,0.03390,0.04470,0.03143,0.04710,0.02877,0.04928,0.02592,0.05123,0.02291,0.05293,0.01975,0.05438,0.01647,0.05556,0.01308,0.05646,0.00961,0.05709,0.00607,0.05743,0.00250,0.04240,0.00250,0*%
%ADD108T108*%
%ADD109O,0.09700X0.07200*%
%ADD110C,0.16200*%
%ADD111C,0.01700*%
%AMT130*0 Thermal pad*7,0,0,0.13236,0.10236,0.00500,0*%
%ADD130T130*%
X0Y0D02*
D02*
D100*
X600Y394301D02*
X315561D01*
Y600*
X600*
Y394301*
X315561*
Y600*
X600*
Y394301*
D02*
D101*
X47588Y213435D03*
Y238435D03*
X50088Y273435D03*
X97588Y140935D03*
X130088D03*
X140088Y303435D03*
X212588Y238435D03*
X215088Y383435D03*
D02*
D102*
X57338Y91435D03*
X78338Y170185D03*
X106838Y173935D03*
X124088Y257935D03*
X125588Y86185D03*
X126338Y272935D03*
X127088Y177685D03*
X136838Y289435D03*
X137588Y173935D03*
Y269185D03*
Y273685D03*
X141338Y212935D03*
X142088Y173935D03*
X144338Y103435D03*
X146588Y173935D03*
Y226435D03*
X148088Y273685D03*
X153338Y223435D03*
X157088Y159685D03*
X160088Y188185D03*
Y273685D03*
X163088Y183685D03*
X163838Y175435D03*
X164588Y273685D03*
X167588Y98935D03*
Y159685D03*
Y210685D03*
X170588Y183685D03*
X173588Y117685D03*
X175838Y181435D03*
X180338Y191935D03*
Y196435D03*
X182588Y262435D03*
Y273685D03*
X186338Y280435D03*
X196838Y233935D03*
X211838Y169435D03*
X253088Y259435D03*
Y300685D03*
X261338Y274435D03*
X263588Y188185D03*
X264338Y179935D03*
X265838Y193435D03*
X269588Y259435D03*
X271838Y212935D03*
X272588Y255685D03*
X274088Y161185D03*
X274838Y262435D03*
X300338Y155935D03*
X303338Y245935D03*
D02*
D103*
X46338Y204685D03*
X47588Y228435D03*
X50088Y283435D03*
X85088Y143435D03*
X110088Y93435D03*
X115088Y333435D03*
X130088Y303435D03*
X145088Y140935D03*
X199675Y218848D03*
X200088Y208435D03*
X212588Y228435D03*
X265088Y333435D03*
D02*
D104*
X163088Y295435D03*
D02*
D105*
X115766Y351022D03*
D02*
D106*
X128002Y40994D03*
X138002Y30994D03*
Y40994D03*
X148002Y30994D03*
Y40994D03*
X158002Y30994D03*
Y40994D03*
X168002D03*
X187588Y303435D03*
X197588D03*
Y333435D03*
X207588Y303435D03*
Y333435D03*
X217588Y303435D03*
Y333435D03*
X227588Y303435D03*
Y333435D03*
X237588Y303435D03*
Y333435D03*
X247588Y303435D03*
Y333435D03*
D02*
D107*
X128002Y30994D03*
X168002D03*
X187588Y333435D03*
D02*
D108*
X284694Y41387D03*
X294694D03*
D02*
D109*
X284694Y51387D03*
Y61387D03*
Y71387D03*
Y81387D03*
Y91387D03*
Y101387D03*
Y111387D03*
Y121387D03*
Y131387D03*
Y141387D03*
Y151387D03*
Y161387D03*
Y171387D03*
Y181387D03*
Y191387D03*
Y201387D03*
Y211387D03*
Y221387D03*
Y231387D03*
Y241387D03*
Y251387D03*
Y261387D03*
Y271387D03*
Y281387D03*
Y291387D03*
Y301387D03*
Y311387D03*
Y321387D03*
Y331387D03*
Y341387D03*
Y351387D03*
X294694Y51387D03*
Y61387D03*
Y71387D03*
Y81387D03*
Y91387D03*
Y101387D03*
Y111387D03*
Y121387D03*
Y131387D03*
Y141387D03*
Y151387D03*
Y161387D03*
Y171387D03*
Y181387D03*
Y191387D03*
Y201387D03*
Y211387D03*
Y221387D03*
Y231387D03*
Y241387D03*
Y251387D03*
Y261387D03*
Y271387D03*
Y281387D03*
Y291387D03*
Y301387D03*
Y311387D03*
Y321387D03*
Y331387D03*
Y341387D03*
Y351387D03*
D02*
D110*
X304694Y21387D03*
Y371387D03*
D02*
D111*
X175296Y422078D02*
X215796D01*
Y428778*
X175296*
Y422078*
G36*
X215796*
Y428778*
X175296*
Y422078*
G37*
D02*
D130*
X131174Y359219D03*
X143169Y362222D03*
X0Y0D02*
M02*

Leon

Here is a (negative) ground plane for one of my four-layer boards:

G04 GENERATED BY PULSONIX 5.0 GERBER.DLL 3467*
%INDK-01*%
%FSLAX25Y25*%
%IPPOS*%
%LPD*%
%OFA0B0*%
%MOIN*%
%ADD100C,0.07200*%
%ADD101C,0.03200*%
%ADD102C,0.03700*%
%AMT103*0 Thermal pad*7,0,0,0.05000,0.02000,0.00500,0*%
%ADD103T103*%
%AMT104*0 Thermal pad*7,0,0,0.05500,0.02500,0.00500,0*%
%ADD104T104*%
%ADD105C,0.11436*%
%ADD106C,0.07200*%
%AMT107*0 Thermal pad*7,0,0,0.09000,0.06000,0.00500,0*%
%ADD107T107*%
%AMT108*0 Thermal pad*4,1,38,-0.00250,0.03000,-0.01250,0.03000,-0.01547,0.02985,-0.01841,0.02941,-0.02129,0.02868,-0.02409,0.02767,-0.02677,0.02639,-0.02931,0.02485,-0.03169,0.02306,-0.03388,0.02105,-0.03586,0.01883,-0.03761,0.01642,-0.03911,0.01386,-0.04035,0.01115,-0.04132,0.00834,-0.04200,0.00545,-0.04240,0.00250,-0.05743,0.00250,-0.05709,0.00607,-0.05646,0.00960,-0.05556,0.01308,-0.05438,0.01646,-0.05294,0.01975,-0.05123,0.02291,-0.04929,0.02592,-0.04710,0.02877,-0.04470,0.03143,-0.04210,0.03390,-0.03930,0.03615,-0.03634,0.03817,-0.03322,0.03995,-0.02997,0.04147,-0.02661,0.04273,-0.02317,0.04372,-0.01965,0.04443,-0.01609,0.04486,-0.01250,0.04500,-0.00250,0.04500,-0.00250,0.03000,0*4,1,38,-0.04240,-0.00250,-0.04200,-0.00545,-0.04132,-0.00834,-0.04035,-0.01115,-0.03911,-0.01385,-0.03761,-0.01642,-0.03586,-0.01883,-0.03388,-0.02104,-0.03169,-0.02306,-0.02931,-0.02484,-0.02677,-0.02639,-0.02409,-0.02767,-0.02129,-0.02868,-0.01841,-0.02941,-0.01547,-0.02985,-0.01250,-0.03000,-0.00250,-0.03000,-0.00250,-0.04500,-0.01250,-0.04500,-0.01608,-0.04486,-0.01965,-0.04443,-0.02316,-0.04372,-0.02661,-0.04273,-0.02997,-0.04147,-0.03322,-0.03995,-0.03634,-0.03817,-0.03930,-0.03615,-0.04209,-0.03390,-0.04470,-0.03143,-0.04710,-0.02877,-0.04928,-0.02592,-0.05123,-0.02291,-0.05293,-0.01975,-0.05438,-0.01647,-0.05556,-0.01308,-0.05646,-0.00961,-0.05709,-0.00607,-0.05743,-0.00250,-0.04240,-0.00250,0*4,1,38,0.00250,-0.03000,0.01250,-0.03000,0.01547,-0.02985,0.01841,-0.02941,0.02129,-0.02868,0.02409,-0.02767,0.02677,-0.02639,0.02931,-0.02485,0.03169,-0.02306,0.03388,-0.02105,0.03586,-0.01883,0.03761,-0.01642,0.03911,-0.01386,0.04035,-0.01115,0.04132,-0.00834,0.04200,-0.00545,0.04240,-0.00250,0.05743,-0.00250,0.05709,-0.00607,0.05646,-0.00960,0.05556,-0.01308,0.05438,-0.01646,0.05294,-0.01975,0.05123,-0.02291,0.04929,-0.02592,0.04711,-0.02877,0.04470,-0.03143,0.04210,-0.03390,0.03930,-0.03615,0.03634,-0.03817,0.03322,-0.03995,0.02997,-0.04147,0.02661,-0.04273,0.02317,-0.04372,0.01965,-0.04443,0.01609,-0.04486,0.01250,-0.04500,0.00250,-0.04500,0.00250,-0.03000,0*4,1,38,0.04240,0.00250,0.04200,0.00545,0.04132,0.00834,0.04035,0.01115,0.03911,0.01385,0.03761,0.01642,0.03586,0.01883,0.03388,0.02105,0.03169,0.02306,0.02931,0.02484,0.02677,0.02639,0.02409,0.02767,0.02129,0.02868,0.01841,0.02941,0.01547,0.02985,0.01250,0.03000,0.00250,0.03000,0.00250,0.04500,0.01250,0.04500,0.01608,0.04486,0.01965,0.04443,0.02316,0.04372,0.02661,0.04273,0.02997,0.04147,0.03322,0.03995,0.03634,0.03817,0.03930,0.03615,0.04209,0.03390,0.04470,0.03143,0.04710,0.02877,0.04928,0.02592,0.05123,0.02291,0.05293,0.01975,0.05438,0.01647,0.05556,0.01308,0.05646,0.00961,0.05709,0.00607,0.05743,0.00250,0.04240,0.00250,0*%
%ADD108T108*%
%ADD109O,0.09700X0.07200*%
%ADD110C,0.16200*%
%ADD111C,0.01700*%
%AMT130*0 Thermal pad*7,0,0,0.13236,0.10236,0.00500,0*%
%ADD130T130*%
X0Y0D02*
D02*
D100*
X600Y394301D02*
X315561D01*
Y600*
X600*
Y394301*
X315561*
Y600*
X600*
Y394301*
D02*
D101*
X47588Y213435D03*
Y238435D03*
X50088Y273435D03*
X97588Y140935D03*
X130088D03*
X140088Y303435D03*
X212588Y238435D03*
X215088Y383435D03*
D02*
D102*
X57338Y91435D03*
X78338Y170185D03*
X106838Y173935D03*
X124088Y257935D03*
X125588Y86185D03*
X126338Y272935D03*
X127088Y177685D03*
X136838Y289435D03*
X137588Y173935D03*
Y269185D03*
Y273685D03*
X141338Y212935D03*
X142088Y173935D03*
X144338Y103435D03*
X146588Y173935D03*
Y226435D03*
X148088Y273685D03*
X153338Y223435D03*
X157088Y159685D03*
X160088Y188185D03*
Y273685D03*
X163088Y183685D03*
X163838Y175435D03*
X164588Y273685D03*
X167588Y98935D03*
Y159685D03*
Y210685D03*
X170588Y183685D03*
X173588Y117685D03*
X175838Y181435D03*
X180338Y191935D03*
Y196435D03*
X182588Y262435D03*
Y273685D03*
X186338Y280435D03*
X196838Y233935D03*
X211838Y169435D03*
X253088Y259435D03*
Y300685D03*
X261338Y274435D03*
X263588Y188185D03*
X264338Y179935D03*
X265838Y193435D03*
X269588Y259435D03*
X271838Y212935D03*
X272588Y255685D03*
X274088Y161185D03*
X274838Y262435D03*
X300338Y155935D03*
X303338Y245935D03*
D02*
D103*
X46338Y204685D03*
X47588Y228435D03*
X50088Y283435D03*
X85088Y143435D03*
X110088Y93435D03*
X115088Y333435D03*
X130088Y303435D03*
X145088Y140935D03*
X199675Y218848D03*
X200088Y208435D03*
X212588Y228435D03*
X265088Y333435D03*
D02*
D104*
X163088Y295435D03*
D02*
D105*
X115766Y351022D03*
D02*
D106*
X128002Y40994D03*
X138002Y30994D03*
Y40994D03*
X148002Y30994D03*
Y40994D03*
X158002Y30994D03*
Y40994D03*
X168002D03*
X187588Y303435D03*
X197588D03*
Y333435D03*
X207588Y303435D03*
Y333435D03*
X217588Y303435D03*
Y333435D03*
X227588Y303435D03*
Y333435D03*
X237588Y303435D03*
Y333435D03*
X247588Y303435D03*
Y333435D03*
D02*
D107*
X128002Y30994D03*
X168002D03*
X187588Y333435D03*
D02*
D108*
X284694Y41387D03*
X294694D03*
D02*
D109*
X284694Y51387D03*
Y61387D03*
Y71387D03*
Y81387D03*
Y91387D03*
Y101387D03*
Y111387D03*
Y121387D03*
Y131387D03*
Y141387D03*
Y151387D03*
Y161387D03*
Y171387D03*
Y181387D03*
Y191387D03*
Y201387D03*
Y211387D03*
Y221387D03*
Y231387D03*
Y241387D03*
Y251387D03*
Y261387D03*
Y271387D03*
Y281387D03*
Y291387D03*
Y301387D03*
Y311387D03*
Y321387D03*
Y331387D03*
Y341387D03*
Y351387D03*
X294694Y51387D03*
Y61387D03*
Y71387D03*
Y81387D03*
Y91387D03*
Y101387D03*
Y111387D03*
Y121387D03*
Y131387D03*
Y141387D03*
Y151387D03*
Y161387D03*
Y171387D03*
Y181387D03*
Y191387D03*
Y201387D03*
Y211387D03*
Y221387D03*
Y231387D03*
Y241387D03*
Y251387D03*
Y261387D03*
Y271387D03*
Y281387D03*
Y291387D03*
Y301387D03*
Y311387D03*
Y321387D03*
Y331387D03*
Y341387D03*
Y351387D03*
D02*
D110*
X304694Y21387D03*
Y371387D03*
D02*
D111*
X175296Y422078D02*
X215796D01*
Y428778*
X175296*
Y422078*
G36*
X215796*
Y428778*
X175296*
Y422078*
G37*
D02*
D130*
X131174Y359219D03*
X143169Y362222D03*
X0Y0D02*
M02*

Leon

This is a little surface mount design I made using FreePCB and copper planes. FreePCB uses negative draws on any layer with a copper plane.

https://mywebspace.wisc.edu/lawson2/spa … aw_gerber/ On the linked page “Digital buffer.zip” contains gerbers. (top_copper.grb and bottom_copper.grb have the negative draws) While the .png files are what I think each layer should look like.

Also, FreePCB labels gerbers and drill files differently. The project name is a directory, so the file name is used to specify what layer each file is. .grb and .drl is then used to diffrentiate gerber and drill files.

Thanks,

Lawson

Sorry, the web site was playing up and my post got duplicated.

Leon

Ouch. I’m 0 for 2 on these designs – looks like I have some homework to do. Thanks for the samples.

cp - I’m actually working on getting an open-source release of the DRCBot together as we speak. I’ve gotten permission from SFE, and I’ve found the latest copy of the code. I’m in the middle of porting it to GEOS, rather than its own half-written polygon clipper.

–David Carne