File: AutoAxes

package info (click to toggle)
dxsamples 4.4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 26,348 kB
  • ctags: 1,513
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,101
file content (28 lines) | stat: -rw-r--r-- 1,115 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Import the data
electrondensity = Import("watermolecule");

// Partition the data
electrondensity = Partition(electrondensity);

// Create an isosurface at a value of 0.3
isosurface = Isosurface(electrondensity,0.3);

// Create a camera for the isosurface, looking roughly from the direction 
// [1 1 1]
camera = AutoCamera(electrondensity,"off-diagonal",width=12);

// Create some labels for the axes
labels = {"x direction", "y direction", "z direction"};

// Put axes around the isosurface, along with an additional frame around the
// front faces. Use the entire field to set the bounding box for the axes so
// that if the isovalue is changed, the axes box will remain the same.
// A grid is added, and the grid is colored red while the labels and
// ticks are colored yellow.
objectwithaxes = AutoAxes(isosurface,camera,labels,frame=1, 
                          corners=electrondensity, grid = 1,
                          colors = {"red", "yellow", "yellow"},
                          annotation = {"grid", "labels", "ticks"});

// Display the object with the added axes
Display(objectwithaxes,camera);