+++
title = "Mesocrystal"
weight = 80
+++

## Mesocrystal particle

A mesocrystal is a crystal-like grain, defined by an internal crystal lattice
and an outer shape.

The `Mesocrystal` object is created via

```python
meso = ba.Mesocrystal(crystal, outer_shape)
```

and requires the objects `crystal` and `outer_shape` to be defined.

`outer_shape` is a hard form factor describing the shape and size of the
mesocrystal:

```python
outer_shape = ba.Cylinder(20*nm, 50*nm)
```

`crystal` is built from the basis particle and a 3D lattice:

```python
# Basis particle
inner_ff = ba.Sphere(3*nm)
basis = ba.Particle(material, inner_ff)

# 3D lattice
lattice = ba.Lattice3D(
    ba.R3(8*nm, 0, 0),
    ba.R3(0, 8*nm, 0),
    ba.R3(0, 0, 8*nm),
)

# Crystal
crystal = ba.Crystal(basis, lattice)
```

Alternatively, `basis` can be not just a simple particle, but also another
composition:

```python
basis = ba.Compound()
```

or

```python
basis = ba.CoreAndShell(core, shell)
```

or even

```python
basis = ba.Mesocrystal(crystal_node, outer_shape_node)
```

[Example](/ref/sample/particle/ex/mesocrystal-particle)
