Generic contour/isosurface extraction code generator for ndarrays