#
new Model(atoms, parameters)
An object containing an Atomic structure and taking care of its periodic
nature, allowing querying and selection, and so on.
Parameters:
Name |
Type |
Description |
atoms |
crystcif.Atoms
|
Atomic structure, in crystcif's Atoms format |
parameters |
Object
|
Additional options:
supercell
molecularCrystal (if true, load full molecules in central unit cell)
useNMRActiveIsotopes (if true, all isotopes are set by default to the most common
one with non-zero spin)
vdwScaling (scale van der Waals radii by a constant factor)
vdwElementScaling (table of per-element factors to scale VdW radii by)
|
Members
#
(readonly) all :ModelView
ModelView containing all the atoms of the image
#
(readonly) atoms :Array.<AtomImage>
Atom images in this model
#
(readonly) axes :AxesMesh
Graphical object representing the unit cell's axes
#
(readonly) box :BoxMesh
Graphical object representing the unit cell's box
#
(readonly) cell :Array.<Array>
Unit cell of the model's original cell
#
(readonly) crystalLabels :Array.<String>
Crystallographic labels of each atom
#
(readonly) info :Object
Additional information from the model's original cell
#
(readonly) length :int
Number of atoms in this model's original cell
#
(readonly) numbers :Array.<int>
Atomic numbers in this model's original cell
#
(readonly) pbc :Array.<bool>
Periodic boundary conditions
#
(readonly) periodic :bool
Whether this model is periodic in all three directions of space
#
(readonly) positions :Array.<Array>
Coordinates of the atoms in this model's original cell
#
renderer :Renderer
Renderer used for this model's graphics
#
(readonly) scaledPositions :Array.<Array>
Fractional coordinates of the atoms in this model's original cell
#
(readonly) speciesIndices :Array.<int>
Indices of each atom by their species (e.g. C1, C2, H1, C3, H2, etc.)
#
(readonly) supercell :Array.<int>
Shape of the supercell for this model
#
(readonly) supercellGrid :Array.<Array>
Full grid of origin coordinates of the cells making up the supercell
#
(readonly) symbols :Array.<String>
Chemical symbols in this model's original cell
#
(readonly) vdwElementScaling :Object
Table of scaling factors by element for Van der Waals radii
#
(readonly) vdwScaling :float
Global scaling factor for Van der Waals radii
Methods
#
absToFrac(x) → {Array.<float>}
Convert absolute coordinates to fractional
Parameters:
Name |
Type |
Description |
x |
Array.<float>
|
Absolute coordinates |
Returns:
-
Type
-
Array.<float>
#
addLink(from, to, name, label, parameters)
Parameters:
Name |
Type |
Default |
Description |
from |
Atom
|
Array
|
|
Starting point |
to |
Atom
|
Array
|
|
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
Parameters:
Name |
Type |
Default |
Description |
center |
Atom
|
Array
|
|
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
Parameters:
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
Parameters:
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. |
Returns:
ModelView object for found atoms
-
Type
-
ModelView
#
fracToAbs(fx) → {Array.<float>}
Convert fractional coordinates to absolute
Parameters:
Name |
Type |
Description |
fx |
Array.<float>
|
Fractional coordinates |
Returns:
-
Type
-
Array.<float>
#
getArray(name) → {Array}
Retrieve an array from the underlying Atoms object
Parameters:
Name |
Type |
Description |
name |
String
|
Name of the array to retrieve |
#
hasArray(name) → {bool}
Check if an array exists in the underlying Atoms object
Parameters:
Name |
Type |
Description |
name |
String
|
Name of the array to check |
#
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.
Parameters:
Name |
Type |
Description |
r |
float
|
Maximum distance that must be contained within the supercell |
#
removeGraphics(name)
Remove the graphical object with a given name
Parameters:
Name |
Type |
Description |
name |
String
|
Name of the graphical object to remove |
#
setArray(name, arr)
Set an array for the underlying Atoms object
Parameters:
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
Parameters:
Name |
Type |
Description |
indices |
Array
|
Indices of atoms to include in the ModelView |
Returns:
ModelView object for specified indices
-
Type
-
ModelView