chr1shr / voro

Voro++: a three-dimensional Voronoi cell library in C++
Other
164 stars 47 forks source link

%o outputs wrong results #28

Closed DonggeJia closed 1 year ago

DonggeJia commented 1 year ago

using %o in print_custom generates sequences consisting a string of 3.

chr1shr commented 1 year ago

This is not a bug. For random point arrangements, most Voronoi cells only have vertices of order 3, which means that it is common to just see lists of 3 with the %o option. You only get vertices of higher order when the particle arrangements have special symmetry.

The platonic.cc example shows a case where you get vertices of different order, since in that case the cutting planes are aligned with extra symmetry. If you add the line v.output_vertex_orders();putchar(\n); after each draw_gnuplot call then you will get this:

3 3 3 3                                     [Tetrahedron]
3 3 3 3 3 3 3 3                             [Cube]
4 4 4 4 4 4                                 [Octahedron]
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3     [Dodecahedron]
Order 5 vertex memory scaled up to 16
5 5 5 5 5 5 5 5 5 5 5 5                     [Icosahedron]

You will see that the octahedron and icosahedron have vertices of higher order.

Because higher order vertices are relatively rare, the code only allocates memory for them when needed, which is why you get the memory status message in the above output.

DonggeJia commented 1 year ago

Get it, thank you so much!