Building adaptive meshes to approximate a subspace