CoCalc Public FilesQMSE02-2018-01-16 / fcc.ipynbOpen with one click!
Author: Hal Snyder
Views : 88
Description: simple face centered cubic 3D lattice figures
Compute Environment: Ubuntu 18.04 (Deprecated)

Lattice Visualization

CoCalc lets you build 3D models of lattice structure that can be rotated to see periodicity along different vectors. The two figures in this worksheet provide simple movable examples of face centered cubic structures.

Face-centered cubic lattice is one of the 14 possible Bravais lattices in 3 dimensions.

References:

In [1]:
from sage.plot.plot3d.shapes import Sphere
In [2]:
def fcc(obj=Sphere(.7, color='red'), offset=None): """ return a list of 3D objects for face centered cubic lattice corner at origin cube edge 10 units offset is a triple offseting the lattice in x, y, z directions """ S = [] ofx = ofy = ofz = 0 if offset is not None: ofx, ofy, ofz = offset # corners for ix in [0,10]: for iy in [0,10]: for iz in [0,10]: S.append(obj.translate(ix, iy, iz)) # object at center of each of 6 faces # for each axis, add object at 0 and 10 on that axis and 5,5 on other axes S.append(obj.translate(0, 5, 5)) S.append(obj.translate(10, 5, 5)) S.append(obj.translate(5, 0, 5)) S.append(obj.translate(5, 10, 5)) S.append(obj.translate(5, 5, 0)) S.append(obj.translate(5, 5, 10)) return S
In [3]:
# Display part of a simple face-centered cubic lattice # https://ecee.colorado.edu/~bart/book/bravais.htm#fcc S = sum(fcc()) S.show(viewer='threejs', online=True)
In [4]:
# for zinc blende, the unit of the lattice is ZnS # https://ecee.colorado.edu/~bart/book/bravais.htm#zincblen q = 5*sqrt(2) - 10 ZnS = Sphere(.6, color='red') + Sphere(.5, color='cyan').translate(q, q, q) lattice = fcc(ZnS) sum(lattice).show(viewer='threejs', online=True)