I am looking for code or pseudo-code for the generation of genus $k$ tori triangle meshes. I want to get something like in the image here. Book/paper references, code, github links, etc. are all welcome.
I can't leave a comment, because I don't have enough reputation points.
Do you know how to represent your objects using an implicit function like f(x, y, z)? If so, then you can use Marching Cubes or Dual Contouring, or some similar algorithm to convert that field into a triangle mesh.
As you can see in the source, the tori are multiplied together, and a non-zero isovalue is used.
The final code is at: https://github.com/sjhalayka/k-genus_torus