vibesketcher.render.periodic¶
Publication figures of periodic structures (#189).
A figure is drawn from the validated PeriodicStructure, never from a picture: atoms (with display repeats and optional boundary completion), bonds found from covalent radii across cell boundaries, the outline of the cell’s periodic edges, the lattice vectors with their lengths, a Miller plane, the real-space Wigner-Seitz cell and, in a separate panel, the first Brillouin zone of the reciprocal lattice with b_i . a_j = 2 pi delta_ij. Display repeats are drawing only; they never change the model.
The camera looks along a stated direction: top (along -z), side
(along +y), front (along -x), isometric, a real-space direction
[uvw] or the normal of a plane (hkl). Screen axes are right-handed
(right x up = towards the viewer). Atom colours follow the Jmol scheme; radii
are RDKit’s covalent radii (Cordero et al., Dalton Trans. 2832 (2008)).
Functions
|
Screen right and up for a camera looking along |
|
SVG, or PDF/PNG through the publication extra. |
|
The figure as standalone SVG (UTF-8). |
|
Vertices (Cartesian) where the plane hx + ky + lz = 1 cuts the unit cell. |
|
The reciprocal lattice (rows b_i, 1/angstrom, b_i . |
|
The unit vector the camera looks along, in Cartesian angstrom space. |
Classes
|
What a periodic figure shows; every choice is stated, none inferred. |
Exceptions
The options ask for something this structure cannot show. |
- class vibesketcher.render.periodic.FigureOptions(*, view='top', direction=None, repeat=(1, 1, 1), complete_boundary=True, cell=True, vectors=True, bonds=True, labels='none', legend=True, scale_bar=True, plane=None, wigner_seitz=False, brillouin=False, heights=False, depth_cue=False, polyhedra=<factory>, layers=False, stacking=False, symmetry_elements=False, inplane_axes=False, symprec=0.001, atom_scale=0.45, width=520, title=None)[source]¶
Bases:
BaseModelWhat a periodic figure shows; every choice is stated, none inferred.
- Parameters:
view (Literal['top', 'side', 'front', 'isometric', 'uvw', 'hkl'])
complete_boundary (bool)
cell (bool)
vectors (bool)
bonds (bool)
labels (Literal['none', 'element', 'site', 'wyckoff'])
legend (bool)
scale_bar (bool)
wigner_seitz (bool)
brillouin (bool)
heights (bool)
depth_cue (bool)
layers (bool)
stacking (bool)
symmetry_elements (bool)
inplane_axes (bool)
- model_config = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- view: View¶
- labels: Literal['none', 'element', 'site', 'wyckoff']¶
- heights: bool¶
Schematic aids (#233); each is drawn from the unchanged 3D model. Heights of the atoms along the view, written beside them (atoms that coincide in projection share one label).
- symmetry_elements: bool¶
The space group’s symmetry elements in the projection, as in International Tables diagrams (views along a, b or c of a 3D crystal).
- exception vibesketcher.render.periodic.FigureRefused[source]¶
Bases:
ValueErrorThe options ask for something this structure cannot show.
- vibesketcher.render.periodic.view_direction(structure, options)[source]¶
The unit vector the camera looks along, in Cartesian angstrom space.
- Parameters:
structure (PeriodicStructure)
options (FigureOptions)
- Return type:
ndarray
- vibesketcher.render.periodic.camera(direction)[source]¶
Screen right and up for a camera looking along
direction.- Parameters:
direction (ndarray)
- Return type:
tuple[ndarray, ndarray]
- vibesketcher.render.periodic.plane_polygon(structure, hkl)[source]¶
Vertices (Cartesian) where the plane hx + ky + lz = 1 cuts the unit cell.
- Parameters:
structure (PeriodicStructure)
- Return type:
ndarray
- vibesketcher.render.periodic.reciprocal_structure(structure)[source]¶
The reciprocal lattice (rows b_i, 1/angstrom, b_i . a_j = 2 pi delta_ij) as a cell.
- Parameters:
structure (PeriodicStructure)
- Return type:
- vibesketcher.render.periodic.periodic_figure_svg(structure, options=None)[source]¶
The figure as standalone SVG (UTF-8).
- Parameters:
structure (PeriodicStructure)
options (FigureOptions | None)
- Return type:
- vibesketcher.render.periodic.periodic_figure(structure, options=None, fmt='svg', *, dpi=300)[source]¶
SVG, or PDF/PNG through the publication extra.
- Parameters:
structure (PeriodicStructure)
options (FigureOptions | None)
fmt (str)
dpi (int)
- Return type: