Create a particle from a material and a form factor:
particle = ba.Particle(material, formfactor)
To put independent particles on a layer, wrap the particle in a 2D structure and deposit or suspend that structure:
structure = ba.Dilute2D(density, particle)
layer = ba.Layer(material, thickness)
layer.deposit2D(structure)
For particles with spatial correlations, use structures such as
Crystal1D, Crystal2D, FiniteCrystal2D, or RadialParacrystal instead
of Dilute2D.
deposit2D places the bottom of the particle structure at the layer’s bottom
interface. suspend2D places the top of the structure at the layer’s top
interface.
For non-default placement, translate the particle before adding it to a structure:
particle.translate(0, 0, z_shift)
If z_shift > 0, then the particle is translated upwards.
The particle in the above code snippet can be a simple or a composite
particle.
To create a simple particle, use
particle = ba.Particle(material, formfactor)
For the constructor arguments, see sections Material and Formfactor.
To create a composed particle, see
Magnetization is supported as a material property.
To translate any particle, simple or composite, use either the vectorial form
from bornagain import R3
translation = R3(x, y, z)
particle.translate(translation)
or
particle.translate(x, y, z)
To change the orientation, use code like
rotation = ba.RotationEuler(alpha, beta, gamma)
rotation = ba.RotationX(angle) # alternative
particle.rotate(rotation)
For more information on the argument, see Rotation.
Translations and rotations may be applied in any order. They are commutative.