File: System

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 (26 lines) | stat: -rw-r--r-- 836 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
// Import the electron density field
electrondensity = Import("watermolecule");

// create a camera 
camera = AutoCamera(electrondensity,resolution=300,aspect=1,width=2.5);


// This macro creates an isosurface at the given isovalue, creates a caption
// for the image, and writes an image to a file.  The System module is used
// to compress the image before going on to write the next one.
macro makeiso(isoval)
{
    isosurface = Isosurface(electrondensity, isoval);
    caption = Format("isoval = %g",isoval);
    caption = Caption(caption);
    imagename = Format("iso%4.2f.rgb",isoval);
    collected = Collect(caption,isosurface);
    image = Render(collected,camera);
    Display(image);
    WriteImage(image,imagename,frame=0);
    command = Format("compress %s",imagename);
    System(command);
}

makeiso(0.1);
makeiso(0.3);