new Model(atoms, parameters)
An object containing an Atomic structure and taking care of its periodic nature, allowing querying and selection, and so on.
Name | Type | Description |
---|---|---|
atoms | crystcif. | Atomic structure, in crystcif's Atoms format |
parameters | Object | Additional options:
|
Members
(readonly) all :ModelView
ModelView containing all the atoms of the image
- ModelView
(readonly) atoms :Array.<AtomImage>
Atom images in this model
- Array.<AtomImage>
(readonly) axes :AxesMesh
Graphical object representing the unit cell's axes
- AxesMesh
(readonly) box :BoxMesh
Graphical object representing the unit cell's box
- BoxMesh
(readonly) cell :Array.<Array>
Unit cell of the model's original cell
- Array.<Array>
(readonly) crystalLabels :Array.<String>
Crystallographic labels of each atom
- Array.<String>
(readonly) info :Object
Additional information from the model's original cell
- Object
(readonly) length :int
Number of atoms in this model's original cell
- int
(readonly) numbers :Array.<int>
Atomic numbers in this model's original cell
- Array.<int>
(readonly) pbc :Array.<bool>
Periodic boundary conditions
- Array.<bool>
(readonly) periodic :bool
Whether this model is periodic in all three directions of space
- bool
(readonly) positions :Array.<Array>
Coordinates of the atoms in this model's original cell
- Array.<Array>
renderer :Renderer
Renderer used for this model's graphics
- Renderer
(readonly) scaledPositions :Array.<Array>
Fractional coordinates of the atoms in this model's original cell
- Array.<Array>
(readonly) speciesIndices :Array.<int>
Indices of each atom by their species (e.g. C1, C2, H1, C3, H2, etc.)
- Array.<int>
(readonly) supercell :Array.<int>
Shape of the supercell for this model
- Array.<int>
(readonly) supercellGrid :Array.<Array>
Full grid of origin coordinates of the cells making up the supercell
- Array.<Array>
(readonly) symbols :Array.<String>
Chemical symbols in this model's original cell
- Array.<String>
(readonly) vdwElementScaling :Object
Table of scaling factors by element for Van der Waals radii
- Object
(readonly) vdwScaling :float
Global scaling factor for Van der Waals radii
- float
Methods
absToFrac(x) → {Array.<float>}
Convert absolute coordinates to fractional
Name | Type | Description |
---|---|---|
x | Array.<float> | Absolute coordinates |
Fractional coordinates
- Type:
- Array.<float>
addLink(from, to, name, label, parameters)
Add link drawn on model
Name | Type | Default | Description |
---|---|---|---|
from | Atom | | Starting point | |
to | Atom | | End point | |
name | String | link | Name to use for the link object |
label | String | null | Text label to add to the link |
parameters | Object | Additional parameters (see LineMesh) |
addSphere(center, radius, name, parameters)
Add a sphere drawn on model
Name | Type | Default | Description |
---|---|---|---|
center | Atom | | Center of the sphere | |
radius | float | Radius of the sphere | |
name | String | sphere | Name to use for the sphere object |
parameters | Object | Additional parameters (see EllipsoidMesh) |
clearGraphics()
Remove all graphical objects
deleteArray(name)
Delete an array from the underlying Atoms object
Name | Type | Description |
---|---|---|
name | String | Name of the array to delete |
find(query) → {ModelView}
Find a group of atoms based on a given query and return as AtomImages
Name | Type | Description |
---|---|---|
query | Array | A search query for atoms. Must use nested lists of types and arguments, and can use logic operators $and, $or and $xor. |
ModelView object for found atoms
- Type:
- ModelView
fracToAbs(fx) → {Array.<float>}
Convert fractional coordinates to absolute
Name | Type | Description |
---|---|---|
fx | Array.<float> | Fractional coordinates |
Absolute coordinates
- Type:
- Array.<float>
getArray(name) → {Array}
Retrieve an array from the underlying Atoms object
Name | Type | Description |
---|---|---|
name | String | Name of the array to retrieve |
Retrieved array
- Type:
- Array
hasArray(name) → {bool}
Check if an array exists in the underlying Atoms object
Name | Type | Description |
---|---|---|
name | String | Name of the array to check |
Whether the array exists
- Type:
- bool
minimumSupercell(r)
Compute and return the minimum supercell that guarantees containing all atoms at a maximum distance r from those in the [0,0,0] cell.
Name | Type | Description |
---|---|---|
r | float | Maximum distance that must be contained within the supercell |
removeGraphics(name)
Remove the graphical object with a given name
Name | Type | Description |
---|---|---|
name | String | Name of the graphical object to remove |
setArray(name, arr)
Set an array for the underlying Atoms object
Name | Type | Description |
---|---|---|
name | String | Name of the array to use |
arr | Array | Array to store |
view(indices) → {ModelView}
Create a new ModelView for this model, using a given list of indices
Name | Type | Description |
---|---|---|
indices | Array | Indices of atoms to include in the ModelView |
ModelView object for specified indices
- Type:
- ModelView