1 // Single Voronoi cell example code
3 // Author : Chris H. Rycroft (LBL / UC Berkeley)
4 // Email : chr@alum.mit.edu
5 // Date : June 1st 2008
9 // Parameters controlling the center of the test box
10 const double cx
=1.5,cy
=1.5,cz
=1.5;
16 // Initialize the Voronoi cell to be a cube of side length 16, centered
18 v
.init(-8,8,-8,8,-8,8);
20 // Cut by a grid of points in a box of width one, centered on
22 for(x
=cx
-0.5;x
<cx
+0.55;x
+=0.1) {
23 for(y
=cy
-0.5;y
<cy
+0.55;y
+=0.1) {
24 for(z
=cz
-0.5;z
<cz
+0.55;z
+=0.1) {
30 // Output the Voronoi cell in gnuplot format
31 v
.draw_gnuplot("box_cut.gnu",0,0,0);
33 // Now make a small file that contains the test box
34 v
.init(cx
-0.5,cx
+0.5,cy
-0.5,cy
+0.5,cz
-0.5,cz
+0.5);
35 v
.draw_gnuplot("box_cut.points",0,0,0);