Skip to content

Plugin CIF Viewer

Hiromichi Yokoyama edited this page Aug 11, 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
Author HiroYokoyama
Supported OS Windows, macOS, Linux, WSL
Supported Python >=3.9, <3.15
Menu location View ▸ CIF Viewer Panel (dock panel) + .cif file opener + Thermal Ellipsoids 3D style
Extra dependencies pymatgen, RDKit, PyQt6, PyVista, NumPy

See Official Plugins for the full catalogue.


1. Overview

Opening or dragging in a .cif file docks a control panel with five tabs: Structure, Info, 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. Info tab

Read-only, selectable crystallographic metadata parsed from the CIF file, grouped into three boxes:

Group Fields
Crystal & Unit Cell space group (name and number), crystal system, cell a/b/c/α/β/γ, volume, Z, Z', density, μ, F(000)
Data Collection temperature, wavelength, crystal size, θ range, hkl ranges, reflections collected/unique, R(int), completeness
Refinement refinement method, number of reflections/parameters/restraints, GOOF, R1, wR2, R1 (all data), wR2 (all data), max shift, Flack parameter, difference peak/hole

Any field the CIF does not provide reads N/A. A Simulate Powder Pattern (XRD)... button (enabled once a structure is loaded) opens a separate dialog that computes and plots a simulated powder X-ray diffraction pattern from the current structure — if a disorder variant is selected on the Structure tab, the simulation uses that variant.


4. 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.


5. 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.


6. 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.

7. 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. Check the Info tab for the parsed space group, cell parameters, and refinement statistics.
  3. 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.
  4. Switch to the Thermal Ellipsoids style from the Ellipsoids tab if you want displacement-ellipsoid rendering, and tune the probability level and hydrogen scale.
  5. Use Cell / Axes to show the unit cell box and align the camera along a crystallographic axis for a publication view.
  6. Export CIF if you want to save the currently rendered supercell as a new file, or Simulate Powder Pattern (XRD) from the Info tab for a diffraction comparison.

8. See also


This page documents CIF Viewer v1.3.0, and was written on 2026-08-05. See REGISTRY/plugins.json for the current version.

Clone this wiki locally