File: Color

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 (29 lines) | stat: -rw-r--r-- 932 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

     // Import the data
electrondensity = Import("watermolecule");
     // Partition the data
electrondensity = Partition(electrondensity);
     // Create a camera appropriate for the data
camera = AutoCamera(electrondensity,"off-diagonal",width=3); 
     // Create an isosurface at a value of 0.3 
iso = Isosurface(electrondensity,0.3);
     // Color the isosurface red, and give it an opacity of 0.3
iso = Color(iso,"red",opacity=0.3);
     // Display the result
Display(iso,camera);


     // Color the isosurface "red", change the opacity back to 1.0, and
     // apply the colors only to the front faces
iso = Color(iso,"red",opacity=1,component="front colors");
     // Color the back faces grey
iso = Color(iso,"grey",component="back colors");
     // Create a ClipPlane. By default it will pass through the center of 
     // the isosurface
clipped = ClipPlane(iso);
     // Display the result
Display(clipped,camera);