{ "cells": [ { "cell_type": "markdown", "id": "31ff2524", "metadata": {}, "source": [ "# Boundary mode\n", "\n", "The ``boundary`` key is used to show image atoms outside the cell. The default value is `[[0, 1], [0, 1], [0, 1]]`, thus no atoms outside the cell will be shown.\n", "\n", "It has two purposes:\n", "\n", " - For the visualization of a crystal, one usually shows the atoms on the unit cell boundary.\n", " - In the DFT calculation, the periodic boundary condition (PBC) is very common. When editing a structure, one may want to see the how the PBC image atoms change.\n" ] }, { "cell_type": "code", "execution_count": null, "id": "e7d6dbf1", "metadata": {}, "outputs": [], "source": [ "from weas_widget import WeasWidget\n", "from ase.io import read\n", "\n", "atoms = read(\"../../examples/tio2.cif\")\n", "viewer = WeasWidget()\n", "viewer.from_ase(atoms)\n", "viewer.avr.model_style = 1\n", "viewer" ] }, { "cell_type": "markdown", "id": "bcf250a1", "metadata": {}, "source": [ "Show the atoms on the unit cell:" ] }, { "cell_type": "code", "execution_count": null, "id": "55e6947d", "metadata": {}, "outputs": [], "source": [ "viewer = WeasWidget()\n", "viewer.from_ase(atoms)\n", "viewer.avr.model_style = 1\n", "viewer.avr.boundary = [[-0.1, 1.1], [-0.1, 1.1], [-0.1, 1.1]]\n", "viewer" ] }, { "cell_type": "markdown", "id": "cfcb3a3c", "metadata": {}, "source": [ "Show the atoms on the unit cell:" ] }, { "cell_type": "code", "execution_count": null, "id": "d43c94a3", "metadata": {}, "outputs": [], "source": [ "viewer = WeasWidget()\n", "viewer.from_ase(atoms)\n", "viewer.avr.model_style = 1\n", "viewer.avr.boundary = [[-1, 2], [-1, 2], [-1, 2]]\n", "viewer" ] } ], "metadata": { "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 5 }