Bugfix in search_for_outside_edge routine.
[voro++.git] / trunk / examples / custom / custom_output.pl
blob3daf6b1f8fff79c6d49d2f9594110df941781892
1 #!/usr/bin/perl
3 # Open the custom output from the custom_output.cc program
4 open A,"packing.custom1" or die "Can't open file \"packing.custom1\"\n";
6 # Open the POV-Ray file
7 open B,">custom_output_p.pov" or die "Can't open output file\n";
9 # Loop over all lines in the packing.custom1 file
10 while(<A>) {
12 # Use a regular expression to get the particle position and the number
13 # of faces of the Voronoi cell. These will be stored in the variables
14 # $1 and $2.
15 m/pos=\((.*)\).*faces=(\d*)/;
17 # Print a sphere to the POV-Ray file, giving it a different texture
18 # depending on the number of faces of the Voronoi cell
19 print B "sphere{<$1>,0.5 texture{t$2}}\n";
22 # Close the two files
23 close A;
24 close B;