On Fri, 2011-04-01 at 20:04 -0400, Curtis C. Pope wrote: > DJ, > > I think with most polygon libraries, when you do a union, you can get > back the coordinates of where the overlap occurs. At that point, you > should be able to zoom in, or generate an image of the offending location. > > I haven't tried it yet, but thats my understanding. > > A couple of libraries and code samples that I have found with an initial > search are: > > http://www.cs.man.ac.uk/~toby/alan/software/
GPC is not open, and not GPL compatible. It is only free for non-commercial use. Please don't use it. > http://clippoly.sourceforge.net/ I believe PCB's clipper may have derived from this code. > http://sourceforge.net/projects/polyclipping/ This one was interesting in that the initial versions supported clipping of bezier edges. Supporting polygons with curve primitives in PCBs has long been a desire (even commented as such in the code), and has been an interest of mine for performance reasons. So far, I've not got around to it ;) > http://boolean.klaasholwerda.nl/bool.html "it is free to use for non commercial open source projects licensed as GPL." The non-commercial restriction in its self is not GPL compatible - please don't use it. The algorithms behind it are probably ok though. > http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Boolean_set_operations_2/Chapter_main.html The nice thing about this is its support for generalised geometry and circular arcs. > Perhaps PCB has some code in it that we can use as a starting point? Yes - PCB has some code in "polygon1.c" which implements boolean operations. There are some minor numerical issues with intersections with some pathological geometries, but in general it is good. Whilst its probably not the fastest polygon clipper in the world (the intersection finding routine isn't great)... I've done quite a bit of work on it to try and improve its dynamic performance, such as our use case in PCB when operating on existing polygons. (You start with a copper plane, then subtract various things from it - often there is a speed up you can achieve by pre-caching r-trees of existing contours) I've often thought it might be worth factoring out PCB's polygon library code and cleaning up the API for external use. KiCad uses a different boolean library from the ones you listed above (I think) - you might be interested to take a look exactly what it is. -- Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)
signature.asc
Description: This is a digitally signed message part
------------------------------------------------------------------------------ Create and publish websites with WebMatrix Use the most popular FREE web apps or write code yourself; WebMatrix provides all the features you need to develop and publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________ Gerbv-devel mailing list Gerbv-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gerbv-devel