Cube

inside cube  x y z  side
outside cube x y z  side

An axis-aligned cube of the given side length, with (x,y,z) as its lower corner (matching Fortran Packmol; note this differs from box, whose first three numbers are also a corner but combined with a second corner rather than a side length).

Example

267 water molecules (about 1 g/mL) in a cube with sides of 20 Å, with a corner at the origin:

structure water.pdb
    number 267
    inside cube 0. 0. 0. 20.
end structure

The same system, packed with the Julia API and shown with the visualize function of PDBTools.jl:

using Packmol, PDBToolswater = structure_type("water.pdb";    number = 267,    constraints = [InsideCube([0., 0., 0.], 20.)],)system = PackmolSystem([water]; tolerance = 2.0, output = "cube.pdb")packmol(system)visualize(get_atoms(system);    unitcell = UnitCell([20., 20., 20.]),    rotate = [(:z, 30), (:x, -70)],)