-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Draw a plane that is defined by the miller indices and distance from the origin or by selecting the atoms.
- Loading branch information
1 parent
1152b9e
commit 619a418
Showing
18 changed files
with
467 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Lattice plane | ||
================= | ||
|
||
The lattice plane is a plane that intersects the lattice. It is useful to visualize the lattice plane in the crystal structure. | ||
|
||
Plane form miller indices | ||
-------------------------- | ||
The lattice plane can be defined by the miller indices and distance from the origin or by selecting the atoms. | ||
|
||
Here is an example of how to visualize lattice planes (111): | ||
|
||
.. code-block:: python | ||
from ase.build import bulk | ||
from weas_widget import WeasWidget | ||
import numpy as np | ||
atoms = bulk("Au", cubic=True) | ||
viewer = WeasWidget() | ||
viewer.from_ase(atoms) | ||
viewer.avr.model_style = 1 | ||
viewer.camera.setting = {"direction": [0, -0.2, 1], "zoom": 0.8} | ||
viewer | ||
In another cell: | ||
|
||
.. code-block:: python | ||
# color is defined by RGBA, where R is red, G is green, B is blue, and A is the transparency | ||
viewer.avr.lp.add_plane_from_indices(name = "111", | ||
indices = [1, 1, 1], | ||
distance = 4, | ||
scale = 1.0, | ||
color = [0, 1, 1, 0.5]) | ||
viewer.avr.lp.build_plane() | ||
.. figure:: _static/images/lattice_plane.png | ||
:align: center | ||
|
||
|
||
Plane from selected atoms | ||
-------------------------- | ||
One can also draw a plane from the selected atoms. Here is an example: | ||
|
||
|
||
.. code-block:: python | ||
viewer.avr.lp.add_plane_from_selected_atoms(name = "plane1", | ||
color = [1, 0, 0, 0.5]) | ||
viewer.avr.lp.build_plane() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build" | |
|
||
[project] | ||
name = "weas_widget" | ||
version = "0.1.1" | ||
version = "0.1.2" | ||
description = "A widget to visualize and interact with atomistic structures in Jupyter Notebook." | ||
authors = [{name = "Xing Wang", email = "[email protected]"}] | ||
readme = "README.md" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.