There were some questions like this but none of them helped me with this.
So, how to delete edges based on edge angle (or use boolean math to delete the flat edges)?
The red overpainted edges of the mesh in the image below should get deleted. Each of the edges has 2 vertices of the same height in them.
(The mesh that visualizes the height of the edges is just for clarification purposes.)