1 Voro++ basic example codes
2 ==========================
3 These programs demonstrate some basic usage of the Voro++ library.
5 1. single_cell.cc introduces the basic voronoicell class. It creates a simple
6 cell by cutting it with a number of random planes. It outputs the cell to a file
7 called single_cell.gnu, which can be visualized in gnuplot using the commands
8 "set style data lines; splot 'single_cell.gnu'".
10 2. platonic.cc uses the voronoicell class to make the five Platonic solids,
11 which are output to files that can be visualized in gnuplot.
13 3. random_points.cc introduces the container class, for holding particle positions
14 in a box. After creating a container, it adds a small number of random points to
15 the box. It then calculates the sum of the volumes of the Voronoi cells, and compares
16 it to the container volume - since the cells should perfectly partition the container,
17 these two should be identical to within numerical accuracy. The code then saves
18 the particles positions "random_points.gnu" and the Voronoi cells to "random_points2.gnu".
19 These can be visualized in gnuplot using the command:
21 splot 'random_points.gnu' with points, 'random_points2.gnu' with lines
23 4. import.cc demonstrates the ability of the code to import a list of particles from
24 a text file. The code imports a text file called 'pack_ten_cube' which contains
25 a thousand particles in a cube of side length 10. Each line of this file has the form:
27 <Numerical ID> <x coordinate> <y coordinate> <z coordinate>
29 The code imports the particles into the container, and then saves the particles
30 and Voronoi cells in gnuplot and POV-Ray formats. To visualize the particles
31 in gnuplot, use the command:
33 splot 'pack_ten_cube' with points, 'cells_ten_cube.gnu' with lines
35 To create a POV-Ray rendering of the particles, the scene header file import.pov must
36 be used, which includes the output from the program. To render an 800x600 image
37 with antialiasing, use the command:
39 povray +W800 +H600 +A0.01 +Oimport.png import.pov