Skip to content

Plugin CIF Viewer

Hiromichi Yokoyama edited this page Aug 5, 2026 · 4 revisions

Plugin: CIF Viewer

CIF Viewer is a visualization-only crystal-structure viewer for .cif files: unit-cell and supercell rendering, thermal-ellipsoid display, and disorder-aware bonding, built on pymatgen for parsing (falling back to a built-in parser if pymatgen is unavailable).

  • Repository: moleditpy_cif_viewer
  • Current version: 1.3.0
  • Requirements: pymatgen, RDKit, PyQt6, PyVista, NumPy. Windows/macOS/Linux/WSL, Python >=3.9, <3.15.
  • Menu location: View ▸ CIF Viewer Panel (a dock panel), plus a registered .cif file opener and a "Thermal Ellipsoids" 3D rendering style.

See Official Plugins for the full catalogue.


1. Overview

Opening or dragging in a .cif file docks a control panel with four tabs: Structure, Supercell, Ellipsoids, and Cell/Axes. The plugin registers its own 3D style ("Thermal Ellipsoids") so you can switch between standard ball-and-stick and ellipsoid rendering from the main app's style selector.


2. Structure tab

  • File loader showing the current filename.
  • A structure-selector table for CIFs containing multiple structures.
  • A summary box: unit-cell atom count, currently-rendered atom count, inferred bond count, and the current supercell repetition.
  • Export CIF — writes the currently rendered supercell (including any duplicated/connectivity-fixed atoms) back out as a new .cif file.

3. Supercell tab

  • Three spinboxes for a/b/c repetitions (range 0.1–8, default 1), each with independent +1/-1/+0.1/-0.1 step buttons. A decimal repetition produces a geometric slab clipped flush at both faces — this is intentional, not a rendering bug: a molecule straddling a cut face is cut along with it.
  • Keep Molecules Connected — auto-completes molecules that would otherwise be split across a cell boundary.
  • Show Bonds and Show Hydrogen Atoms toggles.
  • Reset Supercell (back to 1×1×1) and one-click 2×2×2 / 3×3×3 presets.

Bond detection uses an uncapped cutoff (base covalent-radius sum + a tolerance, default 0.45 Å) rather than a fixed distance ceiling, so heavy-element solids are no longer left unbonded. Sites with different disorder groups (e.g. a mixed Fe/Co occupancy site) are never bonded to each other, since bond inference explicitly checks each atom's occupancy/disorder_group/disorder_assembly before pairing.


4. Ellipsoids tab

Controls for the Thermal Ellipsoids rendering style:

  • Show Circles toggle, with a color picker (default black) and width spinbox (1–10, default 2) for the ellipsoid outline circles.
  • Probability % spinbox (1.0–99.9%, default 50.0%) — the standard crystallographic displacement-ellipsoid probability level.
  • Fix Hydrogen Atom Size toggle with an H Scale (%VDW) spinbox (1–100%, default 20%), since CIF files rarely refine anisotropic displacement parameters for hydrogen.
  • Switch to Ellipsoids Style button, which also updates the main toolbar's style checkmark.

If a non-CIF molecule becomes active while the Thermal Ellipsoids style is selected, the viewer automatically falls back to Ball-and-Stick rather than erroring.


5. Cell/Axes tab

  • Show Unit Cell toggle, and an opt-in Scale Cell Box to Supercell checkbox (by default the drawn box always represents a single 1×1×1 cell, even when the supercell is larger).
  • Individual a/b/c Axes toggle, with axis width (1–12, default 5), a font dropdown (arial/courier/times), and font size (8–48, default 20).
  • Five color pickers: axis A, axis B, axis C, cell edges, and the origin sphere.
  • A 2×3 grid of view-direction buttons (a, b, c, -a, -b, -c) for one-click crystallographic camera alignment.

6. Typical workflow

  1. Open a .cif file (File ▸ Import or drag-and-drop — the .cif opener is registered automatically) — the CIF Viewer panel docks itself.
  2. On the Supercell tab, set the a/b/c repetitions you need, toggle Keep Molecules Connected if working with a polymeric or extended structure, and adjust bonds/hydrogen visibility.
  3. Switch to the Thermal Ellipsoids style from the Ellipsoids tab if you want displacement-ellipsoid rendering, and tune the probability level and hydrogen scale.
  4. Use Cell/Axes to show the unit cell box and align the camera along a crystallographic axis for a publication view.
  5. Export CIF if you want to save the currently rendered supercell as a new file.

7. See also

Clone this wiki locally