MeshOnlyVisible/MeshOnlyEmpty does not protect entities of higher dimension
mesh.generate(d) destroys meshes of all entities with dimension > d, even if they are not visible and are not bounded by any visible entity (and MeshOnlyVisible is True).
mesh.generate(d) destroys meshes of all entities with dimension > d, even if they are not visible and are not bounded by any visible entity (and MeshOnlyVisible is True).