2 # POV-Ray will generate an error if it encounters a "degenerate cylinder" where
3 # the two end points are equal. This code will scan the POV-Ray files created
4 # by Voro++, and strip out any of these cases.
6 # Usually, the degenerate cylinders generated by Voro++ are not actually
7 # degenerate in its internal representation (since the code is specifically
8 # structured to avoid cases like that). However, these cases are caused by the
9 # POV-Ray files which are generate only have coordinates specified to a limited
10 # number of decimal places. In a future version, it would be nice for Voro++ to
11 # automatically recognize and ignore these cases.
17 open B
,">@ARGV[0].temp";
19 m/^cylinder{<([-\.\d]+),([-\.\d]+),([-\.\d]+)>,<\1,\2,\3>,r}/?
$a++:(print B
);
21 print "$a cylinders stripped\n";
22 move
("@ARGV[0].temp",@ARGV[0]);