Using the rotation options
Some of the tools that deal with creation and manipulation of crystal entities – asymmetric units, unit cells, blocks, domains and structures – allow rotation of these instances. These functions share a common options framework which will be elaborated on here.
"RotationAnchorReference" | describe the type of rotation anchors that will be used |
"RotationAnchorShift" | an optional translation of the anchor point(s) |
"RotationAxes" | define the three rotation axes to be used in 3D rotations |
"RotationMap" | maps domains to their respective rotation amounts |
An overview of the rotation options encountered in the relevant functions.
The functions that currently make use of the rotation options are:
DomainPlot | provides a visual plot of a domain representation |
EmbedStructure | embeds given units into a host system |
SynthesiseStructure | assembles a given domain to the represented structure |
The relevant functions along with short descriptions.
In[1]:= |
Anchors
By anchor we mean the particular point a rotation will be performed about. The first option, "RotationAnchorReference" enables us to choose between four general positions of the anchor(s):
"Host" | origin of the host structure |
"Domain" | origin of each domain's cell that is closest to the host's origin |
"DomainCentroid" | centroid of each domain |
"Unit" | origin of each unit |
All the possible settings of the "RotationAnchorReference" option and what they mean.
We will start an example using DomainPlot:
In[3]:= |
The anchor points defined above are produced internally by the functions, but not directly obtainable. They are therefore copied here. We will momentarily be using them to show graphically where they are.
In[4]:= |
If you need further control of where the anchors should be, use the option "RotationAnchorShift" to translate the anchor(s).
A practical example
Now that we're more familiar with the anchors, let us look at a more practical example. We will create two layers where the top sheet should be rotated. Then, we will synthesise the structure with graphene. First, let us make a general factory method that creates the layered domain:
The next step is to assemble this structure. Here we want to use graphene in both layers, but we need to create it first for our $CrystalData and expand it to one unit cell (which each block represents):
Finally, we synthesise the “domain structure”. We make use of the third parameter to replace all the domain identifiers (1's and 2's) with the label of the graphene unit cell. We use the same rotation options as above, and we see that the "RotationMap" still differentiates between the two domains.
The common auxiliary function
The functions that currently use the rotation options framework all rely internally on the "RotationTransformation" module of InputCheck. This procedure returns a TransformationFunction that in turn requires one or two parameters, depending on the dimensions and anchor reference type of input.
In this first example we create a two-dimensional domain to be used in the InputCheck function. It uses "Domain" anchor reference, so only the domain identifier is required at later input.
In this second example we use a three-dimensional structure instead and choose to rotate about each block as well. Thus, we specify both the domain and the point in order to get the transformation function back: