As we are adding multiple types of meshes (from EdgeMesh to polygonal meshes) it doesn't make sense to have so much code that only switches between TriMesh and TetMesh. There are several cases where we have
auto value = mesh.top_simplex_type() == PrimitiveType::Face ? f(static_cast<const TriMesh&>(mesh)) : f(static_cast<const TetMesh&>(mesh));
My advice is that we develop a visitor pattern, which would involve using a pattern like what is used in std::visit or the overload pattern that is quite common now
As we are adding multiple types of meshes (from EdgeMesh to polygonal meshes) it doesn't make sense to have so much code that only switches between TriMesh and TetMesh. There are several cases where we have
This is definitely not valid.