Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Multi-Cell Overview

Render a grid of finished structures side-by-side with synchronised rotation. Useful for comparing how the same material looks across the full disorder spectrum, or for showing several materials at once.

Usage

import atomode as am

cells = []
for name in ["liquid", "amorphous", "SRO", "MRO",
             "LRO", "nanocrystalline"]:
    cell = am.Supercell.from_atoms(atoms, (40, 40, 40), rng_seed=42)
    cell.generate(shell_target, **am.Supercell.PRESETS[name])
    cells.append((cell, name))

am.export_overview_html("silicon_overview.html", cells)

Each entry in cells_and_labels is a (Supercell, label) pair. Labels are rendered as text badges in the top-left corner of each panel.

Features

Parameters

ParameterDefaultDescription
output_pathrequiredFile path for the generated HTML.
cells_and_labelsrequiredIterable of (Supercell, label) pairs.
grid_cols3Number of columns in the grid. Rows are inferred.
atom_scale0.18Multiplier on each atom’s covalent radius.
bond_radius0.07Bond cylinder radius in Å.
bond_color(0.95, 0.1, 0.1)RGB bond colour in [0, 1].
background_color"#f7f8f5"CSS colour for the viewport.
title""Unused; text should go in the surrounding page.
subtitle""Unused; text should go in the surrounding page.
bond_cutoff_scale1.2Bond search cutoff = shell_target.pair_peak × bond_cutoff_scale.
max_bonds_per_atom4Maximum bonds kept per atom before the angular filter.
bond_length_tol0.10Accept bonds within ±tol of the ideal first-neighbour distance.
ideal_angle_deg109.47Ideal angle for the tetrahedral check (Si-like).
bond_angle_tol_deg18.0Maximum deviation of any pairwise angle from the ideal.
tetrahedra / octahedra / cuboctahedraNoneSingle-group polyhedra config (one kind per scene). Dict of detector keys (center_symbol, vertex_symbol, bond_length, bond_length_tol, ideal_angle_deg, angle_tol_deg, scale).
polyhedra_groupsNoneMulti-group polyhedra: list of dicts, each with a kind{"triangles", "tetrahedra", "octahedra", "cuboctahedra"} plus the single-group keys. Use for carbon-style sp²/sp³ blends where both triangles and tetrahedra must render in the same scene.

For a non-tetrahedral material, set ideal_angle_deg and bond_angle_tol_deg appropriately, or disable the angular filter by setting bond_angle_tol_deg to a large value (e.g. 90).

Multi-group polyhedra (carbon sp²/sp³)

For materials with a phase mix, pass a polyhedra_groups list so each group runs its own detector and renders with its own colour. Each group may also carry virtual_species=N to restrict detection to atoms flagged with that shell-target species index (see Supercell.generate(..., grain_sources=...)):

am.export_overview_html(
    "carbon_overview.html",
    cells,
    polyhedra_groups=[
        dict(kind="triangles",   center_symbol="C", vertex_symbol="C",
             bond_length=1.42, ideal_angle_deg=120.0, angle_tol_deg=22.0,
             virtual_species=0, scale=0.5,
             color=(0.25, 0.65, 0.35), opacity=0.85),   # sp² green
        dict(kind="tetrahedra",  center_symbol="C", vertex_symbol="C",
             bond_length=1.54, ideal_angle_deg=109.47, angle_tol_deg=22.0,
             virtual_species=1, scale=0.5,
             color=(0.20, 0.30, 0.75), opacity=0.65),   # sp³ navy
    ],
)

The triangles kind emits a 4-vertex motif [centre, j, k, l] rendered as three sub-triangles all anchored at the centre ((i, j, k), (i, k, l), (i, l, j)), so the mesh always touches the parent atom even at unequal bond lengths after relax.