On Tue, Jun 19, 2012 at 12:06 PM, Alexander Crosby <ACrosby@asascience.com> wrote:
The code below is a stripped down version of the way i am implementing a
clip operation, but it is slow and memory inefficient. Is there a way to
do this without looping or just faster, perhaps with a
PolygonCollection?

I have code that finds the perimeter path of a triangulation like this,
but it turns out that my topology is not well formed enough for it to
work. Is there a hidden matplotlib method to combine or dissolve
Polygons/Patches?

Thanks,
Alex


I have found the Shapely library to be 2-4 times faster in performing topology related operations out-of-the-box than my own hand-optimized utilizations of matplotlib internals (of course, combining my optimizations with shapely yielded insanely fast performance, but at a loss of generality).  It would require re-working of your existing code, but if performance is the bottle-neck, shapely is the way to go.

Cheers!
Ben Root