I am currenly implementing marching cubes algorithm using Rust and I faced a problem. This algorithm requires using triangulation table which I copied from GitHub. But which data structure in Rust allow us to store such a data?
Those tuples mean which edges of cubes have to be connected, so they all are different size.
pub fn tri_table()-> Vec<???>
{
return vec![
(),
(0, 8, 3),
(0, 1, 9),
(1, 8, 3, 9, 8, 1),
(1, 2, 10),
(0, 8, 3, 1, 2, 10),
(9, 2, 10, 0, 2, 9),
(2, 8, 3, 2, 10, 8, 10, 9, 8),
(3, 11, 2),
(0, 11, 2, 8, 11, 0),
(1, 9, 0, 2, 3, 11),
(1, 11, 2, 1, 9, 11, 9, 8, 11),
(3, 10, 1, 11, 10, 3),
(0, 10, 1, 0, 8, 10, 8, 11, 10),
(3, 9, 0, 3, 11, 9, 11, 10, 9),
(9, 8, 10, 10, 8, 11),
(4, 7, 8),
...
];
}