Slab Builder
************

The Slab Builder allows you to construct slabs from a crystal.


How to use the slab builder
===========================

1. **Start from a 3D periodic crystal** The Slab Builder operates on
   bulk crystals (3D periodic systems).

2. **Convert to the conventional cell (recommended)** In most cases,
   click **Convert To Conventional Cell** before setting Miller
   indices.

   Note:

     For many primitive non-conventional cells (for example primitive
     FCC/BCC settings), slab orientation from Miller indices is only
     correct after conversion to the conventional cell. If needed, use
     **Edit → Undo** to revert the conversion.

3. **Specify the number of layers** Set **Number of layers** to the
   desired slab thickness.

4. **Specify Miller indices** Enter Miller indices for the target
   surface:

   * Most lattices: 3-index **(h k l)**

   * Hexagonal lattices: 4-index **(h k i l)** with **h + k + i = 0**

5. **Generate Slab** Click **Generate Slab** to create the slab. You
   can click **Generate Slab** again to retry with different settings
   from the original structure loaded when opening the builder. Use
   **Close** to accept the current result and close the builder, or
   **Cancel** to discard changes.

After generating a slab, information about the result is shown in the
message area below the visualization (including the layer count and
number of atoms). The lattice vectors are updated.

If the current engine supports it, periodicity will switch to **2
(Slab)**.


Dry run
=======

Enable **Dry run** to generate and save the Python script without
running it. The script can serve as a starting point for running slab
generation from Python, or for inspecting the parameters and process
used to create the slab.
