File: interop

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 (36 lines) | stat: -rw-r--r-- 1,211 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
34
35
36

   // Import two fields, a scalar field and a vector field
group = Import("hyper");
scalarfield = Select(group,0);
vectorfield = Select(group,1);
   // Create a camera
camera = AutoCamera(scalarfield,"off-left",width=10,resolution=400);

   // Create a streamline based on the starting point [3,3,0.1]
streamline = Streamline(vectorfield,[3,3,0.1]);

   // Map the scalar data onto the streamline
mappedline = Map(streamline,scalarfield);
   // Color the line based on the data values. Set range=1 for one
   // complete trip around the color wheel
coloredline = AutoColor(mappedline,range=1);
   // Turn the colored line into a tube
tube = Tube(coloredline,diameter=1.5,ngon=15);
   // Create an image
image1 = Render(tube,camera);


   // This time create a tube directly from the streamline
tube = Tube(streamline,diameter=1.5,ngon=15);
   // Map the data onto the tube
mappedtube = Map(tube,scalarfield);
   // Color the tube
coloredtube = AutoColor(mappedtube,range=1);
   // Create another image
image2 = Render(coloredtube,camera);

   // Collect the images together and arrange them one over the other
combined = Collect(image1,image2);
combined = Arrange(combined,1);
   // Display
Display(combined);