Automatic boundary sizing for 2D and 3D meshes