I have used the slab generator without problem in pymatgen in the past, but found that while I could specify a minimum vacuum size, I could not actually specify it. I found that I could do so using ase and translated back and forth from pymatgen to ase to pymatgen, but I was curious is there is a simpler way to control the size of the vacuum layer in pymatgen from the start. The SlabGenerator seems to only allow fixed values of the vacuum and since I want to construct an amorphous cell with a particular density, I need to control the volume of the vacuum region.
from pymatgen.core.structure import Structure, Lattice
from pymatgen.core.periodic_table import Element
lattice_constant = 2.989
lattice = Lattice.from_parameters(lattice_constant,lattice_constant,lattice_constant,90.,90.,90.)
structure = Structure.from_spacegroup("Fm-3m",lattice,[{"Ar":1}],[[0.,0.,0.]])
structure.make_supercell((4,4,1))
import ase as ase
from ase.build import surface, bulk
from pymatgen.io.ase import AseAtomsAdaptor
ase_structure = AseAtomsAdaptor.get_atoms(structure) # convert the pymatgen structure to an ASE object
ase_surface = surface(ase_structure,(0,0,1),layers=1,vacuum=0) # define a slab using the Ar cell
ase_surface.set_cell([structure.lattice.a,structure.lattice.b,structure.lattice.c+length]) # make the vacuum gap
newstructure = AseAtomsAdaptor.get_structure(ase_surface) # convert the structure back to a pymatgen object