Some more possible contour generating code links:
Hi Gary, thanks for the tips. Note that  appears to be GPLd and
we're looking for a routine with licenses as permissive as the
PSF/matplotlib license. I believe  and  are both pointing to
the same algorithm, by Paul Bourke - this one has a C++ implementation
that includes the following license restriction
Additionally, the authors grant permission to modify this software
and its documentation for any purpose, provided that such
modifications are not distributed without the explicit consent of
the authors and that existing copyright notices are retained in all
copies. Some of the algorithms implemented by this software are
patented, observe all applicable patent law.
Since this code implements the Bourke algorithm, I assume the other
implementations have the same patent restrictions, but I haven't taken
a close look.
 is released under the MPL -
http://www.mozilla.org/MPL/MPL-1.1.html, which as I understand has a
complex licensing history - it certainly takes a lawyer to read
through it - I'm not sure what the status is.
 is certainly as possibility, if as you say, we contact the author
and see if he is willing to release it to us.
Hopefully, all of this is moot, as I understand that STSci has been
working on a routine ripped from gist and Perry says they are close to
having a prototype. I still think it's worthwhile investigating
whether marching squares is patented or enforceable - Mr Horton's
response was not terribly enlightening.