crystal-plot
Render a 4-panel crystal-structure figure from one input. Output is a PNG calibrated to the conventions used in Nature / PRX / Sci. Adv. structure figures.
Quick start
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" <input> -o out.png
<input> is one of:
- a structure file path: anything
ase.io.read accepts (.cif, POSCAR, .vasp, .xyz, .traj)
- a preset:
mx2:MoS2, mx2:WSe2:1T, bulk:Si, bulk:NaCl:rocksalt:5.64, graphene
The script writes the output path to stdout. Errors go to stderr and exit non-zero. Missing dependency exits with code 2; install with pip install --user ase.
Defaults
- supercell repeat:
3,3,1 if the cell has vacuum (> 6 Å along any axis), else 2,2,2
- perspective:
α = -55°, β = 210° so a → down-left, b → down-right, c → up
- bond cutoff:
1.15 × Σ(covalent radii)
- atom radius:
0.40 × covalent_radius
- cell box: dashed blue, perspective panel only
The defaults are calibrated; do not retune unless the user asks. See references/CONVENTIONS.md for the full rendering spec (palette, Phong shading, rotation matrix, depth scaling, tripod placement, bond-cutoff refinements for metals).
Options
-o, --out FILE output PNG (default: <stem>.png in cwd)
--repeat NX,NY,NZ supercell repeat (overrides auto-default)
--perspective AX,AZ tilt + azimuth in degrees (default: -55,210)
--bond-scale 1.15 bond cutoff = scale × Σr_cov
--radius-scale 0.40 atom radius = covalent_radius × scale
--no-cell-box omit the dashed cell box on the perspective panel
--dpi 240
--figsize 11,8
Examples
# 1H-MoS2 monolayer
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" mx2:MoS2 -o mos2.png
# Diamond Si, primitive 1×1×1 cell, no cell box
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" \
bulk:Si --repeat 1,1,1 --no-cell-box -o si.png
# Read a relaxed POSCAR with a custom tilt
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" \
POSCAR --perspective -45,210 -o relaxed.png
# CIF from Materials Project
python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" mp-2815.cif -o WSe2.png
Out of scope
- Interactive 3D viewer — use
ase gui or VESTA.
- Polyhedral rendering (perovskite octahedra, ZIF tetrahedra). Ball-and-stick only.
- Charge density / orbital isosurfaces. Use VESTA + a
.cube file.
1---2name: crystal-plot3description: Render a publication-quality 4-view crystal-structure figure (view ‖ a, view ‖ b, view ‖ c, perspective) as a single PNG. Use when the user asks to plot, draw, render, or visualize a crystal structure, atomic structure, or unit cell, or when they supply a structure file (CIF, POSCAR, .vasp, .xyz, .traj) or name a preset like 'mx2:MoS2', 'bulk:Si', 'graphene'. Korean triggers include 결정구조 플롯, 원자구조 그려, 구조 그림, 단위격자 plot, VESTA-like figure.4license: MIT5---67# crystal-plot89Render a 4-panel crystal-structure figure from one input. Output is a PNG calibrated to the conventions used in Nature / PRX / Sci. Adv. structure figures.1011## Quick start1213```bash14python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" <input> -o out.png15```1617`<input>` is one of:1819- a structure file path: anything `ase.io.read` accepts (`.cif`, `POSCAR`, `.vasp`, `.xyz`, `.traj`)20- a preset: `mx2:MoS2`, `mx2:WSe2:1T`, `bulk:Si`, `bulk:NaCl:rocksalt:5.64`, `graphene`2122The script writes the output path to stdout. Errors go to stderr and exit non-zero. Missing dependency exits with code 2; install with `pip install --user ase`.2324## Defaults2526- supercell repeat: `3,3,1` if the cell has vacuum (> 6 Å along any axis), else `2,2,2`27- perspective: `α = -55°, β = 210°` so a → down-left, b → down-right, c → up28- bond cutoff: `1.15 × Σ(covalent radii)`29- atom radius: `0.40 × covalent_radius`30- cell box: dashed blue, perspective panel only3132The defaults are calibrated; do not retune unless the user asks. See [references/CONVENTIONS.md](references/CONVENTIONS.md) for the full rendering spec (palette, Phong shading, rotation matrix, depth scaling, tripod placement, bond-cutoff refinements for metals).3334## Options3536```text37-o, --out FILE output PNG (default: <stem>.png in cwd)38--repeat NX,NY,NZ supercell repeat (overrides auto-default)39--perspective AX,AZ tilt + azimuth in degrees (default: -55,210)40--bond-scale 1.15 bond cutoff = scale × Σr_cov41--radius-scale 0.40 atom radius = covalent_radius × scale42--no-cell-box omit the dashed cell box on the perspective panel43--dpi 24044--figsize 11,845```4647## Examples4849```bash50# 1H-MoS2 monolayer51python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" mx2:MoS2 -o mos2.png5253# Diamond Si, primitive 1×1×1 cell, no cell box54python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" \55 bulk:Si --repeat 1,1,1 --no-cell-box -o si.png5657# Read a relaxed POSCAR with a custom tilt58python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" \59 POSCAR --perspective -45,210 -o relaxed.png6061# CIF from Materials Project62python3 "${CLAUDE_SKILL_DIR}/scripts/plot_crystal.py" mp-2815.cif -o WSe2.png63```6465## Out of scope6667- Interactive 3D viewer — use `ase gui` or VESTA.68- Polyhedral rendering (perovskite octahedra, ZIF tetrahedra). Ball-and-stick only.69- Charge density / orbital isosurfaces. Use VESTA + a `.cube` file.