File: Slab

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 (33 lines) | stat: -rw-r--r-- 1,063 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
29
30
31
32
33
// Import the electron density field
electrondensity = Import("watermolecule");
box = ShowBox(electrondensity);

// Partition for parallelism
electrondensity = Partition(electrondensity);

// Create a camera
camera = AutoCamera(electrondensity,"off-top",width = 5);

// Color the entire volume
colored = AutoColor(electrondensity);

// Create a slab, in the y dimension, starting at position element 30, of
// thickness 0 (a plane)
slab = Slab(colored,1,30,0);
// Display the slab with the bounding box of the data
collected = Collect(box,slab);
Display(collected,camera);

// Create a slab, in the z dimension, starting a position element 10, of
// thickness 0
slab = Slab(colored,2,10,0);
// Display the slab with the bounding box of the data
collected = Collect(box,slab);
Display(collected,camera);

// Create a slab, in the y dimension, starting a position element 10, of
// thickness 40 elements. This is a volume.
slab = Slab(colored,1,10,40);
// Display the slab with the bounding box of the data
collected = Collect(box,slab);
Display(collected,camera);