X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com From: geda AT psjt DOT org (Stephan =?utf-8?Q?B=C3=B6ttcher?=) To: "Peter Clifton \(petercjclifton\@googlemail.com\) \[via geda-user\@delorie.com\]" Subject: Re: [geda-user] Re: Delivery Status Notification (Failure) References: <001a1134f920c49e910527d3a068 AT google DOT com> Date: Sun, 27 Dec 2015 16:15:21 +0100 In-Reply-To: (Peter Clifton's message of "Sat, 26 Dec 2015 15:22:04 -0600") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk "Peter Clifton (petercjclifton AT googlemail DOT com) [via geda-user AT delorie DOT com]" writes: > Focus on within-layer clearances for now. > > Any more complex design rules (such as dielectric breakdown through > the layer stack) requires more data than we have in PCB's data-model, > and may actually belong in a separate calculation utility that would > calculate out a geometric design rule that can be applied in PCB. I am playing with the idea to build a DRC tool that works on the gerber output, using libgerbv and the clipper library (C++) http://angusj.com/delphi/clipper.php I have made Python bindings for importing gerbers into clipper polygon data structures, perform bloating/shrinking and clipping operations. Design rules would be specified as boolean operations on suitably bloated layer data, and anything left in the end is a violation. An example that I have working now: from pyclipper import Clipper, gerbv, OffsetPolygons proj = gerbv.project() proj.load("v01.front.gbr") proj.load("v01.plated-drill.cnc") scale=10000 raw = proj[0].polygons(scale) drill = proj[1].polygons(scale) clip = Clipper() clip.clear() clip.addsubject(raw) # clean up, and remove keyholes routing = OffsetPolygons(clip.union(),1) # require 12 mil annuklar rings annular = OffsetPolygons(drill, 120) clip.clear() clip.addsubject(annular) clip.addclip(routing) annular = clip.difference() Any polygon left in annular is a violation. For net specific rules I'd need to add some input that gives for each net at least one coordinate (per relevant layer). And some code to find the polygon at the given coordinate. Some rules, like clearance checks, require iterations over the individual ploygons in a layer. At that point they could be tagged with a netname by the given coordinates. And then there could be overrides of bloat values for specifiv nets. I plot the ploygons with gnuplot right now. A gerber export may be usefull to visualize the violations in gerbv. Or some gui. -- Stephan