Creating Mesh using Quadtree and save it as x,y,w,h

How do I generate a mesh using a 3D numpy array (location and value like in a DEM [digital elevation model]) in Python and save it as x, y, w, h (center location, width, and height)?
I would like to create mesh using elevation variation in data as threshold like standard deviation.