Skip to content

Commit

Permalink
Allow visualization of shapes in the structure viewer (#282)
Browse files Browse the repository at this point in the history
* Enable visualization of shapes in the structure viewer

Three kinds of shapes are available: ellipsoids, spheres and
custom shape defined by a list of vertices and indices/simplices.

Co-authored-by: Guillaume Fraux <[email protected]>
  • Loading branch information
rosecers and Luthaf authored Jul 25, 2023
1 parent 1476667 commit fb96b04
Show file tree
Hide file tree
Showing 15 changed files with 1,685 additions and 433 deletions.
1 change: 1 addition & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ overrides:
- '*.html.in'
options:
printWidth: 150
tabWidth: 3
26 changes: 26 additions & 0 deletions docs/src/tutorial/input-reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,32 @@ contains the following fields and values:
// a, b, and c are the unit cell vectors. All values are
// expressed in Angstroms.
"cell": [10, 0, 0, 0, 10, 0, 0, 0, 10],
// OPTIONAL: shapes to display on each site, if other than
// spheres. Multiple shapes groups with different names are
// supported.
//
// Each shape group should be an array of "size" elements,
// describing the different shapes.
"shapes": {
<name>: [
// Ellipsoid shapes, with the given `[ax, ay, az]` semi-axes
{"kind": "ellipsoid", "semiaxes": [1, 1, 2]},
// Each shape can contain an OPTIONAL "orientation",
// given as a `[x, y, z, w]` quaternion. Defaults to
// [0, 0, 0, 1]
{"kind": "ellipsoid", "semiaxes": [1, 1, 2], "orientation": [0, 0, 0, 1]},
// fully custom shape, from a list of vertices and
// simplices (also called "indices" in WebGL)
{
"kind": "custom",
"vertices": [[0, 0, 0], [1, 0, 0], [0, 1, 0]],
"indices": [[0, 1, 2]],
},
// more shapes as needed
...
],
}
},
// other structures as needed
...
Expand Down
2 changes: 2 additions & 0 deletions docs/src/tutorial/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ generate an output in chemiscope format.

.. autofunction:: chemiscope.librascal_atomic_environments

.. autofunction:: chemiscope.extract_lammps_shapes_from_ase

.. _ase: https://wiki.fysik.dtu.dk/ase/index.html
.. _ASAP: https://github.com/BingqingCheng/ASAP

Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions python/chemiscope/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from .structures import ( # noqa
all_atomic_environments,
composition_properties,
extract_lammps_shapes_from_ase,
extract_properties,
librascal_atomic_environments,
)
Expand Down
Loading

0 comments on commit fb96b04

Please sign in to comment.