RenderableSimulationBox
Inherits Renderable
Renders a molecular dynamics simulation with multiple molecule types in a periodic boundary box. This can for example be used to show the distribution of different molecules or atoms in a specific spatial region, such as a planet’s atmosphere.
Multiple molecules can be provided and for each the path containing the structural data and the count of molecules has to be provided. Specifying the trajectory file that describes the movement of each individual molecule in its own relative frame, is optional.
Members
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
Average angular velocity at the start of the simulation (radians/s). |
|
Value of type ‘Double’ |
No |
|
Radius of the collision sphere around molecules. |
|
Value of type ‘Double’ |
No |
|
Average linear velocity at the start of the simulation (m/s). |
|
Value of type ‘Double’ |
No |
|
The list of files that are used to initiate this simulation box. |
|
No |
|
|
Size of the periodic simulation box. |
|
Value of type ‘Vector3 |
No |
|
Playback speed of the animation (in frames per second). |
|
Value of type ‘Double’ |
Yes |
|
Color of the circle outlining the simulation. |
|
Value of type ‘Vector4 |
Yes |
|
Falloff exponent of the circle outlining the simulation. |
|
Value of type ‘Double’ |
Yes |
|
Width of the circle outlining the simulation. |
|
Value of type ‘Double’ |
Yes |
|
Uniform, The color mapping for the atoms. |
|
In list { Cpk, AtomIndex, ResId, ResIndex, ChainId, ChainIndex, SecondaryStructure } |
Yes |
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
The filter used to remove parts of the dataset. |
|
Value of type ‘String’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0, 1) |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
The visual representation type to use for the molecule. |
|
In list { SpaceFill, Licorice, Ribbons, Cartoon } |
Yes |
|
Thickness of the atoms when using the Space Fill or Licorice representations. |
|
Value of type ‘Double’ |
Yes |
|
Adjust the speed of the simulation (seconds per second). |
|
Value of type ‘Double’ |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Inherited members from Renderable
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
Decides if the object should be dimmed (i.e. faded out) when the camera is in the sunny part of an atmosphere. |
|
Value of type ‘Boolean’ |
Yes |
|
Determines whether this object will be visible or not. |
|
Value of type ‘Boolean’ |
Yes |
|
This value determines the opacity of this renderable. A value of 0 means completely transparent. |
|
In range: ( 0, 1) |
Yes |
|
A value that specifies if the renderable should be rendered in the Background, Opaque, Pre-/PostDeferredTransparency, Overlay, or Sticker rendering step. |
|
In list { Background, Opaque, PreDeferredTransparent, Overlay, PostDeferredTransparent, Sticker } |
Yes |
|
A single tag or a list of tags that this renderable will respond to when setting properties. |
|
Value of type ‘Table’, or Value of type ‘String’ |
Yes |
|
The type of the renderable. |
|
Value of type ‘String’ |
Yes |
Table parameters for Molecules
The list of files that are used to initiate this simulation box.
Optional: No
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
|
Yes |
Table parameters for *
Optional: Yes
Name |
Documentation |
Type |
Description |
Optional |
|---|---|---|---|---|
|
How many of this type of molecule should be rendered in the simulation box. |
|
Greater or equal to: 0 |
No |
|
The path to a molecule file that contains the structural information for the molecule. |
|
Value of type ‘String’ |
No |
|
If provided, this trajectory file is used to move the individual atoms of the molecule. In addition, each molecule as a whole will be moving through the simulation box on a straight path, even if no trajectory file is provided. |
|
Value of type ‘String’ |
Yes |
Asset Examples
1local marsAsset = asset.require("scene/solarsystem/planets/mars/globe")
2
3
4
5local moleculeCO2 = asset.resource({
6 Name = "Molecule CO2",
7 Type = "HttpSynchronization",
8 Identifier = "molecule_dynamics_co2",
9 Version = 1
10})
11
12
13local Latitude = 58.5877
14local Longitude = 16.1924
15
16local MarsMolecules1km = {
17 Identifier = "MarsMolecules1km",
18 Parent = marsAsset.Mars.Identifier,
19 Transform = {
20 Translation = {
21 Type = "GlobeTranslation",
22 Globe = marsAsset.Mars.Identifier,
23 Latitude = Latitude,
24 Longitude = Longitude,
25 Altitude = 1000.0
26 }
27 },
28 Renderable = {
29 Type = "RenderableSimulationBox",
30 Molecules = {
31 {
32 MoleculeFile = moleculeCO2 .. "co2.arc",
33 TrajectoryFile = moleculeCO2 .. "co2.arc",
34 Count = 1
35 }
36 },
37 LinearVelocity = 10.0,
38 AngularVelocity = math.rad(60.0),
39 SimulationBox = { 100.0, 100.0, 100.0 },
40 CollisionRadius = 2.0,
41 AnimationSpeed = 100
42 },
43 Tag = { "molecule_visualization", "molecule_atmosphere" },
44 GUI = {
45 Name = "Mars 1km",
46 Path = "/Microcosmos/Atmosphere",
47 Description = [[Visualizes Mars' atmosphere at a height of approximately 1km above the
48 surface. As Mars' atmosphere almost exclusively consists of carbon dioxide, only
49 that molecule is shown in the simulation box at an approximate density.]]
50 }
51}
52
53
54asset.onInitialize(function()
55 openspace.addSceneGraphNode(MarsMolecules1km)
56end)
57
58asset.onDeinitialize(function()
59 openspace.removeSceneGraphNode(MarsMolecules1km)
60end)
61
62asset.export(MarsMolecules1km)
63
64
65
66asset.meta = {
67 Name = "Mars Atmosphere",
68 Description = [[Visualizes Mars' atmosphere at the molecular scale.]],
69 Author = "OpenSpace Team",
70 URL = "https://openspaceproject.com",
71 License = "MIT license"
72}