I'm trying to compute the convex hull of the following set as a set of linear inequalities
$$S := \left\{ \left(x,\max(0,x)\right) \mid l \leq x \leq u \right\}$$
This set is not convex given $l<0<u$. Simple geometry can lead to the solution
However, I would like to know a more general approach that I could, for instance, apply to the following set
$$S = \left\{ (x,y,\max(x,y)) \mid l_x \leq x \leq u_x \land l_y \leq y \leq u_y \right\}$$
$$\text{Conv}(S) = \,?$$
