X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Message-ID: <4F119E96.4060305@mcmahill.net> Date: Sat, 14 Jan 2012 10:26:14 -0500 From: Dan McMahill User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:8.0) Gecko/20111105 Thunderbird/8.0 MIME-Version: 1.0 To: geda-user AT delorie DOT com Subject: Re: [geda-user] Standalone DRC for Gerber files References: <57691326464791 AT web158 DOT yandex DOT ru> In-Reply-To: <57691326464791@web158.yandex.ru> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: geda-user AT delorie DOT com On 1/13/2012 9:26 AM, Dmitry Dzhus wrote: > Hello! > > I'm looking for a tool which would allow to perform design rule checking > for PCB files in Gerber format. Any ideas if the code from gEDA's pcb > can be used for that? At first glance it seems like pcb can only check > files of its own format and its code is tied with GUI. I need something > capable of doing batch testing. > > Any relevant book recommendations about how DRC is implemented in general, > since I think I'll start writing it if no suitable free software solution comes up? > pcb only checks a database in its own format. I think adding some ability to do checking with the gerbv program would be useful. I mention gerbv since that project already has a complete RS274-X parser. You may also find some useful ideas in the program called "boolean". Also you may want to look at "magic" which is an IC layout tool and see what DRC capabilities it has. If you were looking to write a more or less general purpose DRC engine it is most useful to have a programming interface that allows you to do various operations on layers such as grow/shrink, boolean operations like and/not/or/xor, etc. This would allow both a sort of standard drc deck to be written as well as allowing users to expand into more difficult tests. As an example, here is how you may do a rudimentary minimum spacing rule. // import top copper top = layer("top") // grow the layer and then shrink it back. If any copper // started to touch after the grow operation, then the gap // will not reappear after the shrink and we'll get a different // answer than we started with top2 = shrink( grow( top, 5 mil), 5 mil) top_min_gap_error = error("violated min spacing", xor(top, top2)) hope this makes sense. The boolean program offers some of these operations. No idea about magic. You'd probably need to do some work on how layers are represented in either pcb or gerbv to make it compatible with layer manipulation like this. -Dan