File: WriteImage

package info (click to toggle)
dxsamples 4.4.0-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 26,340 kB
  • sloc: ansic: 10,079; sh: 8,445; java: 1,772; makefile: 1,102
file content (25 lines) | stat: -rw-r--r-- 668 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
// Import the electron density field
electrondensity = Import("watermolecule");

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

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

// Create a camera
camera = AutoCamera(isosurface);

// Color the isosurface red
isosurface = Color(isosurface,"red");

// Make an image
image = Render(isosurface,camera);

// Write the image to the file "iso" at frame 0 (This will prevent
// subsequent runs of the script from appending more images to the file)
WriteImage(image,"isosurface",frame=0);

// Read the image and display
i=ReadImage("isosurface");
Display(i);