vibe-sketcherDocumentation

vibesketcher.render.schematic

Schematic aids for periodic publication figures (#233).

Every function here reads the 3D model and returns drawing data; none of them changes a structure. The figure in vibesketcher.render.periodic uses them for heights, coordination polyhedra and slab layer schematics.

Functions

coordination(structure, centre, ...[, scale])

Cartesian positions of the atoms bonded to an atom at centre (all images).

fraction_text(value)

0, ½, ¼, 0.37: a height in the projection, as crystallographers write it.

heights(structure, positions, toward)

Height labels of the atoms toward the viewer, and what they measure.

hull_faces(points[, tolerance])

Faces (vertex indices, ordered around the face) of the convex hull of a few points.

stacking_letters(structure[, tolerance])

Stacking letter (A, B, C, ...) of each site's atomic plane in a slab.

view_period(structure, direction)

The shortest lattice vector along the view direction, if one exists (indices up to 6).

vibesketcher.render.schematic.view_period(structure, direction)[source]

The shortest lattice vector along the view direction, if one exists (indices up to 6).

Parameters:
Return type:

ndarray | None

vibesketcher.render.schematic.fraction_text(value)[source]

0, ½, ¼, 0.37: a height in the projection, as crystallographers write it.

Parameters:

value (float)

Return type:

str

vibesketcher.render.schematic.heights(structure, positions, toward)[source]

Height labels of the atoms toward the viewer, and what they measure.

Along a lattice direction the heights are fractions of that period; otherwise (for example across a slab’s vacuum) they are in angstrom above the lowest atom.

Parameters:
Return type:

tuple[list[str], str]

vibesketcher.render.schematic.hull_faces(points, tolerance=0.001)[source]

Faces (vertex indices, ordered around the face) of the convex hull of a few points.

Parameters:
  • points (ndarray)

  • tolerance (float)

Return type:

list[list[int]]

vibesketcher.render.schematic.coordination(structure, centre, centre_symbol, radius, scale=1.15)[source]

Cartesian positions of the atoms bonded to an atom at centre (all images).

Parameters:
Return type:

ndarray

vibesketcher.render.schematic.stacking_letters(structure, tolerance=0.3)[source]

Stacking letter (A, B, C, …) of each site’s atomic plane in a slab.

Planes are grouped by height along the normal; two planes get the same letter when their in-plane fractional positions coincide modulo the surface lattice.

Parameters:
Return type:

dict[str, str]