/usr/share/dx/samples/scripts/Ribbon is in dxsamples 4.4.0-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | // Import the electron density field
electrondensity = Import("watermolecule");
// Partition for parallelism
electrondensity = Partition(electrondensity);
// Compute the gradient of the electron density field
gradient = Gradient(electrondensity);
// Create a camera
camera = AutoCamera(electrondensity,"off-front");
// Create approximately 10 starting points, scattered through the data
starts = Sample(electrondensity, 10);
// Compute the divergence and curl of the gradient field. We will use the
// curl to put twist on the streamlines
div, curl = DivCurl(gradient);
// Create streamlines from each of the starting points created by Sample.
// The curl is used to give a twist component to the lines, based on the
// vorticity of the vector field.
lines = Streamline(gradient, starts,curl=curl);
// Map the original electron density onto the lines, and color using
// AutoColor
streamlinesmapped = Map(lines,electrondensity);
colored = AutoColor(streamlinesmapped);
// Create ribbons of width 0.2 in user units.
ribbons = Ribbon(colored,width=0.2);
// Display the ribbons
Display(ribbons,camera);
|