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: "Nicklas Karlsson \(nicklas.karlsson17\@gmail.com\) \[via geda-user\@delorie.com\]" Subject: Re: [geda-user] Re: DRC clearance work in progress References: <001a1134f920c49e910527d3a068 AT google DOT com> <20151227173145 DOT 4f52bd9239ac5e14b8966e07 AT gmail DOT com> Date: Sun, 27 Dec 2015 17:55:36 +0100 In-Reply-To: <20151227173145.4f52bd9239ac5e14b8966e07@gmail.com> (Nicklas Karlsson's message of "Sun, 27 Dec 2015 17:31:45 +0100") 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 "Nicklas Karlsson (nicklas DOT karlsson17 AT gmail DOT com) [via geda-user AT delorie DOT com]" writes: >> "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. > > Great! > > I think your work will would be useful within pcb to. > > Simple scale will give a little bit to large distance value in outer > corner, attached picture, there need to be a circle segment but it > could be fixed later at any point and to large distance is usually > less of a problem than to small distance. Currently my Python bindings only support circle segments, but the Clipper library can do other corner handling as well :-) > Nicklas Karlsson -- Stephan