Implementing marching tetrahedra algorithm