Sphere

inside sphere  x y z  radius
outside sphere x y z  radius

A sphere of the given radius centered at (x,y,z).

Example

242 water molecules (about 1 g/mL) in a sphere with a radius of 12 Å:

structure water.pdb
    number 242
    inside sphere 0. 0. 0. 12.
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 = 242,    constraints = [InsideSphere([0., 0., 0.], 12.)],)system = PackmolSystem([water]; tolerance = 2.0, output = "sphere.pdb")packmol(system)visualize(get_atoms(system);    rotate = [(:z, 30), (:x, -70)],)